Skills

Migrate Slack Agents

Migrate a classic single-bot Slack install to one provisioned Slack app per existing...

Install

npx skills add nanocoai/nanoclaw --skill migrate-slack-agents -g -a claude-code -y
Repository
nanocoai/nanoclaw31.1k
Category
AI and agents
Updated
5d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
No, instructions only

What it does

Migrate a classic single-bot Slack install to one provisioned Slack app per existing agent group while preserving agent identities, workspaces, memory, and wiring behavior, or record the operator's choice to stay on classic, which remains supported. Use when /update-nanoclaw surfaces the Slack agents requirement, or standalone any time later.

Migrate classic Slack agents

Turn every agent group wired through the classic instance='slack' adapter into a named slack-<slug> bot without replacing the agent group. This is an operator-guided, resumable data migration. It never creates an agent group and never edits an agent workspace.

Migration is optional. Classic single-bot Slack remains fully supported; this skill first offers the choice, and staying on classic is a valid outcome that also satisfies the update requirement.

Hard invariants:

  • Never call create_agent or ncl groups create.
  • Never change an agent_groups.id or write under groups/<folder>/.
  • Never merge the channels branch; fetch and copy skill-owned files only.
  • Never print token values. Show key names and masked presence only.
  • Keep classic rows, credentials, and the shared Slack app available for rollback until the operator explicitly approves cutover.

Phase 1: Detect classic state

Run from the NanoClaw project root. Read the central DB only through the sanctioned wrapper.

Classic state requires all four signals:

  1. src/channels/index.ts contains the Slack barrel import import './slack.js';.

  2. .env has a non-empty unsuffixed SLACK_BOT_TOKEN and either a non-empty SLACK_APP_TOKEN or SLACK_SIGNING_SECRET. Check presence without echoing values.

  3. This query returns at least one row:

    pnpm exec tsx scripts/q.ts data/v2.db "SELECT mg.id, mga.id, mga.agent_group_id FROM messaging_groups mg JOIN messaging_group_agents mga ON mga.messaging_group_id=mg.id WHERE mg.channel_type='slack' AND mg.instance='slack' ORDER BY mg.id, mga.agent_group_id"
    
  4. At least one wired group does not yet have complete named-instance coverage: a stable slug, both SLACK_BOT_TOKEN_<SUFFIX> and SLACK_APP_TOKEN_<SUFFIX>, that slug in SLACK_INSTANCES, and the expected slack-<slug> messaging-group/wiring rows.

Read the whole SKILL.md on GitHub

More in AI and agents