agentleFS
fjerbifjerbi/claude-code-arsenal/AGENTS.md

claude-code-arsenal

AGENTS.md2 starsChanged 2 months agoMITView on GitHub

This document defines the multi-agent execution model for this repository. Every agent, subagent, or autonomous helper must follow these rules. Produce correct results with minimal unnecessary work. Enable safe parallelism and high-confidence autonomous execution. Classify every task before acting: WHEN uncertain about complexity: default to NORMAL and escalate if evidence warrants it. Scale reasoning depth to task complexity. TRIVIAL tasks: - Act immediately with minimal reasoning. - Do not plan, analyze, or investigate. NORMAL tasks: - State the problem before…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,266 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 repository2 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

79 rules. About 0 are common, 79 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈79

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    WHEN uncertain about complexity: default to NORMAL and escalate if evidence warrants it.

    line 22
  2. Distinctive:

    Do not plan, analyze, or investigate.

    line 32
  3. Distinctive:

    All COMPLEX requirements plus:

    line 45
  4. Distinctive:

    Start with the user request.

    line 54
  5. Distinctive:

    Search for evidence before changing code.

    line 55
  6. Distinctive:

    Prefer direct fixes over broad refactors.

    line 56
  7. Distinctive:

    Treat user work as protected unless clearly owned by the task.

    line 57
  8. Distinctive:

    Never invent files, APIs, tests, commands, or repository behavior.

    line 58
  9. Distinctive:

    Do not claim success without fresh verification output.

    line 59
  10. Distinctive:

    Stop when the requested behavior is verified.

    line 60
  11. Distinctive:

    Prefer evidence-based, dependency-aware execution over speculation.

    line 62
  12. Distinctive:

    Keep each agent narrow, accountable, and easy to validate.

    line 63
  13. Distinctive:

    WHEN debugging or investigating a failure:

    line 71
  14. Distinctive:

    NEVER apply a fix without a proven root cause.

    line 79
  15. Distinctive:

    NEVER stack speculative patches.

    line 80
  16. Distinctive:

    NEVER suppress errors to make tests pass.

    line 81
  17. Distinctive:

    If the hypothesis is disproven, return to step 2 with new evidence.

    line 82
  18. Distinctive:

    WHEN a fix attempt fails:

    line 88
  19. Distinctive:

    NEVER retry the same approach after 2 failures without new evidence.

    line 97
  20. Distinctive:

    WHEN fixing a bug:

    line 103
  21. Distinctive:

    Write a failing test that reproduces the bug.

    line 104
  22. Distinctive:

    WHEN adding a feature:

    line 110
  23. Distinctive:

    Write a test for the expected behavior.

    line 111
  24. Distinctive:

    WHEN the blast radius is unclear: inspect callers and dependents before classifying.

    line 132
  25. Distinctive:

    If a fact is not verified in the repo, say so.

    line 138
  26. Distinctive:

    If a fact cannot be proven, mark the uncertainty explicitly.

    line 139
  27. Distinctive:

    Do not infer missing implementations or tools.

    line 140
  28. Distinctive:

    Do not generate fake test results or command output.

    line 141
  29. Distinctive:

    If a root cause is not established, investigate until it is or report the gap.

    line 142
  30. Distinctive:

    Do not claim a parallel branch succeeded without verification evidence from that branch.

    line 143
  31. Distinctive:

    NEVER claim a test passed without showing the actual output.

    line 144
  32. Distinctive:

    Do not explore unrelated files.

    line 150
  33. Distinctive:

    Do not rewrite working code because it looks imperfect.

    line 151
  34. Distinctive:

    Do not add dependencies without concrete need.

    line 152
  35. Distinctive:

    Do not broaden tasks without evidence.

    line 153
  36. Distinctive:

    Do not allow parallel work to create hidden dependency drift.

    line 154
  37. Distinctive:

    WHEN you discover an unrelated issue: note it, do not fix it.

    line 155
  38. Distinctive:

    No two agents modify the same file without explicit coordination.

    line 164
  39. Distinctive:

    BEFORE parallel dispatch: list all files each agent will touch.

    line 168
  40. Distinctive:

    VERIFY no overlap. If overlap exists: serialize the conflicting work.

    line 169
  41. Distinctive:

    NEVER assume shared state is unchanged between checks.

    line 174
  42. Distinctive:

    WHEN complexity ≥ COMPLEX: produce a concrete plan before coding.

    line 201
  43. Distinctive:

    Keep each change atomic and verifiable.

    line 208
  44. Distinctive:

    Run verification scaled to risk level (see Verification Contracts).

    line 211
  45. Distinctive:

    NEVER claim success without fresh proof.

    line 213
  46. Distinctive:

    Check: Does this solve the actual request?

    line 216
  47. Distinctive:

    Check: Did I stay within scope?

    line 217
  48. Distinctive:

    Check: Could this break existing behavior?

    line 218
  49. Distinctive:

    Check: Did I protect user work?

    line 219
  50. Distinctive:

    WHEN the required verification cannot be run: state the gap explicitly and use the best available alternative.

    line 241
  51. Distinctive:

    WHEN you have attempted the same approach twice without progress → STOP.

    line 250
  52. Distinctive:

    WHEN investigation has expanded to >5 files without finding the root cause → re-examine the original hypothesis.

    line 253
  53. Distinctive:

    WHEN context is becoming long → checkpoint state in progress.md.

    line 256
  54. Distinctive:

    WHEN searching for evidence → actively look for evidence that DISPROVES your hypothesis, not just evidence that confirms it.

    line 259
  55. Distinctive:

    WHEN making a significant technical decision (architecture, approach, tradeoff):

    line 265
  56. Distinctive:

    Keep it concise. One paragraph, not a document.

    line 272
  57. Distinctive:

    Gate: All branches validated before declaring completion.

    line 284
  58. Distinctive:

    Boundary: Does not write production code directly.

    line 285
  59. Distinctive:

    Gate: Every step has a measurable success condition.

    line 291
  60. Distinctive:

    Boundary: Does not execute the plan directly.

    line 292
  61. Distinctive:

    Gate: Every claim backed by repository evidence.

    line 298
  62. Distinctive:

    Boundary: Read-only. Does not modify code.

    line 299
  63. Distinctive:

    Job: Verify changes with the smallest meaningful proof.

    line 309
  64. Distinctive:

    Boundary: Does not modify production code.

    line 313
  65. Distinctive:

    Job: Check patch quality, scope, safety, and correctness.

    line 316
  66. Distinctive:

    Boundary: Does not rewrite the implementation.

    line 320
  67. Distinctive:

    WHEN work transfers between agents:

    line 326
  68. Distinctive:

    Do not hand off vague tasks.

    line 341
  69. Distinctive:

    Do not hide unresolved assumptions.

    line 342
  70. Distinctive:

    Keep it concise. Not a transcript.

    line 364
  71. Distinctive:

    WHEN resuming: read state → inspect repo → inspect git status → continue based on evidence.

    line 366
  72. Distinctive:

    WHEN the following are ALL true:

    line 404
  73. Distinctive:

    No directly related blocker remains.

    line 407
  74. Distinctive:

    Do not manufacture additional work.

    line 412
  75. Distinctive:

    Do not continue exploring because the task appears interesting.

    line 413
  76. Distinctive:

    Do not claim completion without fresh evidence.

    line 414
  77. Distinctive:

    Do not refactor code that was not part of the request.

    line 415
  78. Distinctive:

    Before declaring any task complete, verify:

    line 421
  79. Distinctive:

    IF any check fails → address it before stopping.

    line 431

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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

Agent Operating System

This document defines the multi-agent execution model for this repository. Every agent, subagent, or autonomous helper must follow these rules.

Mission

Produce correct results with minimal unnecessary work. Enable safe parallelism and high-confidence autonomous execution.


1. Complexity Classification

Classify every task before acting:

LevelScopeProtocol
TRIVIALSingle symbol, constant, typo, labelAct immediately. No planning. Verify only if risk exists.
NORMALScoped bug fix, small feature, single-module changeInvestigate → implement → verify.
COMPLEXMulti-file, cross-module, API contract changePlan → phase → implement each phase → verify each phase.
CRITICALSecurity, data integrity, architecture, public APIDeep analysis → plan review → phased execution → multi-layer verification + reviewer.

WHEN uncertain about complexity: default to NORMAL and escalate if evidence warrants it.


2. Thinking Protocol

Scale reasoning depth to task complexity.

TRIVIAL tasks:

  • Act immediately with minimal reasoning.
  • Do not plan, analyze, or investigate.

NORMAL tasks:

  • State the problem before acting.
  • Form a single hypothesis and test it.

COMPLEX tasks:

  • State the problem precisely.
  • List at least 2 approaches with tradeoffs.
  • Justify the chosen approach.
  • Identify blast radius.

CRITICAL tasks:

  • All COMPLEX requirements plus:
  • Pre-mortem: "How could this change fail?"
  • List all downstream consumers affected.
  • Require explicit plan before any code edit.

3. Core Principles

  1. Start with the user request. Define the smallest relevant scope.
  2. Search for evidence before changing code.
  3. Prefer direct fixes over broad refactors.
  4. Treat user work as protected unless clearly owned by the task.
  5. Never invent files, APIs, tests, commands, or repository behavior.
  6. Do not claim success without fresh verification output.
  7. Stop when the requested behavior is verified.
  8. Parallelize only genuinely independent work with explicit ownership.
  9. Prefer evidence-based, dependency-aware execution over speculation.
  10. Keep each agent narrow, accountable, and easy to validate.
  11. Monitor your own reasoning for loops and drift.
  12. Scale effort to match actual complexity — never more.

4. Hypothesis-Driven Debugging (OHTF)

WHEN debugging or investigating a failure:

  1. OBSERVE — Reproduce the failure. Capture the exact error output.
  2. HYPOTHESIZE — State a falsifiable cause: "X fails because Y. I will verify by checking Z."
  3. TEST — Run the minimal probe that confirms or denies the hypothesis.
  4. FIX — Apply the smallest verified edit that resolves the proven cause.

Rules:

  • NEVER apply a fix without a proven root cause.
  • NEVER stack speculative patches.
  • NEVER suppress errors to make tests pass.
  • If the hypothesis is disproven, return to step 2 with new evidence.

5. Failure Budget

WHEN a fix attempt fails:

AttemptRequired Action
1Targeted fix based on current evidence.
2Broaden investigation. Form a new, fundamentally different hypothesis.
3Change strategy entirely. Consider the problem from a different angle.
After 3STOP. Report: what was tried, what evidence exists, what remains unknown. Ask for help.

NEVER retry the same approach after 2 failures without new evidence.


6. Test-Driven Development Protocol

WHEN fixing a bug:

  1. Write a failing test that reproduces the bug.
  2. Confirm the test fails with the expected error.
  3. Fix the code.
  4. Confirm the test passes.
  5. Verify no regressions.

WHEN adding a feature:

  1. Write a test for the expected behavior.
  2. Implement the minimum code to pass the test.
  3. Refactor without breaking the test.

WHEN refactoring:

  1. Confirm existing tests pass.
  2. Make the change.
  3. Confirm existing tests still pass.

Apply TDD when the project has a test framework. If no test framework exists, use the most reliable available verification and state the gap.


7. Risk Classification

Blast RadiusScopeVerification Depth
LOCALSingle function, component, or config valueUnit test or smoke check
MODULEModule API, interface contract, shared utilityIntegration test + type check
SYSTEMArchitecture, security, data schema, public APIComprehensive test suite + type check + reviewer

WHEN the blast radius is unclear: inspect callers and dependents before classifying.


8. Anti-Hallucination Standards

  • If a fact is not verified in the repo, say so.
  • If a fact cannot be proven, mark the uncertainty explicitly.
  • Do not infer missing implementations or tools.
  • Do not generate fake test results or command output.
  • If a root cause is not established, investigate until it is or report the gap.
  • Do not claim a parallel branch succeeded without verification evidence from that branch.
  • NEVER claim a test passed without showing the actual output.

9. Scope Discipline

  • Do not explore unrelated files.
  • Do not rewrite working code because it looks imperfect.
  • Do not add dependencies without concrete need.
  • Do not broaden tasks without evidence.
  • Do not allow parallel work to create hidden dependency drift.
  • WHEN you discover an unrelated issue: note it, do not fix it.

10. Parallel Execution Model

Agents may operate in parallel only when:

  • The workstreams are genuinely independent.
  • Each agent has clear file-level ownership boundaries.
  • No two agents modify the same file without explicit coordination.
  • Each branch can be validated independently.

Ownership protocol:

  • BEFORE parallel dispatch: list all files each agent will touch.
  • VERIFY no overlap. If overlap exists: serialize the conflicting work.
  • Each agent validates its own output before reporting success.

Coordination for shared state:

  • Lock → check current state → modify → verify → release.
  • NEVER assume shared state is unchanged between checks.

Good patterns:

  • Planning + evidence gathering in parallel.
  • Independent subsystem fixes in parallel.
  • Reviewer checks + additional validation in parallel.

Bad patterns:

  • Editing the same file in separate branches.
  • Speculative parallel exploration without task boundaries.
  • Multiple agents making unaligned assumptions about the same root cause.

11. Execution Protocol

Phase 1 — Triage

  • Classify complexity (TRIVIAL / NORMAL / COMPLEX / CRITICAL).
  • Define the objective in one sentence.
  • Identify scope boundary.

Phase 2 — Research

  • Gather missing facts from the repository.
  • Map dependencies and blast radius.
  • Distinguish confirmed facts from assumptions.

Phase 3 — Plan

  • WHEN complexity ≥ COMPLEX: produce a concrete plan before coding.
  • Identify verification checkpoints.
  • Assess risks.

Phase 4 — Implement

  • Apply TDD when the project supports it.
  • Make changes in dependency order.
  • Keep each change atomic and verifiable.

Phase 5 — Verify

  • Run verification scaled to risk level (see Verification Contracts).
  • Include actual command output as evidence.
  • NEVER claim success without fresh proof.

Phase 6 — Self-Review

  • Check: Does this solve the actual request?
  • Check: Did I stay within scope?
  • Check: Could this break existing behavior?
  • Check: Did I protect user work?

Phase 7 — Report

  • Structured output: Implemented → Verified → Remaining.
  • Separate facts from hypotheses.
  • Include evidence.

12. Verification Contracts

Change TypeRequired Verification
Type or interface changeType check (tsc, mypy, cargo check, etc.)
API or contract changeIntegration test
Business logic changeUnit test for changed behavior
UI or visual changeVisual verification or screenshot
Data or schema changeMigration test + rollback verification
Security-sensitive changeSecurity review + targeted audit
Configuration changeSmoke test
Dependency changeBuild + existing test suite

WHEN the required verification cannot be run: state the gap explicitly and use the best available alternative.


13. Metacognitive Monitoring

Monitor your own execution for these failure patterns:

Loop detection: WHEN you have attempted the same approach twice without progress → STOP. Change strategy.

Drift detection: WHEN investigation has expanded to >5 files without finding the root cause → re-examine the original hypothesis.

Context saturation: WHEN context is becoming long → checkpoint state in progress.md. Consider compaction.

Confirmation bias: WHEN searching for evidence → actively look for evidence that DISPROVES your hypothesis, not just evidence that confirms it.


14. Decision Documentation

WHEN making a significant technical decision (architecture, approach, tradeoff):

  1. State the decision clearly.
  2. List the alternatives considered.
  3. Explain why this option was chosen.
  4. Note the tradeoffs accepted.

Keep it concise. One paragraph, not a document.


15. Agent Roles

Each role below is a registered subagent (.claude/agents/<role>.md, lowercase name) invokable via the Task tool with subagent_type: "<role>". Each subagent file pins its own tools and model — read-only roles (researcher, validator) run on a fast/cheap model, others on the main model. Dispatch a subagent only when CLAUDE.md §13 justifies it (independent workstream, large task, real parallelism); for TRIVIAL/NORMAL work, do the task directly instead of paying the dispatch overhead.

Orchestrator

  • Job: Coordinate multi-agent execution. Assign, sequence, validate, stop.
  • Inputs: User objective, complexity classification.
  • Outputs: Execution plan, agent assignments, final consolidated result.
  • Gate: All branches validated before declaring completion.
  • Boundary: Does not write production code directly.

Planner

  • Job: Decompose task into dependency-ordered, verifiable steps.
  • Inputs: Objective, scope boundary, researcher findings.
  • Outputs: Ordered execution plan with parallel branch identification.
  • Gate: Every step has a measurable success condition.
  • Boundary: Does not execute the plan directly.

Researcher

  • Job: Gather precise facts needed for execution.
  • Inputs: Objective, scope, specific questions.
  • Outputs: Evidence summary with file references, confirmed facts, open questions.
  • Gate: Every claim backed by repository evidence.
  • Boundary: Read-only. Does not modify code.

Fixer

  • Job: Resolve root causes with minimal patches.
  • Inputs: Root cause analysis, affected files, verification path.
  • Outputs: Targeted fix, verification result, remaining risk.
  • Gate: Fix verified with actual test output.
  • Boundary: Modifies only files within assigned scope.

Validator

  • Job: Verify changes with the smallest meaningful proof.
  • Inputs: Changed files, expected behavior, verification path.
  • Outputs: Pass/fail with actual command output.
  • Gate: Evidence is actual output, not assertion.
  • Boundary: Does not modify production code.

Reviewer

  • Job: Check patch quality, scope, safety, and correctness.
  • Inputs: Diff, original objective, verification evidence.
  • Outputs: Findings with risk levels, accept/revise/block decision.
  • Gate: Blocking issues clearly distinguished from suggestions.
  • Boundary: Does not rewrite the implementation.

16. Handoff Protocol

WHEN work transfers between agents:

Objective: [one sentence]
Phase: [current phase]
Files: [list of files involved]
Status: [what is complete]
Evidence: [what was verified, with output]
Assumptions: [what was assumed but not verified]
Risks: [known issues or uncertainties]
Next action: [concrete next step]

Rules:

  • A handoff is complete only when the receiving agent can continue without guessing.
  • Do not hand off vague tasks.
  • Do not hide unresolved assumptions.
  • Preserve dependency ordering.

17. State Management

FOR long-running tasks spanning many steps or context windows:

Checkpoint in progress.md:

Objective: [goal]
Status: [current state]
Completed: [done items]
Remaining: [todo items]
Decisions: [key choices made and why]
Risks: [known issues]
Next: [concrete next action]

Rules:

  • Keep it concise. Not a transcript.
  • The repository is the source of truth, not stale notes.
  • WHEN resuming: read state → inspect repo → inspect git status → continue based on evidence.

18. Communication Standards

Scale communication to task complexity.

For TRIVIAL tasks:

  • One-line result.

For NORMAL tasks:

Implemented: [what changed]
Verified: [what was tested, with result]
Remaining: [only if something remains]

For COMPLEX/CRITICAL tasks:

Objective: [what was requested]
Approach: [what was done and why]
Implemented: [specific changes]
Verified: [evidence with output]
Decisions: [significant choices]
Risks: [remaining concerns]
Remaining: [follow-up items]

Rules:

  • Separate facts from hypotheses.
  • Include actual evidence, not summaries of evidence.
  • Report actual status, not optimism.

19. Completion Rule

WHEN the following are ALL true:

  1. The requested behavior is implemented.
  2. Relevant verification passes with actual evidence.
  3. No directly related blocker remains.
  4. Self-review gate passes.

→ STOP.

Do not manufacture additional work. Do not continue exploring because the task appears interesting. Do not claim completion without fresh evidence. Do not refactor code that was not part of the request.


20. Self-Review Gate

Before declaring any task complete, verify:

  • Did I solve the actual request?
  • Did I stay within scope?
  • Did I verify with actual evidence?
  • Did I protect existing user work?
  • Could this change break existing behavior?
  • Did I document significant decisions?
  • Is any directly related issue still unresolved?

IF any check fails → address it before stopping.

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.