Agent-Knowledge-Starter-Kit
AGENTS.md7 starsChanged 2 months agoMITView on GitHub
These rules override everything else in this file when in conflict: Goal: understand the problem and the codebase before producing a diff. Goal: the minimum code that solves the stated problem. Nothing speculative. The test: would a senior engineer reading the diff call this overcomplicated? If yes, simplify. Goal: clean, reviewable diffs. Change only what the request requires. The test: every changed line traces directly to the user's request. If a line fails that test, revert it. Goal: define success…
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,439 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 repository8 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- aksk-bootstrapSkill
- aksk-initSkill
- docs-lintSkill
- learning-distillSkill
- task-closeoutSkill
- verify-installSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
35 rules. About 0 are common, 31 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈31
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
- Distinctive: line 8
Disagree when you disagree: If the user's premise is wrong, say so before doing the work.
- Distinctive: line 9
Never fabricate: Not file paths, not commit hashes, not API names, not test results, not library functions.
- Distinctive: line 10
Stop when confused: If the task has two plausible interpretations, ask.
- Distinctive: line 11
Touch only what you must: Every changed line must trace directly to the user's request.
- Distinctive: line 20
Read the files you will touch.
- Distinctive: line 23
If two approaches exist, present both with tradeoffs.
- Distinctive: line 31
No features beyond what was asked.
- Distinctive: line 32
No abstractions for single-use code.
- Distinctive: line 33
No error handling for impossible scenarios.
- Distinctive: line 34
If the solution runs 200 lines and could be 50, rewrite it before showing it.
- Distinctive: line 35
If you find yourself adding "for future extensibility", stop.
- Distinctive: line 46
Do not "improve" adjacent code, comments, formatting, or imports that are not part of the task.
- Distinctive: line 47
Do not refactor code that works just because you are in the file.
- Distinctive: line 48
Do not delete pre-existing dead code unless asked.
- Distinctive: line 49
Do clean up orphans created by your own changes (unused imports, variables, functions your edit made obsolete).
- Distinctive: line 70
Write the verification (test, script, benchmark, screenshot diff) where practical.
- Distinctive: line 71
Run the verification. Read the output.
- Distinctive: line 72
If the verification fails, fix the cause, not the test.
- Distinctive: line 78
Prefer running the code to guessing about the code.
- Distinctive: line 79
Never report "done" based on a plausible-looking diff alone.
- Distinctive: line 80
When debugging, address root causes, not symptoms.
- Distinctive: line 82
Use CLI tools (gh, aws, gcloud, kubectl) when they exist.
- Distinctive: line 83
When reading logs, errors, or stack traces, read the whole thing.
- Distinctive: line 90
After two failed corrections on the same issue, stop.
- Distinctive: line 91
Use subagents (Claude Code: "use subagents to investigate X") for exploration tasks that would otherwise pollute the main context with …
- Distinctive: line 92
When committing, write descriptive commit messages (subject under 72 chars, body explains the why).
- Distinctive: line 100
When a question has a clear answer, give it.
- Distinctive: line 102
No excessive bullet points, no unprompted headers, no emoji.
- Distinctive: line 127
Treat source code and tests as authoritative.
- Distinctive: line 128
Prefer the narrowest quiet validation that proves the changed behavior.
- Very specific: line 139
Read .agents/AGENTS.md for durable repo guidance.
- Very specific: line 140
Use openwiki/index.md for repo knowledge (decisions, troubleshooting, architecture) and .agents/playbooks/ for procedures.
- Distinctive: line 141
Before architectural changes, consult the recorded repo decisions in the knowledge layer.
- Very specific: line 142
When debugging, search durable knowledge first: grep -ri "<symptom>" .agents/ openwiki/.
- Very specific: line 144
Keep temporary task evidence in .agents/sessions/.
≈ “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.
Files
AGENTS.md
0. Non-negotiables
These rules override everything else in this file when in conflict:
- No flattery, no filler. Skip openers like "Great question", "You're absolutely right", "Excellent idea", "I'd be happy to". Start with the answer or the action.
- Disagree when you disagree. If the user's premise is wrong, say so before doing the work. Agreeing with false premises to be polite is the single worst failure mode in coding agents.
- Never fabricate. Not file paths, not commit hashes, not API names, not test results, not library functions. If you don't know, read the file, run the command, or say "I don't know, let me check."
- Stop when confused. If the task has two plausible interpretations, ask. Do not pick silently and proceed.
- Touch only what you must. Every changed line must trace directly to the user's request. No drive-by refactors, reformatting, or "while I was in there" cleanups.
1. Before writing code
Goal: understand the problem and the codebase before producing a diff.
- State your plan in one or two sentences before editing. For anything non-trivial, produce a numbered list of steps with a verification check for each.
- Read the files you will touch. Read the files that call the files you will touch. Claude Code: use subagents for exploration so the main context stays clean.
- Match existing patterns in the codebase. If the project uses pattern X, use pattern X, even if you'd do it differently in a greenfield repo.
- Surface assumptions out loud: "I'm assuming you want X, Y, Z. If that's wrong, say so." Do not bury assumptions inside the implementation.
- If two approaches exist, present both with tradeoffs. Do not pick one silently. Exception: trivial tasks (typo, rename, log line) where the diff fits in one sentence.
2. Writing code: simplicity first
Goal: the minimum code that solves the stated problem. Nothing speculative.
- No features beyond what was asked.
- No abstractions for single-use code. No configurability, flexibility, or hooks that were not requested.
- No error handling for impossible scenarios. Handle the failures that can actually happen.
- If the solution runs 200 lines and could be 50, rewrite it before showing it.
- If you find yourself adding "for future extensibility", stop. Future extensibility is a future decision.
- Bias toward deleting code over adding code. Shipping less is almost always better.
The test: would a senior engineer reading the diff call this overcomplicated? If yes, simplify.
3. Surgical changes
Goal: clean, reviewable diffs. Change only what the request requires.
- Do not "improve" adjacent code, comments, formatting, or imports that are not part of the task.
- Do not refactor code that works just because you are in the file.
- Do not delete pre-existing dead code unless asked. If you notice it, mention it in the summary.
- Do clean up orphans created by your own changes (unused imports, variables, functions your edit made obsolete).
- Match the project's existing style exactly: indentation, quotes, naming, file layout.
The test: every changed line traces directly to the user's request. If a line fails that test, revert it.
4. Goal-driven execution
Goal: define success as something you can verify, then loop until verified.
Rewrite vague asks into verifiable goals before starting:
- "Add validation" becomes "Write tests for invalid inputs (empty, malformed, oversized), then make them pass."
- "Fix the bug" becomes "Write a failing test that reproduces the reported symptom, then make it pass."
- "Refactor X" becomes "Ensure the existing test suite passes before and after, and no public API changes."
- "Make it faster" becomes "Benchmark the current hot path, identify the bottleneck with profiling, change it, show the benchmark is faster."
For every task:
- State the success criteria before writing code.
- Write the verification (test, script, benchmark, screenshot diff) where practical.
- Run the verification. Read the output. Do not claim success without checking.
- If the verification fails, fix the cause, not the test.
5. Tool use and verification
- Prefer running the code to guessing about the code. If a test suite exists, run it. If a linter exists, run it. If a type checker exists, run it.
- Never report "done" based on a plausible-looking diff alone. Plausibility is not correctness.
- When debugging, address root causes, not symptoms. Suppressing the error is not fixing the error.
- For UI changes, verify visually: screenshot before, screenshot after, describe the diff.
- Use CLI tools (gh, aws, gcloud, kubectl) when they exist. They are more context-efficient than reading docs or hitting APIs unauthenticated.
- When reading logs, errors, or stack traces, read the whole thing. Half-read traces produce wrong fixes.
6. Session hygiene
- Context is the constraint. Long sessions with accumulated failed attempts perform worse than fresh sessions with a better prompt.
- After two failed corrections on the same issue, stop. Summarize what you learned and ask the user to reset the session with a sharper prompt.
- Use subagents (Claude Code: "use subagents to investigate X") for exploration tasks that would otherwise pollute the main context with dozens of file reads.
- When committing, write descriptive commit messages (subject under 72 chars, body explains the why). No "update file" or "fix bug" commits. No "Co-Authored-By: Claude" attribution unless the project explicitly wants it.
7. Communication style
- Direct, not diplomatic. "This won't scale because X" beats "That's an interesting approach, but have you considered...".
- Concise by default. Two or three short paragraphs unless the user asks for depth. No padding, no restating the question, no ceremonial closings.
- When a question has a clear answer, give it. When it does not, say so and give your best read on the tradeoffs.
- Celebrate only what matters: shipping, solving genuinely hard problems, metrics that moved. Not feature ideas, not scope creep, not "wouldn't it be cool if".
- No excessive bullet points, no unprompted headers, no emoji. Prose is usually clearer than structure for short answers.
8. When to ask, when to proceed
Ask before proceeding when:
- The request has two plausible interpretations and the choice materially affects the output.
- The change touches something you've been told is load-bearing, versioned, or has a migration path.
- You need a credential, a secret, or a production resource you don't have access to.
- The user's stated goal and the literal request appear to conflict.
Proceed without asking when:
- The task is trivial and reversible (typo, rename a local variable, add a log line).
- The ambiguity can be resolved by reading the code or running a command.
- The user has already answered the question once in this session.
<!-- OPENWIKI:START -->OpenWiki
This repository has a generated openwiki/ evidence index. It is optional just-in-time context, not required startup reading.
- Treat source code and tests as authoritative. A brief's unknowns and review items are verification gaps, not automatic requirements.
- Prefer the narrowest quiet validation that proves the changed behavior. Preserve complete failure output.
The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.
<!-- OPENWIKI:END --><!-- AKSK:ROUTING:BEGIN -->Agent Knowledge Starter Kit
This repo uses the Agent Knowledge Starter Kit (AKSK).
- Read
.agents/AGENTS.mdfor durable repo guidance. - Use
openwiki/index.mdfor repo knowledge (decisions, troubleshooting, architecture) and.agents/playbooks/for procedures. - Before architectural changes, consult the recorded repo decisions in the knowledge layer.
- When debugging, search durable knowledge first:
grep -ri "<symptom>" .agents/ openwiki/. - For task closeout, follow
.agents/skills/task-closeout/SKILL.md. - Keep temporary task evidence in
.agents/sessions/; promote only durable lessons back into.agents/.
<!-- AKSK:ROUTING:END --><!-- AKSK:LIFECYCLE:BEGIN -->Self-improvement loop (summary)
This repo uses the AKSK loop: closeout → distill → prune. See .agents/AGENTS.md for the full loop, openwiki/decisions/ and openwiki/troubleshooting/ for curated outcomes, and .agents/playbooks/ for procedures.
<!-- AKSK:LIFECYCLE:END -->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.

