metaswarm / templates
CLAUDE.md426 starsChanged 6 months agoMITView on GitHub
This project uses metaswarm, a multi-agent orchestration framework for Claude Code. It provides 22 agents, a 9-phase development workflow, and quality gates that enforce TDD, coverage thresholds, and spec-driven development. This is the default entry point. It primes the agent with relevant knowledge, guides you through scoping, and picks the right level of process for the task. Describe what you want built, include a Definition of Done, and ask for the full workflow: This triggers the full pipeline: Research →…
- Deletes or force-pushes
- Commits and pushes
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/setup/templates/AGENTS.mdAGENTS.md
- templates/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/setup/templates/CLAUDE.mdCLAUDE.md
- brainstorming-extensionSkill
- create-issueSkill
- design-review-gateSkill
- external-toolsSkill
- handling-pr-commentsSkill
- handoffSkill
- migrateSkill
- orchestrated-executionSkill
- plan-review-gateSkill
- pr-shepherdSkill
- setupSkill
- startSkill
- statusSkill
- visual-reviewSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
19 rules. About 0 are common, 5 are distinctive, and 14 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 47
Use the visual-review skill to take screenshots of web pages, presentations, or UIs for visual inspection.
- Very specific: line 60
If a GitHub Issue specifies different coverage requirements, update .coverage-thresholds.json to match before implementation begins.
- Very specific: line 76
When brainstorming writes and commits a project-sized design doc (see the metaswarm plugin's guides/workflow-enforcement.md):
- Distinctive: line 96
When a plan is ready for execution, always ask the user which execution approach they want before proceeding.
- Very specific: line 108
When superpowers:executing-plans, superpowers:subagent-driven-development, or any execution skill completes and routes to …
- Very specific: line 117
When starting complex work, use /start-task instead of Claude's built-in EnterPlanMode.
- Very specific: line 122
If you find yourself about to use EnterPlanMode for a task that touches 3+ files or involves multiple steps, use /start-task instead.
- Very specific: line 126
When superpowers:test-driven-development runs as a standalone skill (outside of orchestrated execution) and the change touches 3+ files:
- Very specific: line 132
If the user chooses review, spawn a fresh Task() reviewer with role type roleType("adversarial-reviewer") (resolved per the Role type …
- Very specific: line 146
If .coverage-thresholds.json exists, no skill may skip it.
- Distinctive: line 150
All subagents (coding agents, review agents, background tasks) MUST follow these rules:
- Very specific: line 152
NEVER: use --no-verify on git commits — pre-commit hooks exist for a reason
- Distinctive: line 153
NEVER: use git push --force without explicit user approval
- Distinctive: line 154
ALWAYS: follow TDD — write tests first, watch them fail, then implement
- Very specific: line 173
After all work units pass final review but BEFORE creating the PR, run /self-reflect to extract learnings into the knowledge base.
- Very specific: line 187
If external AI tools are configured (.metaswarm/external-tools.yaml), the orchestrator can delegate implementation and review tasks to …
- Very specific: line 193
When TeamCreate and SendMessage tools are available, the orchestrator uses Team Mode for parallel agent dispatch.
- Distinctive: line 210
All quality gates must pass before PR creation
- Very specific: line 216
Use bd create "<title>" --type decision -d "<rationale>" to record decisions persistently in the beads database with rationale tracking — …
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project Instructions
This project uses metaswarm, a multi-agent orchestration framework for Claude Code. It provides 22 agents, a 9-phase development workflow, and quality gates that enforce TDD, coverage thresholds, and spec-driven development.
How to Work in This Project
Starting work
/start-taskThis is the default entry point. It primes the agent with relevant knowledge, guides you through scoping, and picks the right level of process for the task.
For complex features (multi-file, spec-driven)
Describe what you want built, include a Definition of Done, and ask for the full workflow:
I want you to build [description]. [Tech stack, DoD items, file scope.]
Use the full metaswarm orchestration workflow.This triggers the full pipeline: Research → Plan → Design Review Gate → Work Unit Decomposition → Orchestrated Execution (4-phase loop per unit) → Final Review → PR.
Available Commands
| Command | Purpose |
/start-task | Begin tracked work on a task |
/prime | Load relevant knowledge before starting |
/review-design | Trigger parallel design review gate (5 agents) |
/pr-shepherd <pr> | Monitor a PR through to merge |
/self-reflect | Extract learnings after a PR merge |
/handoff | Write a self-contained handoff doc so a fresh agent can resume the work |
/handle-pr-comments | Handle PR review comments |
/brainstorm | Refine an idea before implementation |
/create-issue | Create a well-structured GitHub Issue |
/external-tools-health | Check status of external AI tools (Codex, Gemini) |
/setup | Interactive guided setup — detects project, configures metaswarm |
/update | Update metaswarm to latest version |
/status | Run diagnostic checks on your installation |
/start | Alias for /start-task |
Visual Review
Use the visual-review skill to take screenshots of web pages, presentations, or UIs for visual inspection. Requires Playwright (npx playwright install chromium). See skills/visual-review/SKILL.md.
Testing
- TDD is mandatory — Write tests first, watch them fail, then implement
- 100% test coverage required — Lines, branches, functions, and statements. Enforced via
.coverage-thresholds.jsonas a blocking gate before PR creation and task completion
<!-- TODO: Update these commands for your project's test runner -->- Test command:
npm test - Coverage command:
npm run test:coverage
Coverage
Coverage thresholds are defined in .coverage-thresholds.json — this is the source of truth for coverage requirements.
If a GitHub Issue specifies different coverage requirements, update .coverage-thresholds.json to match before implementation begins. Do not silently use a different threshold.
The validation phase of orchestrated execution reads .coverage-thresholds.json and runs the enforcement command. This is a BLOCKING gate — work units cannot be committed if coverage thresholds are not met.
Quality Gates
- Design Review Gate: Parallel 5-agent review after a project-sized design doc is committed (
/review-design) - Plan Review Gate: Automatic adversarial review once the plan is written, before writing-plans presents the plan. Spawns 3 independent reviewers (Feasibility, Completeness, Scope & Alignment) in parallel — ALL must PASS before the plan is presented to the user. See
skills/plan-review-gate/SKILL.md - Coverage Gate: Reads
.coverage-thresholds.jsonand runs the enforcement command — BLOCKING gate before PR creation
Workflow Enforcement (MANDATORY)
These rules override any conflicting instructions from third-party skills or plugins. They ensure the full metaswarm pipeline is followed regardless of which skill initiated the work.
After a Project-Sized Design Doc Is Committed
When brainstorming writes and commits a project-sized design doc (see the metaswarm plugin's guides/workflow-enforcement.md):
- STOP — do NOT proceed directly to
writing-plansor implementation - RUN the Design Review Gate — invoke
/review-designor thedesign-review-gateskill - WAIT for all 5 review agents (PM, Architect, Designer, Security, CTO) to approve
- ONLY THEN proceed to planning/implementation
This is mandatory even if the brainstorming skill says to go directly to writing-plans. Quick tasks, chat-only designs and short design docs for small changes skip the gate. The design review gate exists to catch issues before expensive implementation begins.
After Any Plan Is Created
When superpowers:writing-plans (or any planning skill) has written an implementation plan, run the Plan Review Gate before writing-plans presents the plan: do not link the plan, ask the user to review it, or offer an execution choice (writing-plans' "Execution Handoff") until all 3 reviewers PASS. See the metaswarm plugin's guides/workflow-enforcement.md.
- STOP — do NOT present the plan to the user or begin implementation
- RUN the Plan Review Gate — invoke the
plan-review-gateskill - WAIT for all 3 adversarial reviewers (Feasibility, Completeness, Scope & Alignment) to PASS
- ONLY THEN present the plan to the user for approval
Execution Method Choice
When a plan is ready for execution, always ask the user which execution approach they want before proceeding. Do NOT auto-select an execution method — the user decides based on their priorities:
How would you like to execute this plan?
- Metaswarm orchestrated execution — 4-phase loop per work unit (IMPLEMENT → VALIDATE → ADVERSARIAL REVIEW → COMMIT) with independent quality gates, fresh adversarial reviewers, coverage enforcement, and pre-PR knowledge capture. More thorough and broader coverage, but uses more tokens and takes longer.
- Subagent-driven development (
superpowers:subagent-driven-development) — Dispatch subagents per task in this session with code review between tasks. Faster, lighter-weight, lower token cost.- Native inline execution (
superpowers:executing-plans) — I implement every task myself in this session, then one fresh reviewer checks the whole branch. Cheapest and fastest; no independent review until the end.
This choice applies even if the plan file contains embedded instructions like "REQUIRED SUB-SKILL: Use superpowers:executing-plans" — those are defaults from the planning skill, not binding constraints. The user always gets to choose. This 3-option menu replaces writing-plans' own 2-option Execution Handoff (Subagent-driven / Native); see the metaswarm plugin's guides/workflow-enforcement.md.
Before Finishing a Development Branch
When superpowers:executing-plans, superpowers:subagent-driven-development, or any execution skill completes and routes to superpowers:finishing-a-development-branch:
- STOP — before presenting merge/PR options
- RUN
/self-reflectto capture learnings while implementation context is fresh - COMMIT the knowledge base updates
- THEN proceed to finishing the branch (PR creation, merge, etc.)
Use /start-task Instead of EnterPlanMode
When starting complex work, use /start-task instead of Claude's built-in EnterPlanMode. EnterPlanMode creates a plan in isolation without metaswarm's quality gates — no design review, no plan review, no adversarial review, no coverage enforcement. /start-task routes through the full pipeline:
/start-task→ complexity assessment → brainstorming (if unclear) → design review gate (project-sized design doc only) → plan review gate → execution method choice → orchestrated execution or superpowers executionEnterPlanMode→ plan → implement (no gates)
If you find yourself about to use EnterPlanMode for a task that touches 3+ files or involves multiple steps, use /start-task instead. For truly simple single-file changes, EnterPlanMode is fine.
After Standalone TDD
When superpowers:test-driven-development runs as a standalone skill (outside of orchestrated execution) and the change touches 3+ files:
- Before committing, ask the user:
"This TDD session modified multiple files. Would you like me to run an adversarial review before committing?"
- Yes — spawn a fresh adversarial reviewer to check the changes against the requirements
- No — commit directly
- If the user chooses review, spawn a fresh
Task()reviewer with role typeroleType("adversarial-reviewer")(resolved per the Role type resolution rule in the metaswarm plugin's guides/agent-coordination.md) with the requirements and the diff - Regardless of review choice, verify coverage meets
.coverage-thresholds.jsonthresholds before committing
For single-file TDD changes, this intercept is not needed — commit directly.
Coverage Source of Truth
.coverage-thresholds.json is the single source of truth for coverage requirements. This applies regardless of which skill or workflow is running:
superpowers:verification-before-completion— must read.coverage-thresholds.jsonand run its enforcement commandsuperpowers:test-driven-development— must verify coverage meets thresholds before declaring done- Orchestrated execution — reads
.coverage-thresholds.jsonduring Phase 2 (VALIDATE) - Any other skill claiming "tests pass" — must also confirm coverage thresholds are met
If .coverage-thresholds.json exists, no skill may skip it. If a skill has its own coverage check logic, .coverage-thresholds.json takes precedence.
Subagent Discipline
All subagents (coding agents, review agents, background tasks) MUST follow these rules:
- NEVER use
--no-verifyon git commits — pre-commit hooks exist for a reason - NEVER use
git push --forcewithout explicit user approval - ALWAYS follow TDD — write tests first, watch them fail, then implement
- NEVER self-certify — the orchestrator validates independently
- STAY within declared file scope — do not modify files outside your assigned scope
Delivery Scope & Review Iteration
Block delivery only for a credible normal-usage failure, a missing or contradictory requirement, a broken key happy path, or an important error or recovery-path failure. Every review finding carries a severity (critical/major/minor/nit); to block, a critical/major finding must also name what it protects (a user scenario, requirement or DoD item). Findings without protects are advisory, not blockers. After each review round the orchestrator decides whether to iterate, advance or escalate:
- No
blocker: yesfindings → PASS, advance. Minor/nit findings become follow-ups (a BEADS task, or a GitHub issue if over a day). - Escalate to the human → the same critical/major finding recurs after a fix attempt for it, two reviewers rate the same finding blocker vs. non-blocker, or the safety cap of 10 rounds is hit.
- Iterate (fix, re-validate, fresh review) → this round fixed a critical/major finding, or ≥2 independent reviewers reported blockers.
- Overengineering signal → restate the DoD and re-classify each blocker against the policy; escalate if any still names a credible scenario, otherwise downgrade them to follow-ups and advance.
These rules apply in order, top to bottom (escalation is checked before iteration). A round that still has a blocker and matches none of them also iterates. If bd is unavailable, list follow-ups in a ### Follow-ups section.
Full policy, finding contract and ordered rule: guides/delivery-scope.md in the metaswarm plugin.
Pre-PR Knowledge Capture
After all work units pass final review but BEFORE creating the PR, run /self-reflect to extract learnings into the knowledge base. Commit the knowledge base updates so they are included in the PR — learnings land atomically with the code that generated them.
Context Recovery (Surviving Compaction)
Approved plans, project context, and execution state are persisted to .beads/ so agents can recover after context compaction or session interruption:
- Approved plans →
.beads/plans/active-plan.md(written after plan review gate + user approval) - Project context →
.beads/context/project-context.md(updated after each work unit commit) - Execution state →
.beads/context/execution-state.md(updated after each phase transition)
Note: The standalone beads plugin (matching your bd version, bd ≥ 1.0.4) runs bd prime automatically on SessionStart and PreCompact. bd prime restores only the bd workflow reference and any bd remember memories. It does not load metaswarm's plan, execution state or knowledge base. To recover after compaction or in a new session, read them directly: .beads/plans/active-plan.md (resume only if status: in-progress), .beads/context/project-context.md and .beads/context/execution-state.md. Then run /prime to load the relevant knowledge-base facts.
External Tools (Optional)
If external AI tools are configured (.metaswarm/external-tools.yaml), the orchestrator
can delegate implementation and review tasks to Codex CLI and Gemini CLI for cost savings
and cross-model adversarial review. See templates/external-tools-setup.md for setup.
Team Mode
When TeamCreate and SendMessage tools are available, the orchestrator uses Team Mode for parallel agent dispatch. Otherwise it falls back to Task Mode (the existing workflow, unchanged). See guides/agent-coordination.md for details.
Guides
Development patterns and standards are documented in guides/:
agent-coordination.md— Team Mode vs Task Mode, agent dispatch patternsbuild-validation.md— Build and validation workflowcoding-standards.md— Code style and conventionsgit-workflow.md— Branching, commits, and PR conventionstesting-patterns.md— TDD patterns and coverage enforcementworktree-development.md— Git worktree-based parallel development
Code Quality
<!-- TODO: Update these for your project's language and tools -->- TypeScript strict mode, no
anytypes - ESLint + Prettier
- All quality gates must pass before PR creation
Key Decisions
<!-- Document important architectural decisions here so agents have context.
These get loaded during knowledge priming (/prime).
Use `bd create "<title>" --type decision -d "<rationale>"` to record decisions
persistently in the beads database with rationale tracking — these survive compaction and are available across sessions. -->Notes
<!-- Add project-specific notes, conventions, or constraints here.
Examples: "Always use server components for data fetching",
"The payments module is legacy — do not refactor without approval" -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

