| name | add-slack |
| command | /add-slack |
| description | Add Slack as a communication channel |
| requiredEnvVars | ["SLACK_BOT_TOKEN","SLACK_SIGNING_SECRET","SLACK_APP_TOKEN"] |
| requiredTools | ["write_file","read_file","run_code","install_pkg"] |
| platforms | ["linux","macos","windows"] |
| version | 1.0.0 |
| author | betaclaw |
betaclaw Add Slack Skill
You are the Slack integration assistant. Set up a Slack app as a communication channel for betaclaw.
Step 1: Slack App Creation
Guide the user through creating a Slack app:
- Go to https://api.slack.com/apps
- Click "Create New App" > "From scratch"
- Name it (e.g., "betaclaw") and select the workspace
- Under "OAuth & Permissions", add Bot Token Scopes:
chat:write — Send messages
channels:history — Read public channel messages
groups:history — Read private channel messages
im:history — Read DMs
app_mentions:read — Detect mentions
files:read — Read file attachments
- Under "Socket Mode", enable it and generate an App-Level Token with
connections:write scope
- Under "Event Subscriptions", enable and subscribe to:
message.channels
message.groups
message.im
app_mention
- Install the app to the workspace
- Copy the Bot User OAuth Token (
xoxb-...), Signing Secret, and App-Level Token (xapp-...)
Step 2: Collect Credentials
- Prompt for
SLACK_BOT_TOKEN (starts with xoxb-).
- Prompt for
SLACK_SIGNING_SECRET (hex string from Basic Information page).
- Prompt for
SLACK_APP_TOKEN (starts with xapp-, for Socket Mode).
- Store all three in the encrypted vault.
Step 3: Install Dependencies
Run: npm install @slack/bolt
Step 4: Create Channel Adapter
Create src/channels/slack.ts implementing the IChannel interface using @slack/bolt in Socket Mode (no public URL needed):
import { App } from '@slack/bolt';
import type { IChannel, InboundMessage, OutboundMessage, ChannelFeature } from './interface.js';
class SlackChannel implements IChannel {
id = 'slack';
name = 'Slack';
private app: App;
private messageHandler: ((msg: InboundMessage) => void) | null = null;
constructor(botToken: string, appToken: string, signingSecret: string) {
this.app = new App({
token: botToken,
appToken: appToken,
signingSecret: signingSecret,
socketMode: true,
});
}
async connect(): Promise<void> {
this.app.( ({ message }) => {
(!. || message.) ;
( message && message) {
.({
: message. ?? ,
: message.,
: message. ?? ,
: message. ?? ,
: (message. ?? ) * ,
: ( message) ? message. : ,
});
}
});
..();
}
(): <> {
..();
}
(: ): <> {
....({
: msg.,
: msg.,
: msg.,
});
}
(: ): {
. = handler;
}
(: ): {
: [] = [, , , , ];
supported.(f);
}
}
Adapt to match the project's exact interface and conventions.
Step 5: Register Channel
- Add
slack to the enabled channels list in .beta/config.toon.
- Register with the orchestrator.
Step 6: Configure
Ask the user:
- Channels to monitor: Which Slack channels should the bot listen in (invite the bot first).
- Trigger mode: Respond to all messages, only app mentions, or specific trigger words.
- Thread behavior: Reply in threads to keep channels clean (recommended).
Step 7: Test Connection
- Start the Slack app in Socket Mode.
- Verify the bot appears online in Slack.
- Ask the user to mention the bot or send a DM.
- Verify the message is received and a response is sent.
Step 8: Confirm
Report:
- Slack app is connected via Socket Mode (no public URL required)
- Listening in configured channels
- All credentials stored securely in vault
- Uses Socket Mode so no need for a public-facing server
- To adjust: use
/customize to change Slack settings