skills/swarm-protocol/SKILL.md
Multi-agent development orchestration for complex projects. Use this skill when orchestrating parallel development workstreams, coordinating multiple agent tasks, managing project documentation structure, or executing `/swarm-protocol` commands. Triggers on: (1) `/swarm-protocol <project-name>` to initialize new projects with full planning, (2) `/swarm-protocol` (no args) to continue existing or start new project, (3) requests involving parallel agent coordination, milestone commits, or multi-phase development workflows.
npx skillsauth add co8/cc-plugins swarm-protocolInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Turn complex projects into parallel agent swarms. One command to go from idea to merged PR.
Orchestrates specialized subagents across planning, implementation, and review phases with worktree isolation for conflict-free parallelization, progressive status tracking for real-time monitoring, and a multi-lens review council (via council-review) that catches architecture issues, bugs, security holes, compliance gaps, silent failures, type design issues, stale comments, and unnecessary complexity — all before you merge.
/swarm-protocol <name> creates docs, branches, worktree, and starts planningcouncil-review: architect, correctness, security, compliance, silent-failure, type/comment, and simplification lenses — all in parallel, synthesized to consensusswarm-status.json with progressive auto-updates for ScopeTUI integration--resume, retry single agents with --agent=N.M--from-plan=<name>| Command | Purpose |
| --------------------------------------------- | ------------------------------------------------------- |
| /swarm-protocol <project-name> | Initialize new project with full planning phase |
| /swarm-protocol | Continue existing project, convert a plan, or start new |
| /swarm-protocol --from-plan=<name> | Convert a specific plan file to swarm project |
| /swarm-protocol --review-only | Run only the Council Review phase on current changes |
/swarm-protocol (No Arguments)Smart detection: Check branch (feature/<name>) → docs/projects/ → ~/.claude/plans/ → prompt user.
Detection priority:
feature/<name> → match project in docs/projects/<name>/~/.claude/plans/ available for conversionProject names: Random from Barcelona region pool (rubi, sitges, mura, tiana, etc.)
Plan conversion: Parse plan → auto-populate PROJECT_PLAN.md, IMPLEMENTATION_PLAN.md, AGENT_SWARM_SPEC.md → review before execution.
/swarm-protocol <project-name>Initialize and execute a multi-agent development project.
docs/projects/<name>/ with: PROJECT_PLAN.md, IMPLEMENTATION_PLAN.md, AGENT_SWARM_SPEC.md, CODE_REVIEW.md, CHANGELOG.mdgit worktree add ../<repo>-<name> -b feature/<name>supabase branches create <name>CRITICAL: swarm-status.json MUST be created at Phase 0 and updated automatically at every action. The ScopeTUI Swarm Monitor (scopetui --swarm) depends on this file being accurate. Stale status = broken monitoring.
Location: docs/projects/<name>/swarm-status.json inside the worktree (not master).
Full schema + progressive update protocol: See references/swarm-status-schema.md.
Update BEFORE and AFTER every Agent dispatch — never batch updates.
BEFORE dispatching agent → set agent "running" + write file
AFTER agent returns → set agent "completed"/"failed" + write file
BEFORE phase transition → advance currentPhaseId + write file
# Atomic status update via jq (define once, use throughout)
swarm_update() {
local file="$1" agent_id="$2" new_status="$3" now
now=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
jq --arg aid "$agent_id" --arg st "$new_status" --arg now "$now" '
(.phases[].agents[] | select(.id == $aid)) |= (
.status = $st |
if $st == "running" then .startedAt = $now
elif $st == "completed" then .completedAt = $now
else . end
) | .updatedAt = $now
' "$file" > "${file}.tmp" && mv "${file}.tmp" "$file"
}
# Usage: swarm_update docs/projects/<name>/swarm-status.json "2.1" "running"
The main session (orchestrator) writes all status updates. Subagents NEVER touch swarm-status.json. This prevents race conditions and ensures consistent state.
phases array):{
"project": "<name>",
"branch": "feature/<name>",
"currentPhaseId": "<active-phase-id>",
"phases": [
{
"id": "1", "name": "Setup", "status": "completed",
"agents": [{ "id": "1.1", "name": "Types", "status": "completed", "subagentType": "general-purpose" }]
}
],
"updatedAt": "<ISO 8601>"
}
feature-dev:code-architect)Generate all planning documents before implementation. See references/templates.md for document templates.
Dispatch: Use Agent tool with subagent_type: "feature-dev:code-architect" for architecture design, and subagent_type: "feature-dev:code-explorer" for codebase analysis.
Planning sequence:
feature-dev:code-explorer agent to analyze existing codebase patterns, trace execution paths, map dependenciesfeature-dev:code-architect agent to design implementation blueprint based on exploration resultssubagent_type assignments, parallelization strategyMandatory review of all planning docs before any execution agent runs. Garbage plan → garbage swarm. Catch it here.
In swarm-status.json, this is a phase with id "1.5" and name "Doc Review".
Dispatch (parallel — launch ALL in a single message):
| Agent | Subagent Type | Focus |
|-------|--------------|-------|
| 1.5.1 Plan Reviewer | feature-dev:code-reviewer | PROJECT_PLAN goals, success criteria, dependencies, risk coverage |
| 1.5.2 Architecture Reviewer | feature-dev:code-architect | IMPLEMENTATION_PLAN soundness, file change scope, migration safety |
| 1.5.3 Swarm Spec Reviewer | feature-dev:code-reviewer | AGENT_SWARM_SPEC parallelization correctness, file conflict analysis, subagent_type assignments |
Each reviewer answers:
feature-dev:code-explorer checks against claims)?Output: Append findings to PROJECT_PLAN.md under ## Doc Review Findings section, categorized by severity (Blocker / Major / Minor).
Gate criteria:
Commit:
git commit -m "docs(<project>): doc review complete - <N> blockers, <N> major, <N> minor"
Why this phase exists: planning agents hallucinate. A reviewer pass on the plan costs minutes; executing a flawed plan costs hours. Catch architecture mismatches, missing migrations, and false parallelization claims before they cascade into broken execution.
Agent dispatch: Use the Agent tool for all agent invocations. See references/agent-dispatch.md for the centralized dispatch protocol mapping roles → subagent_types.
Worktree isolation: For parallel agents that touch overlapping directories, use isolation: "worktree" on the Agent tool call. This gives each agent an isolated repo copy, eliminating file conflicts and enabling more aggressive parallelization.
Parallelization rules:
run_in_background: true for agents whose results aren't needed immediatelyProgress display: See references/templates.md for colored box format, ANSI codes, and ASCII art variants.
Status symbols: ● (green/complete), ◐ (yellow/in-progress), ○ (dim gray/pending)
Milestone commits (after each phase):
git add -A
git commit -m "feat(<project>): complete phase N - <description>
- Agent N.1: <summary>
- Agent N.2: <summary>
Co-Authored-By: Claude Code <[email protected]>"
Quality gates (invoke after relevant phases):
react-doctor skill if React projectsmart-test skill for intelligent test selectionfull-test-coverage skill to verify pyramid coverageReview: Invoke the council-review skill on the phase diff. Council is the shared review primitive — it runs a parallel team of specialized read-only reviewers, synthesizes their findings, resolves conflicts via a debate-to-consensus pass, and writes the verdict to CODE_REVIEW.md. Swarm does NOT inline its own reviewer dispatch anymore; council owns review, swarm owns repair. One source of truth.
In swarm-status.json, this is a single phase with id "review-repair" and name "Council Review & Repair", containing the council invocation + repair agent.
# Review the current phase diff through the council.
council-review --paste # or council-review <branch> against the phase base
The council runs these lenses in parallel (see council-review/SKILL.md for full dispatch):
| # | Lens | Subagent Type |
|---|------|--------------|
| C.1 | Architect | feature-dev:code-architect |
| C.2 | Correctness | feature-dev:code-reviewer |
| C.3 | Security | feature-dev:code-reviewer (security prompt) |
| C.4 | Silent Failures | pr-review-toolkit:silent-failure-hunter |
| C.5 | Types + Comments | pr-review-toolkit:type-design-analyzer |
| C.6 | Simplification | pr-review-toolkit:code-simplifier |
| C.7 | Compliance (HIPAA/EU) | feature-dev:code-reviewer (compliance prompt) — conditional, PHI surfaces only |
Council adds the architect and compliance lenses swarm previously lacked — swarm inherits them for free. Council writes CODE_REVIEW.md per the schema in council-review/references/code-review-schema.md; the Resolution column is left empty for the repair conductor to fill.
After council returns: CODE_REVIEW.md holds a ranked, deduplicated, conflict-resolved findings table. Repair works against it directly — no re-consolidation needed.
Repair steps:
Repair rules:
Resolution column in CODE_REVIEW.md for every addressed itemValidate that all repairs are correct and the project is ready for merge.
Verification steps:
npm run test && npm run typecheck && npm run lintfeature-dev:code-reviewer on repair diff to confirm no regressions introducedMandatory final phase before merge. Write a single-page debrief that any operator can read in under 2 minutes to understand the project's state.
Deliverables:
docs/projects/<name>/DEBRIEF.md — one page (≤ 80 lines, excluding diagram)docs/projects/<name>/diagrams/<NN>-debrief-stack.svg — single B/W SVG showing phase pipeline + key metricsRequired sections (use template):
Hard rules:
Template: references/debrief-template.md (full structure + visual style guide + anti-patterns)
Why this phase exists: at merge gate, the project owner needs ONE artifact that captures state without reading 10 docs. Debrief is the executive summary; everything else is the supporting evidence. If the debrief can't fit on one page, the project state is too vague to merge.
| Flag | Purpose |
| -------------------- | --------------------------------------------------------------------------------------- |
| --skip-worktree | Use current branch instead of creating worktree |
| --skip-preview | Skip Supabase preview branch creation |
| --phases=1,2 | Run only specific phases |
| --dry-run | Generate plans only, no execution |
| --from-phase=N | Resume from specific phase |
| --agent=N.M | Run single agent only |
| --from-plan=<name> | Convert a specific plan file to project (e.g., --from-plan=scalable-forging-lovelace) |
| --resume | Auto-detect last incomplete agent and resume from there |
| --max-agents=N | Limit concurrent parallel agents (default: 4) |
| --graph | Output agent dependency graph in Mermaid format |
| --review-only | Run only the Council Review phase on current changes (no planning/execution) |
| --isolate | Force worktree isolation for all parallel agents |
If project uses Supabase preview branches, see references/supabase-deployment.md for the full deployment workflow including migration validation loops, advisor checks, and production deployment steps.
Quick ref: supabase db push --linked → fix errors → run advisors → consolidate → deploy to production.
CRITICAL: Always use the correct subagent_type when dispatching agents. See references/agent-dispatch.md for the complete mapping.
Quick reference:
| Agent Role | Subagent Type | When to Use |
|-----------|--------------|-------------|
| Codebase exploration | Explore | Understanding existing code, finding patterns |
| Architecture design | feature-dev:code-architect | Planning implementation, designing components |
| Deep codebase analysis | feature-dev:code-explorer | Tracing execution paths, mapping dependencies |
| Code review | feature-dev:code-reviewer | Reviewing for bugs, security, conventions |
| Silent failure hunting | pr-review-toolkit:silent-failure-hunter | Finding swallowed errors, bad fallbacks |
| Type design review | pr-review-toolkit:type-design-analyzer | Reviewing type encapsulation, invariants |
| Comment review | pr-review-toolkit:comment-analyzer | Checking comment accuracy, staleness |
| Code simplification | pr-review-toolkit:code-simplifier | Reducing complexity, improving clarity |
| Test coverage analysis | pr-review-toolkit:pr-test-analyzer | Reviewing test completeness |
| General implementation | general-purpose | Default for coding agents |
| Planning | Plan | Designing implementation strategies |
Dispatch rules:
run_in_background: true for agents whose output isn't needed to proceedisolation: "worktree" when parallel agents may touch overlapping filesresume parameterParallelization: Safe when different files/dirs, independent features, tests for completed work. Sequential for dependency chains (Schema→Types→API), base→composite components, core→integration. Use isolation: "worktree" to unlock parallelism when agents share directories.
Agent scope: Single responsibility, own specific files (no overlap), define completion criteria, include validation.
Communication: IMPLEMENTATION_PLAN.md + type definitions (shared context), file system (deliverables), CHANGELOG.md (progress).
| Failure | Action | | -------------------- | ------------------------------------------------------------------- | | Timeout (>15min) | Log to CHANGELOG, mark blocked, continue non-dependent, prompt user | | Error | Log, retry once, if fails pause and prompt, block dependents | | File Conflict | Halt agents, alert user, request resolution |
Recovery: /swarm-protocol --resume (auto-resume) | /swarm-protocol-protocol --agent=2.3 --retry | /swarm-protocol-protocol --skip-agent=2.3
After merge: move docs to docs/archive/, remove worktree, delete feature branch, clean Supabase preview if used.
mv docs/projects/<name> docs/archive/<name>
git worktree remove ../<repo>-<name>
git branch -d feature/<name>
supabase branches delete <name> # if applicable
Plan thoroughly → Use specialized subagent types → Keep agents focused → Define interfaces first → Launch parallel agents in single messages → Commit per phase → Review via council → Repair all issues → Verify before merge → Document decisions in CODE_REVIEW.md
| File | Load When |
| ----------------------------------- | ---------------------------------- |
| references/agent-dispatch.md | Always (subagent type mapping) |
| references/templates.md | Always (document templates) |
| references/agent-patterns.md | Always (agent configurations) |
| references/supabase-deployment.md | DB migrations present |
| references/progress-art.md | Display customization |
development
Multi-agent code review council. A parallel team of specialized read-only reviewers (architect, correctness, security, compliance, silent-failures, type/comment, simplification) audits a diff, a synthesis agent consolidates findings, and a debate-consensus pass resolves conflicts into a single ranked verdict. Use this skill when reviewing a PR, branch, or diff before merge — standalone, or as the review primitive invoked by swarm-protocol's review-repair phase. Triggers on: (1) `/council-review <PR URL | branch | diff>`, (2) `/council-review` (no args) to review current uncommitted changes, (3) requests to review code with multiple specialized lenses or to gate a merge.
tools
Development best practices and project patterns. Use when starting projects, setting up CLAUDE.md, coding TypeScript/Next.js/React/Supabase, implementing AI flows, data fetching, testing, deployment, git workflows, browser automation, centralized configuration, or Tailwind CSS v4.
tools
Manage which Vercel plugin skills are enabled or disabled. Use when the user wants to disable noisy Vercel skills, enable previously disabled skills, or see which skills are active. Invoked via /manage-vercel-skills.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.