Skip to content

Slack Integration

AI Intern connects directly to your team Slack workspace. Developers can trigger coding tasks, inspect plans, and grant approval directly in thread conversations.

The Slack integration is powered by the Orchestrator Worker and Durable Objects:

  1. Inbound Webhook: Slack sends event notifications (app_mention or direct message) to POST /api/slack/events.
  2. Signature Verification: The Worker validates the X-Slack-Signature and timestamp using your configured SLACK_SIGNING_SECRET.
  3. Task Coordination: The CodingOrchestrator parses the prompt, identifies referenced GitHub repositories, and formulates a plan.
  4. Interactive Card: Slash commands reply with a Block Kit card. Mentions post via SLACK_BOT_TOKEN (chat.postMessage) on the thread DO named slack:{team}:{channel}:{thread_ts}. Empty bot token: no card, no run.
  5. Repo resolution: GitHub URL in the mention/thread, else SLACK_CHANNEL_REPOS, else an in-thread ask — never a guessed repo.
  1. Create a Slack App Fastest: at api.slack.com/apps choose Create New App → From a manifest and paste slack-app-manifest.yaml from the repository root — it declares the scopes, app_mention event, /ai-intern command, and interactivity below. Edit the two your-worker.workers.dev URLs to your Worker hostname. Manual alternative:

  2. Configure Bot Token Scopes Under OAuth & Permissions, add the following Bot Token Scopes:

    • chat:write (post messages and replies)
    • app_mentions:read (listen for @AI Intern mentions)
    • channels:history (read thread context)
  3. Enable Event Subscriptions Set the Request URL to your Cloudflare Worker endpoint:

    https://your-worker.workers.dev/api/slack/events

    Subscribe to bot events: app_mention.

  4. Enable Interactivity Under Interactivity & Shortcuts, enable interactivity and set the Request URL:

    https://your-worker.workers.dev/api/slack/interact
  5. Store Secrets with Wrangler Set the secrets in your Cloudflare environment:

    Terminal window
    pnpm wrangler secret put SLACK_BOT_TOKEN
    pnpm wrangler secret put SLACK_SIGNING_SECRET

    Mentions need SLACK_BOT_TOKEN. Map channels to repos with the SLACK_CHANNEL_REPOS var ({"C123":"https://github.com/owner/repo"}). SLACK_APPROVERS is a comma-separated list of Slack user ids; unset means nobody can approve.

In any public or private channel where the bot is invited:

Developer: @AI Intern fix the typo in README.md and add pnpm instructions

AI Intern: 📋 Delegation Plan Prepared

  • Target: princepal9120/ai-intern (main branch)
  • Action: Update README.md
  • Test Command: pnpm test

[ Approve Run ] [ Reject ]

Once approved, AI Intern spins up an isolated sandbox container, runs the changes, and posts the resulting GitHub PR link directly in the thread.