SKILL.md--- name: add-slack description: Add Slack channel integration via Chat SDK. --- # Add Slack Channel Adds Slack support via the Chat SDK bridge. Trunk ships no channels — this skill copies the Slack channel layer (adapter, shared lib, bot-inbound guard, provisioning core, container skills) in from the `channels` branch. The **Apply** steps carry `nc:` directive fences (an agent applies the prose, a parser the directives); all idempotent. This is the base Slack experience: one bot, DM and channel chat. The Slack **agents** feature — child bots provisioned from `create_agent`, shared rooms, canvases, DM onboarding — ships separately in `/slack-a2a-rooms` + `/slack-agent-flow`, in-tree under `.claude/skills/` (their canonical home; the channels branch keeps a compatibility copy for older checkouts). The setup wizard applies them automatically, and they can be applied on top of this install at any time. Existing classic installs that want the Slack agents experience should use `/migrate-slack-agents` rather than re-running this skill (classic keeps working; that migration is optional). ## Apply ### 1. Copy the channel payload Fetch the `channels` branch and copy the payload into place (overwrite — the branch is canonical): ```nc:copy from-branch:channels src/channels/slack.ts src/channels/slack-lib.ts src/channels/slack-lib.test.ts src/channels/slack-a2a-guard.ts src/channels/slack-a2a-guard.test.ts src/channels/slack-raw-text.ts src/channels/slack-raw-text.test.ts src/channels/slack-registration.test.ts src/channels/slack-instances-registration.test.ts src/channels/slack-long-replies.test.ts src/provisioning/slack-app.ts src/provisioning/slack-app.test.ts container/skills/slack-formatting/SKILL.md ``` - **Adapter + shared lib** (`slack.ts`, `slack-lib.ts`): bridge registration, wiring defaults, conversation resolver, the native `SLACK_INSTANCES` loop — pinned by the two registration tests. - **Bot-inbound guard** (`slack-a2a-guard.ts`): drops bot-authored inbound at the bridge by default; feature skills register a narrower admission policy on its seam. - **Raw-text recovery** (`slack-raw-text.ts`): recovers pasted tables, which Slack delivers as attachment blocks in `message.raw` rather than as text — `slack.ts` imports it directly, so it travels with the adapter. - **Provisioning core** (`src/provisioning/slack-app.ts`): manifest template, scope/event constants, and the broker + manager-token transports for creating a Slack app programmatically. Nothing on the adapter path imports it — the setup wizard's auto-provision pre-step and feature skills do. - **Container skills**: `slack-formatting/` (mrkdwn syntax; synced to `~/.claude/skills`). The room/canvas/onboarding host modules, their container files, and the Slack welcome-tour addendum (it describes rooms, canvases, and the agents access model) are part of the agents feature and install with `/slac