create-slack-app

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create 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
slack:slack-cli
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.
Once resolved, use the detected command name for all CLI commands throughout the rest of this skill. We refer to it as
SLACK_CMD
below — substitute the actual resolved command name everywhere you see
SLACK_CMD
.
使用
slack:slack-cli
技能 —— 步骤1:检测Slack CLI —— 检查公共Slack CLI是否已安装并解析其命令名称。指纹检查、别名回退和安装说明均在该技能中,请勿在此处重复。
解析完成后,后续所有CLI命令均使用检测到的命令名称。以下我们将其称为
SLACK_CMD
—— 所有出现
SLACK_CMD
的地方请替换为实际解析出的命令名称。

1b. Verify the CLI version

1b. 验证CLI版本

Run
SLACK_CMD version
and print the version to confirm everything is working before continuing.
运行
SLACK_CMD version
并打印版本信息,确认一切正常后再继续。

1c. Check language runtime

1c. 检查语言运行时

  • If
    $0
    is
    bolt-js
    : Run
    node --version
    to verify Node.js is installed (v18+ required). If not installed, suggest
    brew install node
    or point to https://nodejs.org.
  • If
    $0
    is
    bolt-python
    : Run
    python3 --version
    to verify Python is installed (3.6+ required). If not installed, suggest
    brew install python3
    or point to https://python.org.

  • $0
    bolt-js
    :运行
    node --version
    验证Node.js是否已安装(需要v18+版本)。若未安装,建议使用
    brew install node
    或访问https://nodejs.org
  • $0
    bolt-python
    :运行
    python3 --version
    验证Python是否已安装(需要3.6+版本)。若未安装,建议使用
    brew install python3
    或访问https://python.org

Step 2: Authenticate with the Slack CLI

步骤2:通过Slack CLI进行身份验证

Use the
slack:slack-cli
skill — Step 5: Authentication (
slack auth
)
— to check the developer's auth status and walk them through
SLACK_CMD login
if they're not already authenticated.
Wait for confirmation that authentication succeeded before proceeding.

使用
slack:slack-cli
技能 —— 步骤5:身份验证(
slack auth
—— 检查开发者的身份验证状态,若未验证则引导他们运行
SLACK_CMD login
等待身份验证成功的确认后再继续。

Step 3: Set Up a Developer Sandbox

步骤3:设置开发者沙箱

Run
SLACK_CMD sandbox list
to check if the developer already has a sandbox.
Wait for confirmation that a sandbox is available before proceeding.

运行
SLACK_CMD sandbox list
检查开发者是否已有沙箱。
等待确认沙箱可用后再继续。

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
):
询问开发者想要构建哪种类型的应用。根据他们选择的框架(
$0
)展示可用模板:

bolt-js templates

bolt-js模板

TemplateRepoDescription
Starter Template
slack-samples/bolt-js-starter-template
Basic Bolt JS app — great starting point
Starter Agent
slack-samples/bolt-js-starter-agent
Minimal AI agent using Claude/OpenAI
Support Agent
slack-samples/bolt-js-support-agent
AI-powered IT helpdesk agent
Getting Started
slack-samples/bolt-js-getting-started-app
Official getting started tutorial app
Examples
slack-samples/bolt-js-examples
Unified showcase of Slack features
模板仓库描述
Starter Template
slack-samples/bolt-js-starter-template
基础Bolt JS应用——绝佳起点
Starter Agent
slack-samples/bolt-js-starter-agent
使用Claude/OpenAI的极简AI Agent
Support Agent
slack-samples/bolt-js-support-agent
AI驱动的IT服务台Agent
Getting Started
slack-samples/bolt-js-getting-started-app
官方入门教程应用
Examples
slack-samples/bolt-js-examples
Slack功能统一展示示例

bolt-python templates

bolt-python模板

TemplateRepoDescription
Starter Template
slack-samples/bolt-python-starter-template
Basic Bolt Python app — great starting point
Starter Agent
slack-samples/bolt-python-starter-agent
Minimal AI agent using Claude/OpenAI/Pydantic AI
Support Agent
slack-samples/bolt-python-support-agent
AI-powered IT helpdesk agent
Assistant Template
slack-samples/bolt-python-assistant-template
Agents & Assistants template
Examples
slack-samples/bolt-python-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
slack-samples/bolt-python-starter-template
基础Bolt Python应用——绝佳起点
Starter Agent
slack-samples/bolt-python-starter-agent
使用Claude/OpenAI/Pydantic AI的极简AI Agent
Support Agent
slack-samples/bolt-python-support-agent
AI驱动的IT服务台Agent
Assistant Template
slack-samples/bolt-python-assistant-template
Agent与助手模板
Examples
slack-samples/bolt-python-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:
SubdirDescription
claude-agent-sdk
Uses Anthropic's Claude Agent SDK
openai-agents-sdk
Uses OpenAI's Agents SDK
bolt-python subdirectories:
SubdirDescription
claude-agent-sdk
Uses Anthropic's Claude Agent SDK
openai-agents-sdk
Uses OpenAI's Agents SDK
pydantic-ai
Uses Pydantic AI (supports multiple LLM backends)
Recommend Claude Agent SDK as the default option.
若开发者选择Starter AgentSupport Agent,这些模板包含不同AI提供商的子目录。通过AskUserQuestion询问开发者想要使用的提供商:
bolt-js子目录:
子目录描述
claude-agent-sdk
使用Anthropic的Claude Agent SDK
openai-agents-sdk
使用OpenAI的Agents SDK
bolt-python子目录:
子目录描述
claude-agent-sdk
使用Anthropic的Claude Agent SDK
openai-agents-sdk
使用OpenAI的Agents SDK
pydantic-ai
使用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
my-slack-app
), then run:
For 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
undefined

Non-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:
ProviderEnv VariableDescription
claude-agent-sdk
ANTHROPIC_API_KEY
Anthropic API key
openai-agents-sdk
OPENAI_API_KEY
OpenAI API key
pydantic-ai
OPENAI_API_KEY
OpenAI API key (required). Optionally also
ANTHROPIC_API_KEY
if using Anthropic as the backend — if both are set, Anthropic is used by default.
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设置。
各提供商所需环境变量:
提供商环境变量描述
claude-agent-sdk
ANTHROPIC_API_KEY
Anthropic API密钥
openai-agents-sdk
OPENAI_API_KEY
OpenAI API密钥
pydantic-ai
OPENAI_API_KEY
OpenAI API密钥(必填)。若使用Anthropic作为后端,可选择同时设置
ANTHROPIC_API_KEY
——若两者均设置,默认使用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 set

Step 5: Run the App Locally

步骤5:本地运行应用

Use the
slack:slack-cli
skill — Step 6: Running an App Locally (
slack run
)
— to resolve the app or team target and start the dev server in the background.
Tell the developer their app is now running and installed in their sandbox workspace, and that file changes will auto-reload it.

使用
slack:slack-cli
技能 —— 步骤6:本地运行应用(
slack run
—— 解析应用或团队目标并在后台启动开发服务器。
告知开发者他们的应用现已运行并安装在沙箱工作区中,文件更改会自动重新加载应用。

Step 6: Next Steps

步骤6:后续步骤

After the app is running, suggest next steps:
  1. Explore the code: Read through the project files together — offer to explain the app structure, manifest, listeners, etc.
  2. Make a change: Suggest a small modification (like changing a message response) to see hot-reload in action.
  3. Add features: Based on the template, suggest relevant Slack features to add (slash commands, events, modals, AI capabilities, etc.).
  4. Check the docs: Point to https://docs.slack.dev for the full Slack Platform documentation.

应用运行后,建议后续操作:
  1. 探索代码:一起阅读项目文件——可提供应用结构、清单、监听器等内容的讲解。
  2. 进行修改:建议进行小修改(如更改消息响应)以查看热重载效果。
  3. 添加功能:基于所选模板,建议添加相关Slack功能(斜杠命令、事件、模态框、AI功能等)。
  4. 查阅文档:指向https://docs.slack.dev获取完整的Slack平台文档。

Notes

注意事项

  • SLACK_CMD
    is a placeholder — always substitute the actual command name resolved in Step 1a (typically
    slack
    , but may be an alias).
  • This skill focuses on Bolt for JavaScript and Bolt for Python only. Do not suggest Deno, workflow apps, or
    slack deploy
    (hosted deployment).
  • SLACK_CMD sandbox create
    is an interactive command that requires user input — it does NOT work with the
    ! command
    prefix in Claude Code. Instead, tell the developer to run it in a new terminal window.
  • If the developer hits issues, suggest
    SLACK_CMD doctor
    to diagnose their setup.
  • SLACK_CMD
    是占位符——请始终替换为步骤1a中解析出的实际命令名称(通常为
    slack
    ,但可能是别名)。
  • 本技能仅聚焦于Bolt for JavaScriptBolt for Python。请勿推荐Deno、工作流应用或
    slack deploy
    (托管部署)。
  • SLACK_CMD sandbox create
    是交互式命令,需要用户输入——在Claude Code中使用
    ! command
    前缀无法生效。请告知开发者在新终端窗口中运行该命令。
  • 若开发者遇到问题,建议使用
    SLACK_CMD doctor
    诊断其设置。