create-slack-app
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate Slack App
创建Slack应用
Help the developer create a Slack app or agent using Bolt for $0.
This skill walks through the full setup: prerequisites, authentication, sandbox creation, project scaffolding from a template, and running the app locally.
帮助开发者使用Bolt免费创建Slack应用或Agent。
本技能会引导完成完整设置流程:前置条件检查、身份验证、沙箱创建、基于模板搭建项目以及本地运行应用。
Step 1: Check Prerequisites
步骤1:检查前置条件
1a. Detect the Slack CLI command
1a. 检测Slack CLI命令
Use the skill — Step 1: Detect the Slack CLI — to check whether the public Slack CLI is installed and resolve its command name. The fingerprint check, alias fallback, and install instructions all live there; do not duplicate them here.
slack:slack-cliOnce resolved, use the detected command name for all CLI commands throughout the rest of this skill. We refer to it as below — substitute the actual resolved command name everywhere you see .
SLACK_CMDSLACK_CMD使用技能 —— 步骤1:检测Slack CLI —— 检查公共Slack CLI是否已安装并解析其命令名称。指纹检查、别名回退和安装说明均在该技能中,请勿在此处重复。
slack:slack-cli解析完成后,后续所有CLI命令均使用检测到的命令名称。以下我们将其称为 —— 所有出现的地方请替换为实际解析出的命令名称。
SLACK_CMDSLACK_CMD1b. Verify the CLI version
1b. 验证CLI版本
Run and print the version to confirm everything is working before continuing.
SLACK_CMD version运行并打印版本信息,确认一切正常后再继续。
SLACK_CMD version1c. Check language runtime
1c. 检查语言运行时
- If is
$0: Runbolt-jsto verify Node.js is installed (v18+ required). If not installed, suggestnode --versionor point to https://nodejs.org.brew install node - If is
$0: Runbolt-pythonto verify Python is installed (3.6+ required). If not installed, suggestpython3 --versionor point to https://python.org.brew install python3
- 若为
$0:运行bolt-js验证Node.js是否已安装(需要v18+版本)。若未安装,建议使用node --version或访问https://nodejs.org。brew install node - 若为
$0:运行bolt-python验证Python是否已安装(需要3.6+版本)。若未安装,建议使用python3 --version或访问https://python.org。brew install python3
Step 2: Authenticate with the Slack CLI
步骤2:通过Slack CLI进行身份验证
Use the skill — Step 5: Authentication () — to check the developer's auth status and walk them through if they're not already authenticated.
slack:slack-clislack authSLACK_CMD loginWait for confirmation that authentication succeeded before proceeding.
使用技能 —— 步骤5:身份验证() —— 检查开发者的身份验证状态,若未验证则引导他们运行。
slack:slack-clislack authSLACK_CMD login等待身份验证成功的确认后再继续。
Step 3: Set Up a Developer Sandbox
步骤3:设置开发者沙箱
Run to check if the developer already has a sandbox.
SLACK_CMD sandbox list-
If a sandbox exists: Show it and confirm they want to use it.
-
If no sandbox exists: Tell the developer to create one:text
! SLACK_CMD sandbox createAlternatively, they can create one at https://api.slack.com/developer-program/sandboxes or join the Developer Program at https://api.slack.com/developer-program/join.
Wait for confirmation that a sandbox is available before proceeding.
运行检查开发者是否已有沙箱。
SLACK_CMD sandbox list-
若沙箱已存在:展示沙箱信息并确认他们是否要使用该沙箱。
-
若沙箱不存在:告知开发者创建沙箱:text
! SLACK_CMD sandbox create或者,他们也可以在https://api.slack.com/developer-program/sandboxes创建沙箱,或加入开发者计划:https://api.slack.com/developer-program/join。
等待确认沙箱可用后再继续。
Step 4: Create the App from a Template
步骤4:从模板创建应用
Ask the developer what kind of app they want to build. Present the available templates based on their chosen framework ():
$0询问开发者想要构建哪种类型的应用。根据他们选择的框架()展示可用模板:
$0bolt-js templates
bolt-js模板
| Template | Repo | Description |
|---|---|---|
| Starter Template | | Basic Bolt JS app — great starting point |
| Starter Agent | | Minimal AI agent using Claude/OpenAI |
| Support Agent | | AI-powered IT helpdesk agent |
| Getting Started | | Official getting started tutorial app |
| Examples | | Unified showcase of Slack features |
| 模板 | 仓库 | 描述 |
|---|---|---|
| Starter Template | | 基础Bolt JS应用——绝佳起点 |
| Starter Agent | | 使用Claude/OpenAI的极简AI Agent |
| Support Agent | | AI驱动的IT服务台Agent |
| Getting Started | | 官方入门教程应用 |
| Examples | | Slack功能统一展示示例 |
bolt-python templates
bolt-python模板
| Template | Repo | Description |
|---|---|---|
| Starter Template | | Basic Bolt Python app — great starting point |
| Starter Agent | | Minimal AI agent using Claude/OpenAI/Pydantic AI |
| Support Agent | | AI-powered IT helpdesk agent |
| Assistant Template | | Agents & Assistants template |
| Examples | | Unified showcase of Slack features |
Use AskUserQuestion to let the developer pick a template. Recommend the Starter Template for first-timers or the Starter Agent if they want to build an AI agent.
| 模板 | 仓库 | 描述 |
|---|---|---|
| Starter Template | | 基础Bolt Python应用——绝佳起点 |
| Starter Agent | | 使用Claude/OpenAI/Pydantic AI的极简AI Agent |
| Support Agent | | AI驱动的IT服务台Agent |
| Assistant Template | | Agent与助手模板 |
| Examples | | Slack功能统一展示示例 |
使用AskUserQuestion让开发者选择模板。对于首次使用者推荐Starter Template,若他们想构建AI Agent则推荐Starter Agent。
4a. Choose an AI provider (agent templates only)
4a. 选择AI提供商(仅Agent模板)
If the developer picks Starter Agent or Support Agent, these templates contain subdirectories for different AI providers. Ask the developer which provider they want to use via AskUserQuestion:
bolt-js subdirectories:
| Subdir | Description |
|---|---|
| Uses Anthropic's Claude Agent SDK |
| Uses OpenAI's Agents SDK |
bolt-python subdirectories:
| Subdir | Description |
|---|---|
| Uses Anthropic's Claude Agent SDK |
| Uses OpenAI's Agents SDK |
| Uses Pydantic AI (supports multiple LLM backends) |
Recommend Claude Agent SDK as the default option.
若开发者选择Starter Agent或Support Agent,这些模板包含不同AI提供商的子目录。通过AskUserQuestion询问开发者想要使用的提供商:
bolt-js子目录:
| 子目录 | 描述 |
|---|---|
| 使用Anthropic的Claude Agent SDK |
| 使用OpenAI的Agents SDK |
bolt-python子目录:
| 子目录 | 描述 |
|---|---|
| 使用Anthropic的Claude Agent SDK |
| 使用OpenAI的Agents SDK |
| 使用Pydantic AI(支持多个LLM后端) |
默认推荐Claude Agent SDK。
4b. Name and create the project
4b. 命名并创建项目
Ask what they want to name their project (suggest a default like ), then run:
my-slack-appFor templates WITHOUT subdirectories (Starter Template, Getting Started, Assistant Template, Examples):
bash
SLACK_CMD create <project-name> -t <template-repo>For agent templates WITH subdirectories (Starter Agent, Support Agent):
bash
SLACK_CMD create <project-name> -t <template-repo> --subdir <chosen-subdir>For example:
bash
undefined询问他们想要给项目起什么名字(建议默认名称如),然后运行:
my-slack-app对于无包子目录的模板(Starter Template、Getting Started、Assistant Template、Examples):
bash
SLACK_CMD create <project-name> -t <template-repo>对于有子目录的Agent模板(Starter Agent、Support Agent):
bash
SLACK_CMD create <project-name> -t <template-repo> --subdir <chosen-subdir>示例:
bash
undefinedNon-agent template
非Agent模板
SLACK_CMD create my-slack-app -t slack-samples/bolt-js-starter-template
SLACK_CMD create my-slack-app -t slack-samples/bolt-js-starter-template
Agent template with provider subdir
带提供商子目录的Agent模板
SLACK_CMD create my-slack-agent -t slack-samples/bolt-js-starter-agent --subdir claude-agent-sdk
Confirm the project was created successfully by checking that the directory exists and listing its contents.SLACK_CMD create my-slack-agent -t slack-samples/bolt-js-starter-agent --subdir claude-agent-sdk
通过检查目录是否存在并列出其内容来确认项目创建成功。4c. Set required environment variables (agent templates only)
4c. 设置所需环境变量(仅Agent模板)
If the developer chose an agent template (Starter Agent or Support Agent), they need to set the required API key for their chosen AI provider. Ask for the key value using AskUserQuestion, then set it using the Slack CLI from within the project directory.
Required environment variables by provider:
| Provider | Env Variable | Description |
|---|---|---|
| | Anthropic API key |
| | OpenAI API key |
| | OpenAI API key (required). Optionally also |
Use AskUserQuestion to ask the developer for their API key value(s). Then set each one:
bash
cd <project-name> && SLACK_CMD env set <ENV_VAR_NAME> <value>For example:
bash
cd my-slack-agent && SLACK_CMD env set ANTHROPIC_API_KEY sk-ant-...Important: Do NOT store or echo API key values in logs or output. Only pass them directly to .
SLACK_CMD env set若开发者选择了Agent模板(Starter Agent或Support Agent),他们需要为所选AI提供商设置所需的API密钥。使用AskUserQuestion询问密钥值,然后在项目目录内通过Slack CLI设置。
各提供商所需环境变量:
| 提供商 | 环境变量 | 描述 |
|---|---|---|
| | Anthropic API密钥 |
| | OpenAI API密钥 |
| | OpenAI API密钥(必填)。若使用Anthropic作为后端,可选择同时设置 |
使用AskUserQuestion询问开发者的API密钥值。然后逐个设置:
bash
cd <project-name> && SLACK_CMD env set <ENV_VAR_NAME> <value>示例:
bash
cd my-slack-agent && SLACK_CMD env set ANTHROPIC_API_KEY sk-ant-...重要提示:请勿在日志或输出中存储或回显API密钥值。仅直接将其传递给。
SLACK_CMD env setStep 5: Run the App Locally
步骤5:本地运行应用
Use the skill — Step 6: Running an App Locally () — to resolve the app or team target and start the dev server in the background.
slack:slack-clislack runTell the developer their app is now running and installed in their sandbox workspace, and that file changes will auto-reload it.
使用技能 —— 步骤6:本地运行应用() —— 解析应用或团队目标并在后台启动开发服务器。
slack:slack-clislack run告知开发者他们的应用现已运行并安装在沙箱工作区中,文件更改会自动重新加载应用。
Step 6: Next Steps
步骤6:后续步骤
After the app is running, suggest next steps:
- Explore the code: Read through the project files together — offer to explain the app structure, manifest, listeners, etc.
- Make a change: Suggest a small modification (like changing a message response) to see hot-reload in action.
- Add features: Based on the template, suggest relevant Slack features to add (slash commands, events, modals, AI capabilities, etc.).
- Check the docs: Point to https://docs.slack.dev for the full Slack Platform documentation.
应用运行后,建议后续操作:
- 探索代码:一起阅读项目文件——可提供应用结构、清单、监听器等内容的讲解。
- 进行修改:建议进行小修改(如更改消息响应)以查看热重载效果。
- 添加功能:基于所选模板,建议添加相关Slack功能(斜杠命令、事件、模态框、AI功能等)。
- 查阅文档:指向https://docs.slack.dev获取完整的Slack平台文档。
Notes
注意事项
- is a placeholder — always substitute the actual command name resolved in Step 1a (typically
SLACK_CMD, but may be an alias).slack - This skill focuses on Bolt for JavaScript and Bolt for Python only. Do not suggest Deno, workflow apps, or (hosted deployment).
slack deploy - is an interactive command that requires user input — it does NOT work with the
SLACK_CMD sandbox createprefix in Claude Code. Instead, tell the developer to run it in a new terminal window.! command - If the developer hits issues, suggest to diagnose their setup.
SLACK_CMD doctor
- 是占位符——请始终替换为步骤1a中解析出的实际命令名称(通常为
SLACK_CMD,但可能是别名)。slack - 本技能仅聚焦于Bolt for JavaScript和Bolt for Python。请勿推荐Deno、工作流应用或(托管部署)。
slack deploy - 是交互式命令,需要用户输入——在Claude Code中使用
SLACK_CMD sandbox create前缀无法生效。请告知开发者在新终端窗口中运行该命令。! command - 若开发者遇到问题,建议使用诊断其设置。
SLACK_CMD doctor