From dispatch-slack
Start or stop the Slack bot server that connects local Claude Code to Slack. Use when the user wants to run the bot, start the server, connect to Slack, stop the bot, kill the server, or disconnect from Slack.
npx claudepluginhub runbear-io/skills --plugin dispatch-slackThis skill is limited to using the following tools:
Start, stop, restart, or check the status of the Slack bot server, which connects local Claude Code to Slack via the Agent SDK.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Analyzes BMad project state from catalog CSV, configs, artifacts, and query to recommend next skills or answer questions. Useful for help requests, 'what next', or starting BMad.
Start, stop, restart, or check the status of the Slack bot server, which connects local Claude Code to Slack via the Agent SDK.
The server entry point is scripts/index.js. The default port is 3032 (override with --port <number> or PORT env var).
Parse $ARGUMENTS for:
start, stop, restart, status (default: start)Examples:
/dispatch-slack:dispatch start /Users/me/my-project/dispatch-slack:dispatch stop/dispatch-slack:dispatch (defaults to start)Before executing the start command, ask the user which mode to run in:
/workspace. Requires Docker to be installed.If the user does not specify, default to local.
lsof -ti:${PORT:-3032} 2>/dev/null
If already running, inform the user and ask if they want to restart.
.env in the project root ($PROJECT_ROOT) has the required vars:grep -c "^SLACK_BOT_TOKEN\|^SLACK_BOT_REFRESH_TOKEN" "$PROJECT_ROOT/.env"
grep -c "^SLACK_APP_TOKEN" "$PROJECT_ROOT/.env"
If missing, tell the user to run /dispatch-slack:init first.
node_modules/ is missing):cd "$SKILL_DIR" && npm install
.env from the project root to the skill directory so the server can load it:cp "$PROJECT_ROOT/.env" "$SKILL_DIR/.env"
PROJECT_DIR="/private/tmp/claude-$(id -u)/$(echo "$PROJECT_ROOT" | tr '/' '-')" && SESSION_ID="$(find "$PROJECT_DIR"/*/tasks -name "*.output" -maxdepth 1 2>/dev/null | xargs ls -t 2>/dev/null | head -1 | sed "s|$PROJECT_DIR/||;s|/tasks/.*||")" && cd "$SKILL_DIR" && npm start -- --cwd "$PROJECT_ROOT" --session-id "$SESSION_ID" $ARGUMENTS
Run this in the background so the conversation can continue.
Wait a few seconds, then check output to confirm "Slack bot started" appears.
docker compose version
If not installed, tell the user to install Docker and try again, or use local mode instead.
.env has a credential the container can use. Check in this order:
CLAUDE_CODE_OAUTH_TOKEN — preferred for Docker (works on all platforms)ANTHROPIC_API_KEY — also worksgrep -c "^CLAUDE_CODE_OAUTH_TOKEN\|^ANTHROPIC_API_KEY" "$PROJECT_ROOT/.env"
If neither is set, tell the user to run claude setup-token on the host machine. This opens a browser OAuth flow and generates a long-lived token (sk-ant-oat01-...). Then add it to .env:
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
.env into the skill directory so Docker can access it:cp "$PROJECT_ROOT/.env" "$SKILL_DIR/.env"
Ask the user which directory to mount as the workspace. Default to $PROJECT_ROOT.
Build and start with the workspace mounted:
cd "$SKILL_DIR" && WORKSPACE_PATH="<workspace-dir>" docker compose up -d --build
Replace <workspace-dir> with the absolute path the user chose (default: $PROJECT_ROOT). The project is mounted at the same path inside the container so Claude Code session keys match the host, enabling session continuity.
docker compose -f "$SKILL_DIR/docker-compose.yml" logs --tail 20
Confirm "Slack bot started" appears in the logs.
kill $(lsof -ti:${PORT:-3032}) 2>/dev/null
cd "$SKILL_DIR" && docker compose down
Stop then start (preserves mode and any working directory argument).
Local:
lsof -ti:${PORT:-3032} 2>/dev/null
If a PID is returned, the server is running. Otherwise it is stopped.
Docker:
docker compose -f "$SKILL_DIR/docker-compose.yml" ps
POST /api/query — run a prompt, return full JSON response. POST /api/query/stream — run a prompt, stream via SSE. POST /api/slack/init — start Slack bot at runtime with a refresh token.
Request body for query endpoints: prompt (required), cwd, sessionId, allowedTools, systemPrompt.
0.0.0.0, not 127.0.0.1. It accepts connections from any interface.CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY in .env. Generate an OAuth token with claude setup-token. The ~/.claude directory is also mounted read-only (useful on Linux where credentials are file-based, but insufficient on macOS where auth is stored in Keychain)./workspace.