agentleFS
aloiloraloilor/lean-coding-agent/AGENTS.md

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.

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

    Write all agent output in English unless the user explicitly asks for another language.

    line 5
  2. Distinctive:

    If a clearly better approach exists, explain in 2–4 bullets what each option optimizes for, its costs, and whether the requested approach …

    line 20
  3. Distinctive:

    Keep connected code coherent without drive-by cleanup or formatting churn.

    line 24
  4. Distinctive:

    Remove imports, variables, and functions made unused by your changes.

    line 26
  5. Distinctive:

    Add a lesson only for a reusable agent-behavior mistake with no better canonical owner.

    line 37
  6. Very specific:

    Read .agents/lessons/LESSONS.md when present, and follow AGENTS.override.md when it exists (local, private, git-ignored).

    line 45
  7. Very specific:

    Before using a skill, check .agents/skill-overrides/INDEX.md.

    line 46
  8. Very specific:

    Run a workflow-* skill only when the user explicitly invokes that skill.

    line 52
  9. Distinctive:

    Use these fixed paths rather than inventing alternatives.

    line 58
  10. Distinctive:

    Stop and report the failing check, actual error, attempts, and best hypothesis when:

    line 69
  11. Distinctive:

    Never silently expand scope or force a green result.

    line 76

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

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

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 Do note. State No meaningful omissions when 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, read CODING-STANDARDS.md for coding work, TESTING.md for testing, CHANGE-PROCESS.md for commits, PRs, and releases, and DEPLOYMENT.md for 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.md when present, and follow AGENTS.override.md when it exists (local, private, git-ignored).
  • Before using a skill, check .agents/skill-overrides/INDEX.md. Apply a listed <skill-name>.md override 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.

ArtifactPathOwner
Approved plan.agents/plans/plan_YYYYMMDD_<name>.mdplanner drafts; main agent obtains user approval
Implementation report.agents/implementation-reports/implementation_YYYYMMDD_<name>.mdimplementer
Code review pass.agents/code-reviews/review_YYYYMMDD_<name>_pass_N.mdcode-reviewer
Incident report, only when the user requests one (with Investigation section)docs/incidents/incident_YYYYMMDD_<name>.mddiagnostician 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.

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.