Skip to content

Slack Integration

The Slack-related code already has foundational output and Socket Mode handling, but the application layer is not yet wired end-to-end the way Feishu is.

Current code capabilities

ModuleResponsibility
src/slack/slack-socket-mode-app.tsHandles Socket Mode bootstrap
src/slack/slack-message-handler.tsParses Slack messages and routes commands
src/slack/channel/*Renders unified output into Slack messages / updates

Target integration shape

ItemApproach
Event intakeSocket Mode
Message typesmessage / app_mention
Interaction typeblock_actions
Output methodschat.postMessage / chat.update / reactions.* / Stream API

Mapping Feishu cards to Slack Block Kit

Slack does not have a built-in “mention the bot and show a native help card” mechanism. The help panel therefore has to be sent as an app-owned Block Kit message and updated in place through block_actions.

Feishu capabilitySlack implementation
Empty @bot mention returns a help cardWhen app_mention / message matches empty text, slack-message-handler proactively sends the help panel message
Switching panels inside a cardUpdate the same message in place via chat.update
card.action.triggerblock_actions
Main help card homeBlock Kit header + section + actions
Sub-panels (thread/history/skill/backend/turn)Different block views in the same message
Card formsPrefer command-driven flows or modals; current thread creation uses a help-panel button plus a separate form message
Approval buttons inside cardsContinue to use existing Block Kit button actions

Constraints:

  • Path A still applies: the Slack platform entry receives the event, the Platform layer parses it, shared commands or the orchestrator are invoked, and the Slack output layer renders the result.
  • Do not introduce Slack-specific backend identity or thread-state persistence fields.
  • The help panel is only UI navigation; it must not change the main data flow of projectId -> threadRecord -> backendIdentity.

Create the Slack App

StepAction
1Create an app in the Slack developer console
2Enable Bot User
3Enable Socket Mode
4Create an App-level Token
5Configure Bot Token Scopes
6Configure Event Subscriptions and Interactivity
7Install the app to the target workspace

Required tokens

TokenPurpose
Bot User OAuth Token (xoxb-)Calls Web APIs such as chat.postMessage, chat.update, and reactions.*
App-level Token (xapp-)Establishes the WebSocket connection for Socket Mode
dotenv
SLACK_BOT_TOKEN=xoxb-xxx
SLACK_APP_TOKEN=xapp-xxx
ScopePurpose
app_mentions:readReceive app_mention events
chat:writeSend and update messages
reactions:writeAdd / remove emoji reactions
channels:historyRead public-channel message events
groups:historyRead private-channel message events
im:historyRead DM message events
mpim:historyRead multi-party DM message events
connections:writeEstablish Socket Mode connections (App-level Token)

If you only plan to drive commands through app_mention, you can start with the minimum set: app_mentions:read + chat:write, then add the *:history scopes based on the target coverage.

Events and interactions

SettingValue
Bot Eventapp_mention
Bot Eventmessage.channels
Bot Eventmessage.groups
Bot Eventmessage.im
Bot Eventmessage.mpim
InteractivityEnable Block Actions
Socket ModeEnabled

How the current code maps to Slack capabilities

Slack capabilityCode location
Receive events_api / interactiveslack-socket-handler.ts
Handle message / app_mentionslack-socket-handler.ts
Handle block_actionsslack-socket-handler.ts
Send messageschat.postMessage
Update messageschat.update
Stream messageschat.startStream / chat.appendStream / chat.stopStream
Reactionsreactions.add / reactions.remove

Current status

ItemStatus
Low-level packagePresent
Application-layer handlerNot finished
src/server.ts wiringNot finished
Production readinessNeeds full wiring and real validation
bash
rg -n "slack" packages/channel-slack src