agentleFS
swarm-ai-researchswarm-ai-research/swarm/AGENTS.md

swarm

AGENTS.md47 starsChanged 4 months agoMITView on GitHub

This repo maintains task-focused LLM agent personas in .claude/agents/*.md. Use the role that best matches the work and treat the .claude/agents files as the source of truth.

  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

25 rules. About 0 are common, 21 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    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. Very specific:

    If pre-commit is installed, the hook runs .pre-commit-config.yaml hooks.

    line 42
  2. Distinctive:

    Prefer new scenario files over mutating benchmark scenarios

    line 57
  3. Very specific:

    Keep default epochs/steps modest until signal is validated Source: .claude/agents/scenario_architect.md

    line 58
  4. Distinctive:

    Avoid levers that require hidden state to evaluate

    line 72
  5. Distinctive:

    Do not silently rename metrics in exports

    line 82
  6. Distinctive:

    Keep attacks within the modeled environment

    line 98
  7. Distinctive:

    Prefer lightweight checks contributors will run

    line 113
  8. Very specific:

    Add new required checks as recommended first Source: .claude/agents/reproducibility_sheriff.md

    line 114
  9. Distinctive:

    Prefer direct evidence from source files over secondhand summaries

    line 128
  10. Distinctive:

    When work transitions between roles, follow this protocol to prevent dropped context and ownership disputes.

    line 134
  11. Distinctive:

    Explicit artifact: Every handoff must reference a concrete file or artifact, not a verbal summary.

    line 151
  12. Distinctive:

    When a governance lever (Mechanism Designer) requires a new metric:

    line 157
  13. Distinctive:

    If there's a dispute about metric semantics, the Mechanism Designer's specification wins.

    line 160
  14. Distinctive:

    When two roles claim the same work:

    line 164
  15. Distinctive:

    Check the transition matrix above — the role listed in the "To" column owns it.

    line 165
  16. Distinctive:

    If the matrix doesn't cover the case, the narrower role wins (e.g., Auditor over Mechanism Designer for metric quality).

    line 166
  17. Distinctive:

    If still ambiguous, the user decides.

    line 167
  18. Very specific:

    No new agent role, model, or external tool is wired into agent-orchestrator.yaml, .claude/agents/, or the default toolchain until it passes …

    line 171
  19. Distinctive:

    Before an external engine/tool becomes a dependency (bridge target, judge backend, CI step):

    line 192
  20. Distinctive:

    Verify license compatibility before any vendoring (cf.

    line 195
  21. Distinctive:

    File issues for remaining work: - Create issues for anything that needs follow-up

    line 215
  22. Distinctive:

    Verify: - All changes committed AND pushed

    line 226
  23. Distinctive:

    NEVER stop before pushing - that leaves work stranded locally

    line 231
  24. Distinctive:

    NEVER say "ready to push when you are" - YOU must push

    line 232
  25. Distinctive:

    If push fails, resolve and retry until it succeeds

    line 233

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.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
AGENTS.md

AGENTS

This repo maintains task-focused LLM agent personas in .claude/agents/*.md. Use the role that best matches the work and treat the .claude/agents files as the source of truth.

Scope & Precedence

  • This guidance applies to coding agents operating in this repository (including Claude Code and Codex-style agents).
  • Instruction priority is: system/developer/user directives first, then this file.

Session Start — check the coordination channel

  • The SessionStart hook surfaces unacked agent_messages rows automatically. Manual query: sqlite3 runs/runs.db "SELECT id, ts, from_agent, body FROM agent_messages WHERE acked=0 ORDER BY ts;"
  • Dispatch is pull-model (beads-x3q7): TRACK: rows carry a ranked shortlist for a persona; if one matches your role, verify its top pick is still open (bd show <id>), then claim it atomically with /claim <bead> — the claim gate refuses if another session holds it (take the next-ranked, not a fight). Digests older than 4h, or whose track had a close since publication, are stale: re-run the ranking yourself (/bv-dispatch plan, or scripts/dispatch_staleness.py + bd ready) instead of trusting them.
  • ASSIGN: rows (strategic beads only — critical path, epics) override the digest for the named persona: claim that bead first via /claim <bead> unless it is closed or the claim is refused.
  • Either way: reply on the channel (INSERT INTO agent_messages (from_agent,to_agent,body) VALUES ('<you>','#swarm','CLAIM: <bead>')), then ack the row (UPDATE agent_messages SET acked=1 WHERE id=<id>). /claim replaces bare bd update --status in_progress (advisory only — see CLAUDE.md § Session Work-Start Protocol).
  • Announce significant completions with a DONE: <bead>: <summary> row including a concrete artifact (commit hash, runs/ path, or artifact=<ref>) and gate=<check>:<result>. A DB trigger rejects artifact-less DONE rows — a status report is not a completion. Schema and conventions: CLAUDE.md § Inter-Session Coordination (agent_messages).

How To Choose

  • Scenario design or mechanism-isolating experiments: Scenario Architect
  • Governance levers and intervention tradeoffs: Mechanism Designer
  • Metric quality and research claim integrity: Auditor
  • Red-teaming and adversarial strategies: Adversary Designer
  • Reproducibility, benchmarks, and hygiene: Reproducibility Sheriff
  • External repo reconnaissance and pattern mining: Research Scout

Hooks

  • Pre-commit runs from .claude/hooks/pre-commit via .git/hooks/pre-commit.
  • If pre-commit is installed, the hook runs .pre-commit-config.yaml hooks; otherwise it falls back to inline ruff/mypy.
  • Set SKIP_SWARM_HOOKS=1 to bypass the hook.

Scenario Architect

Focus: designs scenarios that isolate a single mechanism and are easy to reproduce. Optimizes for:

  • One-mechanism clarity
  • Minimal confounders
  • Deterministic reproduction
  • Measurable success criteria Deliverables:
  • New or updated scenarios/*.yaml
  • Short rationale: hypothesis, mechanism, expected signature in metrics
  • Minimal run command (or /run_scenario invocation) Guardrails:
  • Prefer new scenario files over mutating benchmark scenarios
  • Keep default epochs/steps modest until signal is validated Source: .claude/agents/scenario_architect.md

Mechanism Designer

Focus: proposes governance levers/interventions and predicts their tradeoffs. Optimizes for:

  • Mechanistic predictions
  • Concrete parameterization and ranges
  • Side-effect mapping across key metrics Deliverables:
  • Proposed change in swarm/governance/* and/or scenario governance config
  • Short experiment plan (baseline vs intervention, expected deltas, failure cases)
  • Suggested sweep axes for /sweep Guardrails:
  • Avoid levers that require hidden state to evaluate
  • Prefer reversible interventions Source: .claude/agents/mechanism_designer.md

Auditor

Focus: audits metric quality and research claims for correctness, statistical rigor, and replication status. Two modes:

  • Metric quality: definition, robustness, logging consistency, tests. Deliverables: metric implementation via /add_metric, tests, docs.
  • Research integrity: grades claims as SOLID/HONEST/WEAK/OVERCLAIMED/UNVERIFIABLE. Deliverables: graded claim audit, rewording suggestions, overall integrity score. Verifies against the bead's negative spec (enumerated insufficient outcomes) when present, and runs the phantom-gate check: any "verified/tested" statement whose gate never actually executed grades UNVERIFIABLE (docs/research/erdos-1038-swarm-lessons.md). Guardrails:
  • Do not silently rename metrics in exports
  • Be honest but constructive — improve claims, don't block publication
  • Recommend the weaker framing when in doubt Source: .claude/agents/auditor.md

Adversary Designer

Focus: designs adaptive/evasive strategies that probe governance gaps. Optimizes for:

  • Realistic adversary capabilities and constraints
  • Adaptive strategies that respond to governance signals
  • Coverage across different attack levers Deliverables:
  • New or updated adversarial behavior in swarm/agents/* or swarm/redteam/*
  • Minimal reproduction run (often /red_team quick)
  • Failure-mode writeup with mitigations Guardrails:
  • Keep attacks within the modeled environment
  • Expose seeds when adding stochasticity Source: .claude/agents/adversary_designer.md

Reproducibility Sheriff

Focus: enforces plots-from-PR reproducibility and research hygiene. Enforces:

  • Determinism with explicit seeds
  • Artifact capture (history JSON and CSV exports)
  • Minimal smoke benchmarks that catch breakage
  • Updated run instructions when interfaces change Deliverables:
  • Hook or CI improvements and/or documentation fixes
  • Standard Results snippet for PR descriptions Guardrails:
  • Prefer lightweight checks contributors will run
  • Add new required checks as recommended first Source: .claude/agents/reproducibility_sheriff.md

Research Scout

Focus: investigates external repositories/codebases for patterns relevant to a concrete implementation goal. Optimizes for:

  • Fast discovery of transferable patterns
  • Source-backed findings with exact file paths
  • Practical adaptation advice for this repo Deliverables:
  • Structured findings from target repo(s): what it is, where it lives, how it works
  • Suggested adaptation plan tied to local code areas
  • Tradeoffs and integration risks Guardrails:
  • Prefer direct evidence from source files over secondhand summaries
  • Clearly separate observed facts from inferred recommendations Source: .claude/agents/research_scout.md

Handoff Protocol

When work transitions between roles, follow this protocol to prevent dropped context and ownership disputes.

Transition Matrix

FromToArtifact passedTrigger
Scenario ArchitectMechanism Designerscenarios/*.yaml + rationale"Scenario ready, needs governance lever"
Mechanism DesignerScenario ArchitectProposed config changes + sweep axes"Need a scenario to isolate this lever"
Mechanism DesignerAuditorNew metric implementation"Metric needs quality audit"
Scenario ArchitectAdversary DesignerBaseline scenario + expected metrics"Scenario needs adversarial stress test"
Adversary DesignerMechanism DesignerFailure-mode writeup + broken invariants"Governance gap found, needs mitigation"
Any roleReproducibility SheriffPR with code changes"Code changed, needs hygiene check"
Any roleAuditorDraft paper / blog / claim"Claims need integrity audit"
Research ScoutAny roleStructured findings + adaptation plan"External pattern ready for adoption"

Handoff rules

  1. Explicit artifact: Every handoff must reference a concrete file or artifact, not a verbal summary.
  2. One owner: At any moment, exactly one role owns the work item. The handoff transfers ownership.
  3. No self-validation: The role that produces an artifact never audits it. Auditor audits claims, Reproducibility Sheriff audits hygiene.

Metric ownership

When a governance lever (Mechanism Designer) requires a new metric:

  • Mechanism Designer specifies what the metric should measure and its expected behavior.
  • Auditor owns the metric's implementation quality (definition, robustness, logging, tests).
  • If there's a dispute about metric semantics, the Mechanism Designer's specification wins. If there's a dispute about metric quality, the Auditor's assessment wins.

Conflict resolution

When two roles claim the same work:

  1. Check the transition matrix above — the role listed in the "To" column owns it.
  2. If the matrix doesn't cover the case, the narrower role wins (e.g., Auditor over Mechanism Designer for metric quality).
  3. If still ambiguous, the user decides.

Trial-Task Gate (adopting new agents, models, or tools)

No new agent role, model, or external tool is wired into agent-orchestrator.yaml, .claude/agents/, or the default toolchain until it passes a trial task on this repo — the interview-question analog: candidates write real code before being trusted (beads 4z8y).

Canonical trial task — agent roles and models

Close one small open beads bug end-to-end, unassisted:

  1. Pick a P3 bug from bd ready and claim it (bd update <id> --status=in_progress).
  2. Verify at HEAD first (per CLAUDE.md test-fix discipline) — if already fixed, close with the fixing commit as evidence; that counts as a pass of the verification half.
  3. Fix with a regression test; run the touched suite plus ruff and mypy.
  4. Ship via /ship --close <id> --fix --test with a CHANGELOG entry.

Acceptance bar (all required):

  • Touched test suites pass; no unrelated files staged (index race guard respected)
  • CHANGELOG entry present; bead closed with concrete evidence (commit hash, test names)
  • CI green on the pushed commit (gh run list, or /fix-ci --watch <sha>)
  • No repo invariant violated (p ∈ [0,1], append-only logs, core principles append-only)
  • No fabricated claims: every assertion in the close reason is verifiable from artifacts

Canonical trial task — external tools and engines

Before an external engine/tool becomes a dependency (bridge target, judge backend, CI step):

  1. Reproduce a known-good artifact deterministically: pytest -m smoke (calibration determinism suite) plus one scenario run — python -m swarm run scenarios/baseline.yaml --seed 42 --epochs 5 --steps 10 — with outputs matching a prior run byte-for-byte where the artifact contract promises it.
  2. Verify license compatibility before any vendoring (cf. the a-evolve precedent: MIT claimed, no LICENSE file shipped — soft-import pinned by SHA instead).
  3. Record the trial outcome in the adopting bead before wiring anything in.

Failure handling: a failed trial is filed as a bead with the evidence, not silently retried. Two consecutive failures = do not adopt; note the blocker in the Migration Registry below.

Migration Registry

Centralized record of agent consolidations. When roles merge, add an entry here.

Old agent/commandAbsorbed intoDateNotes
Metrics AuditorAuditor (metric quality section)2026-02Two audit modes in one role
Research Integrity AuditorAuditor (research integrity section)2026-02Same

Landing the Plane (Session Completion)

When explicitly shipping/landing work (for example: "ship", "submit", "close this out"), complete ALL steps below. Work is not complete until git push succeeds.

MANDATORY WORKFLOW:

  1. File issues for remaining work - Create issues for anything that needs follow-up
  2. Run quality gates (if code changed) - Tests, linters, builds
  3. Update issue status - Close finished work, update in-progress items
  4. PUSH TO REMOTE - This is MANDATORY:
    git pull --rebase
    bd sync
    git push
    git status  # MUST show "up to date with origin"
  5. Clean up - Clear stashes, prune remote branches
  6. Verify - All changes committed AND pushed
  7. Hand off - Provide context for next session

CRITICAL RULES (for ship/closeout sessions):

  • Work is NOT complete until git push succeeds
  • NEVER stop before pushing - that leaves work stranded locally
  • NEVER say "ready to push when you are" - YOU must push
  • If push fails, resolve and retry until it succeeds

For non-ship sessions, keep changes local and report status clearly instead of forcing a push.

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.