agentleFS
AiatullaAiatulla/agent-kit/global/AGENTS.md

agent-kit / global

AGENTS.md2 starsChanged 46 days agoMITView on GitHub

These rules apply in every project, for every tool. Stack rules and project rules add to them; where a project rule is more specific, the project rule wins. 1. Never modify tests, expected outputs, snapshots, or fixtures to make checks pass. A failing test means the implementation is wrong until proven otherwise. 2. Never weaken a check: no Any or as any, type: ignore, ts-ignore, noqa, eslint-disable, skip or xfail, loosened assertions, or broad exception handling that swallows errors. 3.…

  • 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 31,542 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 repository10 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

38 rules. About 1 is common, 32 are distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈32

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

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

    Never modify tests, expected outputs, snapshots, or fixtures to make checks pass.

    line 8
  2. Very specific:

    Never weaken a check: no Any or as any, type: ignore, ts-ignore, noqa, eslint-disable, skip or xfail, loosened assertions, or broad …

    line 10
  3. Distinctive:

    Never change a function's output, signature, or return type just to satisfy a check.

    line 11
  4. Distinctive:

    Stop rule: if the same check still fails after 3 genuine attempts, stop.

    line 14
  5. Distinctive:

    If you believe a test itself is wrong, do not edit it.

    line 16
  6. Distinctive:

    Stop, explain why, and let the user decide.

    line 17
  7. Very specific:

    When resolving merge or rebase conflicts, preserve the intent of both sides.

    line 18
  8. Very specific:

    Never take one side wholesale without explaining what the other side did and why it is safe to drop.

    line 19
  9. Very specific:

    Run scripts/verify.sh full after resolving.

    line 20
  10. Distinctive:

    If multiple interpretations exist, present them.

    line 26
  11. Distinctive:

    If a simpler approach exists, say so, and push back when warranted.

    line 27
  12. Distinctive:

    If something is unclear, stop, name what is confusing, and ask.

    line 28
  13. Distinctive:

    Before creating a component, model, schema, type, or utility, check the project's inventory and the code for an existing one and reuse it.

    line 29
  14. Distinctive:

    Never choose a worse design to save effort, and never add complexity the requirements do not need.

    line 33
  15. Distinctive:

    When two designs are equally sound, pick the simpler one.

    line 34
  16. Distinctive:

    No features beyond what was asked.

    line 37
  17. Distinctive:

    No abstractions for single-use code, and no flexibility or configuration that was not requested.

    line 38
  18. Distinctive:

    No error handling for impossible scenarios, and never skip error handling for possible ones.

    line 39
  19. Distinctive:

    Never optimize before profiling proves it is needed.

    line 40
  20. Distinctive:

    If the same logic, constant, or validation appears twice, extract it once.

    line 41
  21. Distinctive:

    Every changed line must trace directly to the task.

    line 49
  22. Distinctive:

    Do not improve adjacent code, comments, or formatting, and do not refactor what is not broken.

    line 52
  23. Distinctive:

    Remove imports, variables, and functions that your change made unused.

    line 54
  24. Distinctive:

    Never fix them in the same change.

    line 56
  25. Distinctive:

    Add validation: write tests for invalid inputs, then make them pass.

    line 62
  26. Very specific:

    Run scripts/verify.sh fast after each step and scripts/verify.sh full before you report done, if the project has it.

    line 67
  27. Distinctive:

    When testing a user interface end to end, look closely at what you see.

    line 68
  28. Distinctive:

    Write code for the next developer, not just the machine.

    line 73
  29. Distinctive:

    No commented-out code; git history keeps it.

    line 75
  30. Distinctive:

    No TODO comments without an issue reference.

    line 76
  31. Distinctive:

    No debug print or log statements in committed code.

    line 77
  32. Common:

    Never commit secrets, API keys, or credentials.

    line 78
  33. Distinctive:

    Never use the em dash character.

    line 82
  34. Distinctive:

    Never manually edit CHANGELOG files or files marked as generated.

    line 85
  35. Distinctive:

    Commit working code only; nothing that breaks the build.

    line 93
  36. Distinctive:

    Never add an agent name as co-author in commit messages.

    line 94
  37. Distinctive:

    Never commit or push directly to the main branch.

    line 95
  38. Distinctive:

    Every pull request gets a review from the reviewer agent before merge.

    line 98

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

Global agent rules

These rules apply in every project, for every tool. Stack rules and project rules add to them; where a project rule is more specific, the project rule wins.

Integrity

  1. Never modify tests, expected outputs, snapshots, or fixtures to make checks pass. A failing test means the implementation is wrong until proven otherwise.
  2. Never weaken a check: no Any or as any, type: ignore, ts-ignore, noqa, eslint-disable, skip or xfail, loosened assertions, or broad exception handling that swallows errors.
  3. Never change a function's output, signature, or return type just to satisfy a check. Fix the logic that produces it.
  4. Fix the root cause, not the symptom.
  5. Stop rule: if the same check still fails after 3 genuine attempts, stop. Report the exact error, what you tried and why each attempt failed, your root-cause hypothesis, and what you need.
  6. If you believe a test itself is wrong, do not edit it. Stop, explain why, and let the user decide.
  7. When resolving merge or rebase conflicts, preserve the intent of both sides. Never take one side wholesale without explaining what the other side did and why it is safe to drop. Run scripts/verify.sh full after resolving.

Think before coding

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them; do not pick one silently.
  • If a simpler approach exists, say so, and push back when warranted.
  • If something is unclear, stop, name what is confusing, and ask.
  • Before creating a component, model, schema, type, or utility, check the project's inventory and the code for an existing one and reuse it.

Design: quality and simplicity

Never choose a worse design to save effort, and never add complexity the requirements do not need. When two designs are equally sound, pick the simpler one. Development cost is not a reason to cut quality; speculative need is not a reason to add code.

  • No features beyond what was asked.
  • No abstractions for single-use code, and no flexibility or configuration that was not requested.
  • No error handling for impossible scenarios, and never skip error handling for possible ones.
  • Never optimize before profiling proves it is needed.
  • If the same logic, constant, or validation appears twice, extract it once.
  • One reason to change per module, class, or function; depend on abstractions and inject dependencies.
  • Files should stay under about 200 lines; a longer file usually has more than one responsibility, so split it. Stack lint presets enforce this where the tooling supports it.
  • Self-check: would a senior engineer call this overcomplicated? If yes, simplify.

Surgical changes

Every changed line must trace directly to the task. Why: diffs stay reviewable and every change stays traceable to the spec.

  • Do not improve adjacent code, comments, or formatting, and do not refactor what is not broken.
  • Match the existing style, even if you would do it differently.
  • Remove imports, variables, and functions that your change made unused; leave pre-existing dead code alone.
  • Unrelated problems you notice (lint, flaky tests, visual glitches, dead code) go into a list in your final report. Never fix them in the same change.

Goal-driven execution

Turn every task into a verifiable goal before starting, then loop until it is verified.

  • Add validation: write tests for invalid inputs, then make them pass.
  • Fix a bug: first reproduce it the way an end user experiences it, as end-to-end as practical, then write a test that fails for that reason, then make it pass. Why: reproducing it first proves you found the real problem.
  • Refactor: tests pass before and after.
  • For multi-step tasks, state the plan first, with a verification check for each step.
  • Run scripts/verify.sh fast after each step and scripts/verify.sh full before you report done, if the project has it.
  • When testing a user interface end to end, look closely at what you see. Anything that looks off goes into your report, even if it is unrelated.

Code quality

  • Write code for the next developer, not just the machine.
  • Name things for what they do, not how they do it.
  • No commented-out code; git history keeps it.
  • No TODO comments without an issue reference.
  • No debug print or log statements in committed code.
  • Never commit secrets, API keys, or credentials.

Writing

  • Never use the em dash character; use a plain dash or a colon.
  • In long Markdown files you write or substantially edit, put each full sentence on its own line while keeping normal Markdown structure. Why: line-based diffs stay readable.
  • Never manually edit CHANGELOG files or files marked as generated.

Git

  • Branches: feature/, fix/, chore/, refactor/, docs/ followed by a short description.
  • Commits follow Conventional Commits: <type>(<scope>): <short description>. Types: feat, fix, chore, refactor, docs, test, style, perf; scope is optional.
  • One logical change per commit; do not bundle unrelated changes.
  • Commit working code only; nothing that breaks the build.
  • Never add an agent name as co-author in commit messages.
  • Never commit or push directly to the main branch.
  • Pull the latest main branch before starting a new branch.
  • Pull request title uses the commit message format; the description says what changed, why, and how to test, and links the related issue if there is one.
  • Every pull request gets a review from the reviewer agent before merge.

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.