demo-swarm
CLAUDE.md0 starsChanged 9 months agoApache-2.0View on GitHub
This repository contains an SDLC swarm pack under .claude/. Operational reality: This file is attached to every agent thread in Claude Code. Treat it as repo-level policy + shared contracts (not a marketing doc). If flow commands, agent prompts, or pack-check drift from what's written here, update the pack so everything agrees. This pack provides: Then proceed in order (unless you are intentionally running out-of-order): /flow-2-plan → /flow-3-build → /flow-4-review → /flow-5-gate → /flow-6-deploy → /flow-7-wisdom Quick links for reviewers:…
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 5 are distinctive, and 4 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.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
7 skills: test-runner, auto-linter, policy-runner, runs-derive, runs-index, openq-tools, secrets-tools
- Distinctive: line 107
Before posting to GitHub, two conditions apply:
- Very specific: line 114
Run folders keep their names.
- Distinctive: line 122
Every run that produces a PR must produce a PR Brief (hotspots, quality events, proof pointers, explicit "not measured")
- Distinctive: line 124
Avoid "dev vs machine" framing.
- Very specific: line 196
Run artifacts live under: .runs/<run-id>/<flow>/
- Very specific: line 257
UNVERIFIED vs PARTIAL: Use PARTIAL only for flows with unbounded iteration loops (like Flow 4 review worklist processing).
- Very specific: line 261
PARTIAL is a checkpoint: When Flow 4 exhausts context mid-worklist, PARTIAL means "real progress made, more to do, rerun to continue."
- Distinctive: line 271
Test/lint command adaptation
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 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
CLAUDE.md
This repository contains an SDLC swarm pack under .claude/.
Operational reality: This file is attached to every agent thread in Claude Code. Treat it as repo-level policy + shared contracts (not a marketing doc). If flow commands, agent prompts, or pack-check drift from what's written here, update the pack so everything agrees.
For Humans
This pack provides:
- 7 flows: Signal → Plan → Build → Review → Gate → Deploy → Wisdom
- Narrow specialist agents: requirements-author, code-critic, test-author, *-cleanup, etc. (see
.claude/agents/) - 7 skills: test-runner, auto-linter, policy-runner, runs-derive, runs-index, openq-tools, secrets-tools
Start here:
/flow-1-signal "your feature idea"Then proceed in order (unless you are intentionally running out-of-order):
/flow-2-plan → /flow-3-build → /flow-4-review → /flow-5-gate → /flow-6-deploy → /flow-7-wisdom
Quick links for reviewers:
- What is quality here? — the multi-sensor trust panel
- How do I review a swarm PR? — the decision procedure
- Show me examples — sample artifacts
Core Philosophy
Engineering is default-allow. Publishing is gated.
The pack is a build pipeline with guardrails, not a guardrail pipeline that sometimes builds. Agents explore, implement, and iterate freely. Gates engage only at publish boundaries (commit, push, GitHub post).
The thesis: Humans author intent. Swarms manufacture verified change. Reviewers audit the cockpit, not the diff.
The ratio: Quality per DevLT (PR quality achieved per minute of developer attention). Compute is cheap; architect attention is expensive. Trade accordingly.
See: docs/explanation/why-ops-first.md
Rules (The Constitution)
Claude Code rules live in .claude/rules/. They encode the physics and vibe that shape all behavior.
| Rule | What It Governs |
00-doctrine.md | Core thesis, the triangle, anti-austerity |
10-operating-model.md | PM + IC swarm, when to spawn agents |
20-intent-to-narrative.md | The pipeline from intent to PR |
30-autonomy-and-boundaries.md | Default-allow + strict gates |
40-evidence-and-quality.md | Claims require pointers, the quality panel |
50-agent-contract.md | Agent prompts (scoped to .claude/agents/) |
60-flow-orchestrators.md | Flow commands (scoped to .claude/commands/flow-*) |
70-docs-and-teaching.md | Documentation (scoped to docs/) |
80-developer-experience.md | UX, accessibility, investing in quality |
90-voice-and-tone.md | How we communicate: industrial clarity, human warmth |
Rules are the constitution Claude loads reliably. CLAUDE.md is the contract. Docs are the textbook.
Agent Philosophy
Orchestrators are PMs. Agents are well-trained juniors.
Orchestrators scope work, route tasks, and make sequencing decisions. Agents do real cognitive work: they think, investigate, make judgment calls, and produce artifacts with substance. Agents are not clipboard-copiers or template-fillers.
Why spawn an agent? Two reasons only:
- Do work — The task requires focused expertise (code-implementer writes code, test-author writes tests)
- Compress context — A specialist can summarize, filter, or derive information more efficiently than carrying full context forward
Every agent returns two things:
- An answer — What they found, built, or concluded
- A routing suggestion — What should happen next and why
Honest partial reports are successful outcomes. An agent that completes 60% of the work and clearly documents what's done, what's blocked, and what to try next has succeeded. Failure to complete work is not failure as an agent. Hiding uncertainty behind false completion is the actual failure mode.
Artifacts exist because content matters. Receipts tell stories about what happened. Decision documents explain reasoning. These artifacts have value as records and communication, not just as routing gates. Write them for the next reader (human or agent), not for a parser.
Single responsibility, done deeply. Each agent has one clear job. They do it thoroughly, then hand off. code-critic critiques but never fixes. code-implementer implements but never commits. repo-operator handles git but doesn't judge code quality.
See: docs/explanation/agent-philosophy.md
Coordination Patterns
These patterns keep agents aligned without over-constraining them:
- Repo root orientation Commands run from repo root; paths are repo-root-relative. This keeps agents oriented consistently.
- Git ownership
repo-operatorowns git operations. Other agents describe what they want ("commit these changes with this message") rather than running git directly. This concentrates git expertise and prevents conflicts. - Natural language routing Orchestrators route based on what agents tell them in their handoff response. Agents explain what happened and recommend next steps. Files on disk are durable records, not routing inputs.
Publish gates Before posting to GitHub, two conditions apply:
- Secrets scan passes (no credentials in content)
- Repo is in a clean, pushable state
These gates protect the publish boundary, not internal iteration.
- Stable run identities
Run folders keep their names. If a run's meaning changes, update metadata (
canonical_key,aliases[]) rather than renaming directories.
PR Review Interface
Most reviewers will only read the GitHub PR description. Treat it as the cockpit display.
- Every run that produces a PR must produce a PR Brief (hotspots, quality events, proof pointers, explicit "not measured")
- Receipts are the underlying truth; the PR Brief is the primary human interface; the diff is spot-check/audit
- Avoid "dev vs machine" framing. This is a developer enablement system: cheap iteration buys verification so humans spend time on decisions
See: docs/reference/pr-review-interface.md for the template and guidelines.
See: docs/explanation/reviewing-as-audit.md for the philosophy.
The Seven Flows
7 logical flows exposed via 8 slash commands (7 flow commands + /customize-pack).
| Flow | Slash Command | Key Outputs |
| 1. Signal | /flow-1-signal | requirements.md, features/*.feature, signal_receipt.json |
| 2. Plan | /flow-2-plan | adr.md, api_contracts.yaml, work_plan.md, plan_receipt.json |
| 3. Build | /flow-3-build | code/tests, critiques, build_receipt.json, Draft PR |
| 4. Review | /flow-4-review | review_worklist.md, review_receipt.json |
| 5. Gate | /flow-5-gate | merge_decision.md, gate_receipt.json |
| 6. Deploy | /flow-6-deploy | verification_report.md, deploy_receipt.json |
| 7. Wisdom | /flow-7-wisdom | learnings.md, wisdom_receipt.json |
Counts clarified:
- 7 flows: The logical SDLC stages (Signal through Wisdom)
- 8 commands: 7 flow commands +
/customize-packfor pack configuration - 7 tool skills: Mechanical tools invoked by agents (test-runner, auto-linter, etc.)
- 13 workflow skills: Structured methodology guides (commit, debug, explore, etc.)
Out-of-order is allowed: proceed best-effort, document assumptions, expect UNVERIFIED outcomes when upstream artifacts are missing.
Skills
Tool Skills
Deterministic helpers invoked by agents during flows. No judgment, no decisions — just mechanical execution.
| Skill | Purpose |
test-runner | Run tests, capture output to run artifacts |
auto-linter | Format + lint code |
policy-runner | Run policy-as-code checks |
runs-derive | Read-only .runs derivations (counts, extraction) |
runs-index | Write .runs/index.json updates |
openq-tools | Open questions register (QID generation) |
secrets-tools | Secrets scanning/redaction for publish gates |
Workflow Skills
Structured methodology guides invoked as slash commands for ad-hoc developer workflows outside the flow model.
| Skill | Purpose |
commit | Create commits with forensic evidence |
pr-create | Create pull requests with evidence |
pr-prep | Check branch readiness for PR submission |
explore | Systematically explore a codebase |
debug | Systematic debugging workflow |
refactor | Safe refactoring with verification |
review | Code review with evidence-based feedback |
fix | Bug fix workflow with verification |
feature | Feature implementation workflow |
forensic | Evidence-first execution discipline |
spec-exec | Execute a specification completely |
docs | Documentation using Diataxis framework |
changelog | Generate changelog from git history |
Run State
Run artifacts live under: .runs/<run-id>/<flow>/
Example: .runs/feat-auth/build/impl_changes_summary.md
See: docs/reference/run-state.md for schemas (index.json, run_meta.json)
Handoffs
Agents communicate through natural language. When an agent finishes work, it provides a handoff:
- What was done? — Summary of work completed
- What still needs to be done? — Remaining work, blockers, open questions
- My recommendation — Specific next step with reasoning
Orchestrators read these responses and route accordingly. There's no parsing of structured blocks; agents are trusted to communicate clearly.
Always make a recommendation. Name specific agents when you know them. Explain your reasoning. If you're uncertain, say so and explain why.
Specialized agents (like secrets-sanitizer, repo-operator) include specific details the orchestrator needs to make routing decisions, but these are part of a natural response, not a machine-parsed format.
See: docs/reference/contracts.md for communication patterns and examples.
Architecture Principles
Seven principles that guide how agents collaborate:
- Clear roles — Orchestrators scope and route. Agents do focused work. Cleanup agents verify state.
- Resume-ready — Agents check what exists on disk when they start. They pick up where things left off rather than assuming a blank slate.
- Workers own their ledger — The agent who does the work updates the status. If you wrote the code, you update the implementation status.
- Completion = verified — Work is complete when tests pass and the orchestrator agrees. Partial progress with honest reporting is a valid intermediate state.
- Research before asking — Investigate the codebase, derive from patterns, choose safe defaults, then escalate only if truly stuck.
- Foundation first — Infrastructure and shared components come before features that depend on them.
- Local resolution — When something doesn't fit, try to resolve it within your scope before bouncing back to earlier flows.
See: docs/explanation/architecture.md for details and examples.
Status Semantics
Cleanup agents report completion using these statuses:
| Status | Meaning | When to Use |
VERIFIED | Converged. Evidence panel green, evidence fresh, blockers empty. | Work complete, all checks passed |
UNVERIFIED | Not converged, but checkpointed. Artifacts written, state captured, resumable. | Missing verification, contradictions, blockers |
PARTIAL | Progress made in unbounded loop. More iterations needed. | Flow 4 worklists, iterative refinement only |
CANNOT_PROCEED | Mechanical failure. Tooling broken, permissions missing, infra down. | Environment issues preventing any work |
Key distinctions:
- UNVERIFIED vs PARTIAL: Use
PARTIALonly for flows with unbounded iteration loops (like Flow 4 review worklist processing). For all other incomplete work (missing artifacts, failed checks, contradictions), useUNVERIFIED. - UNVERIFIED is not failure. It's honest state that enables routing. A receipt with
UNVERIFIEDand documented gaps is more valuable than blocking. - PARTIAL is a checkpoint. When Flow 4 exhausts context mid-worklist,
PARTIALmeans "real progress made, more to do, rerun to continue."
See: docs/reference/run-state.md for receipt schemas.
Customization
See docs/how-to/customize-pack.md for:
- Prerequisites (bash/jq/grep, Windows/WSL2/Git Bash)
- Test/lint command adaptation
- Source layout changes
- Git provider adaptation
Troubleshooting
See docs/how-to/troubleshoot.md for common situations:
- Mechanical failures — Environment or tooling issues blocking execution
- GitHub operations not happening — Check that secrets scan passed and repo is in pushable state
- Loops not terminating — Follow the agent's recommended action
- Missing information — Check that upstream artifacts contain the expected content
CLI Tooling
Agents invoke via shims (never assume PATH):
bash .claude/scripts/pack-check.sh [OPTIONS] # Pack validation
bash .claude/scripts/demoswarm.sh <command> # CLI operationsSee: docs/reference/demoswarm-cli.md for command reference.
Reference Index
| Topic | Location |
| Rules (constitution) | .claude/rules/*.md |
| Explanation docs | docs/explanation/ |
| The Thesis | docs/explanation/the-thesis.md |
| The Physics | docs/explanation/the-physics.md |
| Laws of the Swarm | docs/explanation/laws-of-the-swarm.md |
| Economics | docs/explanation/economics.md |
| Agent Philosophy | docs/explanation/agent-philosophy.md |
| Architecture | docs/explanation/architecture.md |
| Emergent Phenomena | docs/explanation/emergent-phenomena.md |
| Authority vs Difficulty | docs/explanation/authority-not-difficulty.md |
| Org Design as Code | docs/explanation/org-design-as-code.md |
| Reviewing as Audit | docs/explanation/reviewing-as-audit.md |
| Codebase as Mold | docs/explanation/codebase-as-mold.md |
| Reference docs | docs/reference/ |
| Communication patterns | docs/reference/contracts.md |
| Schemas | docs/reference/schemas.md |
| Run state schemas | docs/reference/run-state.md |
| Stable markers | docs/reference/stable-markers.md |
| Trust model | docs/reference/trust-model.md |
| Calibration | docs/reference/calibration.md |
| CLI commands | docs/reference/demoswarm-cli.md |
| Glossary | docs/reference/glossary.md |
| Agents index | docs/reference/agents-index.md |
| How-to guides | docs/how-to/ |
| Example artifacts | docs/examples/ |
| Flow commands | .claude/commands/flow-*.md |
| Agent prompts | .claude/agents/*.md |
In this repository21 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- auto-linterSkill
- changelogSkill
- commitSkill
- debugSkill
- docsSkill
- exploreSkill
- featureSkill
- fixSkill
- forensicSkill
- openq-toolsSkill
- policy-runnerSkill
- pr-createSkill
- pr-prepSkill
- refactorSkill
- reviewSkill
- runs-deriveSkill
- runs-indexSkill
- secrets-toolsSkill
- spec-execSkill
- test-runnerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

