lean-coding-agent
AGENTS.md7 starsChanged 47 days agoMITView on GitHub
Before non-trivial implementation: During implementation: Diagnose bugs before changing code. Present the symptom, evidence or likely root cause, proposed repair, and verification plan, then obtain explicit user approval before every repair. workflow-bug-fixing owns detailed routing and artifacts.
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 33,398 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 repository19 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- find-skillsSkill
- git-conventional-commitSkill
- skill-creatorSkill
- code-reviewSkill
- define-conventionsSkill
- diagnoseSkill
- feature-specificationSkill
- git-conventional-commitSkill
- implementSkill
- lean-grill-with-docsSkill
- maintain-changelogSkill
- planSkill
- setup-lean-coding-agentSkill
- workflow-bug-fixingSkill
- workflow-feature-developmentSkill
- workflow-planningSkill
- workflow-refactorSkill
- workflow-reviewSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Write all agent output in English unless the user explicitly asks for another language.
- Distinctive: line 20
If a clearly better approach exists, explain in 2–4 bullets what each option optimizes for, its costs, and whether the requested approach …
- Distinctive: line 24
Keep connected code coherent without drive-by cleanup or formatting churn.
- Distinctive: line 26
Remove imports, variables, and functions made unused by your changes.
- Distinctive: line 37
Add a lesson only for a reusable agent-behavior mistake with no better canonical owner.
- Very specific: line 45
Read .agents/lessons/LESSONS.md when present, and follow AGENTS.override.md when it exists (local, private, git-ignored).
- Very specific: line 46
Before using a skill, check .agents/skill-overrides/INDEX.md.
- Very specific: line 52
Run a workflow-* skill only when the user explicitly invokes that skill.
- Distinctive: line 58
Use these fixed paths rather than inventing alternatives.
- Distinctive: line 69
Stop and report the failing check, actual error, attempts, and best hypothesis when:
- Distinctive: line 76
Never silently expand scope or force a green result.
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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.
Files
AGENTS.md
Output Language
- Write all agent output in English unless the user explicitly asks for another language.
Operating Principles
- Simplest Responsible Solution — choose the least complex approach that solves the request without creating an obvious future trap.
- Root Causes — diagnose before fixing; avoid temporary patches when the underlying problem is knowable.
- Scoped Impact — every changed line must trace to the request or a necessary supporting refactor. Mention unrelated debt instead of fixing it.
- Settled Practice — prefer standards, proven patterns, and established libraries when they fit; explain material deviations without cargo-cult citations.
- Verification — define success in checkable terms and loop until the relevant checks pass or a stop condition applies.
- Explicit Omissions — close every task with a brief
Did Not Donote. StateNo meaningful omissionswhen none exist.
Before non-trivial implementation:
- Surface material assumptions, ambiguities, and tradeoffs. Ask when an answer would materially change the result or risk.
- State the approach, its verification, and why it is the simplest responsible option. Do not add speculative flexibility, impossible-case handling, or abstractions without real value.
- If a clearly better approach exists, explain in 2–4 bullets what each option optimizes for, its costs, and whether the requested approach remains reasonable. Stop only when proceeding risks serious harm, wasted work, or an architectural dead end.
During implementation:
- Keep connected code coherent without drive-by cleanup or formatting churn.
- Allow supporting refactors only when they directly reduce duplication or fragility introduced by the requested change.
- Remove imports, variables, and functions made unused by your changes; only mention pre-existing dead code.
- For non-trivial work, challenge a hacky result and replace it with the cleanest solution that stays in scope. Do not over-engineer simple work.
- Turn goals into checks, for example:
Add validation→Test invalid inputs, then make the tests pass.
Bug Fixing
Diagnose bugs before changing code. Present the symptom, evidence or likely root cause, proposed repair, and verification plan, then obtain explicit user approval before every repair. workflow-bug-fixing owns detailed routing and artifacts.
Self-Improvement
- When the user corrects your behavior, suggest updating its authoritative prompt, workflow, guideline, or project context, or creating a lesson when appropriate. Ask for approval before saving the correction (for example, "Do you want to create this lesson?"). If the user already explicitly requested the update, proceed and state which you updated.
- Add a lesson only for a reusable agent-behavior mistake with no better canonical owner; never record one-off details or duplicate existing policy.
- Store one short rule per
.agents/lessons/<descriptive-name>.md, and add a clickable one-line entry to.agents/lessons/LESSONS.md. - Review the lessons index and relevant linked lessons at the start of each session.
Context And Skills
- This file is the shared baseline. Put project-specific shared rules in
docs/conventions/. - For codebase work, read only the
docs/conventions/files relevant to the task. For example, readCODING-STANDARDS.mdfor coding work,TESTING.mdfor testing,CHANGE-PROCESS.mdfor commits, PRs, and releases, andDEPLOYMENT.mdfor deploys and migrations. Include other convention files when the task scope calls for them; do not load unrelated convention files or load conventions for unrelated conversation or general tasks. - Read
.agents/lessons/LESSONS.mdwhen present, and followAGENTS.override.mdwhen it exists (local, private, git-ignored). - Before using a skill, check
.agents/skill-overrides/INDEX.md. Apply a listed<skill-name>.mdoverride before the skill and keep the index synchronized when adding overrides.
Workflows
Workflow Delegation
Run a workflow-* skill only when the user explicitly invokes that skill.
In workflows, spawn subagents as directed by the selected workflow-* skill. If a required agent is unavailable, stop and report it. Use the shared artifact paths and stop conditions below.
Standard Artifacts
Use these fixed paths rather than inventing alternatives. Every planning workflow produces one user-approved plan. Implementers and reviewers update their durable handoffs on every workflow pass.
| Artifact | Path | Owner |
| Approved plan | .agents/plans/plan_YYYYMMDD_<name>.md | planner drafts; main agent obtains user approval |
| Implementation report | .agents/implementation-reports/implementation_YYYYMMDD_<name>.md | implementer |
| Code review pass | .agents/code-reviews/review_YYYYMMDD_<name>_pass_N.md | code-reviewer |
| Incident report, only when the user requests one (with Investigation section) | docs/incidents/incident_YYYYMMDD_<name>.md | diagnostician drafts; code-reviewer finalizes |
Shared Stop Conditions
Stop and report the failing check, actual error, attempts, and best hypothesis when:
- The same finding or failure remains after 3 informed fix attempts, or about 5 genuinely different attempts for an undiagnosed test failure.
- A fix requires changing the approved plan or expanding scope.
- Verification fails for an unknown reason.
- Success would require weakening a test, a broad rewrite, or a new dependency.
Never silently expand scope or force a green result.
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
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.

