agentleFS
EffortlessMetricsEffortlessMetrics/demo-swarm/CLAUDE.md

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
  1. Distinctive:

    7 skills: test-runner, auto-linter, policy-runner, runs-derive, runs-index, openq-tools, secrets-tools

    line 15
  2. Distinctive:

    Before posting to GitHub, two conditions apply:

    line 107
  3. Very specific:

    Run folders keep their names.

    line 114
  4. Distinctive:

    Every run that produces a PR must produce a PR Brief (hotspots, quality events, proof pointers, explicit "not measured")

    line 122
  5. Distinctive:

    Avoid "dev vs machine" framing.

    line 124
  6. Very specific:

    Run artifacts live under: .runs/<run-id>/<flow>/

    line 196
  7. Very specific:

    UNVERIFIED vs PARTIAL: Use PARTIAL only for flows with unbounded iteration loops (like Flow 4 review worklist processing).

    line 257
  8. Very specific:

    PARTIAL is a checkpoint: When Flow 4 exhausts context mid-worklist, PARTIAL means "real progress made, more to do, rerun to continue."

    line 261
  9. Distinctive:

    Test/lint command adaptation

    line 271

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

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.

RuleWhat It Governs
00-doctrine.mdCore thesis, the triangle, anti-austerity
10-operating-model.mdPM + IC swarm, when to spawn agents
20-intent-to-narrative.mdThe pipeline from intent to PR
30-autonomy-and-boundaries.mdDefault-allow + strict gates
40-evidence-and-quality.mdClaims require pointers, the quality panel
50-agent-contract.mdAgent prompts (scoped to .claude/agents/)
60-flow-orchestrators.mdFlow commands (scoped to .claude/commands/flow-*)
70-docs-and-teaching.mdDocumentation (scoped to docs/)
80-developer-experience.mdUX, accessibility, investing in quality
90-voice-and-tone.mdHow 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:

  1. Do work — The task requires focused expertise (code-implementer writes code, test-author writes tests)
  2. Compress context — A specialist can summarize, filter, or derive information more efficiently than carrying full context forward

Every agent returns two things:

  1. An answer — What they found, built, or concluded
  2. 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:

  1. Repo root orientation Commands run from repo root; paths are repo-root-relative. This keeps agents oriented consistently.
  2. Git ownership repo-operator owns 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.
  3. 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.
  4. 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.

  5. 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).

FlowSlash CommandKey Outputs
1. Signal/flow-1-signalrequirements.md, features/*.feature, signal_receipt.json
2. Plan/flow-2-planadr.md, api_contracts.yaml, work_plan.md, plan_receipt.json
3. Build/flow-3-buildcode/tests, critiques, build_receipt.json, Draft PR
4. Review/flow-4-reviewreview_worklist.md, review_receipt.json
5. Gate/flow-5-gatemerge_decision.md, gate_receipt.json
6. Deploy/flow-6-deployverification_report.md, deploy_receipt.json
7. Wisdom/flow-7-wisdomlearnings.md, wisdom_receipt.json

Counts clarified:

  • 7 flows: The logical SDLC stages (Signal through Wisdom)
  • 8 commands: 7 flow commands + /customize-pack for 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.

SkillPurpose
test-runnerRun tests, capture output to run artifacts
auto-linterFormat + lint code
policy-runnerRun policy-as-code checks
runs-deriveRead-only .runs derivations (counts, extraction)
runs-indexWrite .runs/index.json updates
openq-toolsOpen questions register (QID generation)
secrets-toolsSecrets scanning/redaction for publish gates

Workflow Skills

Structured methodology guides invoked as slash commands for ad-hoc developer workflows outside the flow model.

SkillPurpose
commitCreate commits with forensic evidence
pr-createCreate pull requests with evidence
pr-prepCheck branch readiness for PR submission
exploreSystematically explore a codebase
debugSystematic debugging workflow
refactorSafe refactoring with verification
reviewCode review with evidence-based feedback
fixBug fix workflow with verification
featureFeature implementation workflow
forensicEvidence-first execution discipline
spec-execExecute a specification completely
docsDocumentation using Diataxis framework
changelogGenerate 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:

  1. What was done? — Summary of work completed
  2. What still needs to be done? — Remaining work, blockers, open questions
  3. 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:

  1. Clear roles — Orchestrators scope and route. Agents do focused work. Cleanup agents verify state.
  2. Resume-ready — Agents check what exists on disk when they start. They pick up where things left off rather than assuming a blank slate.
  3. Workers own their ledger — The agent who does the work updates the status. If you wrote the code, you update the implementation status.
  4. Completion = verified — Work is complete when tests pass and the orchestrator agrees. Partial progress with honest reporting is a valid intermediate state.
  5. Research before asking — Investigate the codebase, derive from patterns, choose safe defaults, then escalate only if truly stuck.
  6. Foundation first — Infrastructure and shared components come before features that depend on them.
  7. 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:

StatusMeaningWhen to Use
VERIFIEDConverged. Evidence panel green, evidence fresh, blockers empty.Work complete, all checks passed
UNVERIFIEDNot converged, but checkpointed. Artifacts written, state captured, resumable.Missing verification, contradictions, blockers
PARTIALProgress made in unbounded loop. More iterations needed.Flow 4 worklists, iterative refinement only
CANNOT_PROCEEDMechanical failure. Tooling broken, permissions missing, infra down.Environment issues preventing any work

Key distinctions:

  • UNVERIFIED vs PARTIAL: Use PARTIAL only for flows with unbounded iteration loops (like Flow 4 review worklist processing). For all other incomplete work (missing artifacts, failed checks, contradictions), use UNVERIFIED.
  • UNVERIFIED is not failure. It's honest state that enables routing. A receipt with UNVERIFIED and documented gaps is more valuable than blocking.
  • PARTIAL is a checkpoint. When Flow 4 exhausts context mid-worklist, PARTIAL means "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 operations

See: docs/reference/demoswarm-cli.md for command reference.


Reference Index

TopicLocation
Rules (constitution).claude/rules/*.md
Explanation docsdocs/explanation/
The Thesisdocs/explanation/the-thesis.md
The Physicsdocs/explanation/the-physics.md
Laws of the Swarmdocs/explanation/laws-of-the-swarm.md
Economicsdocs/explanation/economics.md
Agent Philosophydocs/explanation/agent-philosophy.md
Architecturedocs/explanation/architecture.md
Emergent Phenomenadocs/explanation/emergent-phenomena.md
Authority vs Difficultydocs/explanation/authority-not-difficulty.md
Org Design as Codedocs/explanation/org-design-as-code.md
Reviewing as Auditdocs/explanation/reviewing-as-audit.md
Codebase as Molddocs/explanation/codebase-as-mold.md
Reference docsdocs/reference/
Communication patternsdocs/reference/contracts.md
Schemasdocs/reference/schemas.md
Run state schemasdocs/reference/run-state.md
Stable markersdocs/reference/stable-markers.md
Trust modeldocs/reference/trust-model.md
Calibrationdocs/reference/calibration.md
CLI commandsdocs/reference/demoswarm-cli.md
Glossarydocs/reference/glossary.md
Agents indexdocs/reference/agents-index.md
How-to guidesdocs/how-to/
Example artifactsdocs/examples/
Flow commands.claude/commands/flow-*.md
Agent prompts.claude/agents/*.md

Download now (ZIP)

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.