abide
AGENTS.md578 starsChanged 2 months agoMITView on GitHub
Hard rules for anyone (human or agent) working in this repo. Read fully before writing code. Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed. Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment. Don't assume. Don't hide confusion. Surface tradeoffs. Before implementing: Minimum code that solves the problem. Nothing speculative. Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. Touch only what you must. Clean up…
- Reads credentials
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,337 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.
- CLAUDE.mdCLAUDE.md
- abide-compileSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
20 rules. About 0 are common, 18 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
If multiple interpretations exist, present them - don't pick silently.
- Distinctive: line 27
If a simpler approach exists, say so.
- Distinctive: line 28
If something is unclear, stop.
- Distinctive: line 34
No features beyond what was asked.
- Distinctive: line 35
No abstractions for single-use code.
- Distinctive: line 37
No error handling for impossible scenarios.
- Distinctive: line 38
If you write 200 lines and it could be 50, rewrite it.
- Distinctive: line 40
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
- Distinctive: line 46
When editing existing code:
- Distinctive: line 48
Don't "improve" adjacent code, comments, or formatting.
- Distinctive: line 50
Don't refactor things that aren't broken.
- Distinctive: line 52
If you notice unrelated dead code, mention it - don't delete it.
- Distinctive: line 54
When your changes create orphans:
- Very specific: line 56
Remove imports/variables/functions that YOUR changes made unused.
- Distinctive: line 57
Don't remove pre-existing dead code unless asked.
- Very specific: line 85
Don't narrate what the code does — the reader sees the map, the switch, the names.
- Distinctive: line 87
If code needs a comment to be understood, first make the code clearer (rename, extract).
- Distinctive: line 88
Delete comments that restate the adjacent line.
- Distinctive: line 89
Every comment must earn its place: if you can't name what it tells the reader that the code doesn't, drop it.
- Distinctive: line 118
Prefer the mechanical check.
≈ “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.
Files
Abide — Agent Instructions
Hard rules for anyone (human or agent) working in this repo. Read fully before writing code.
Hard requirements
- The hook must never break the agent. Every hook path exits 0, bounds its own time, and writes nothing to stdout but the JSON the host expects. A hook that hangs, crashes or chatters takes the user's whole coding session with it. This outranks every other goal in this repo: a check that did not run is a missed violation, and a check that wedged the agent is a bug report.
- No secrets in this repo, ever. The API key is read from the environment, from
.env.localor.envat the repo root, or from~/.abide/.env.abide loginwrites it, owner-only, to~/.abide/.envor the repo's.env.local, the only two files abide may ever write a key to, and changes nothing else in them. Never accept it as a flag — a flag lands in shell history and in CI logs — and never log it. - Verify before claiming done: tests green,
pnpm build+ typecheck clean, and the end-to-end path exercised against live Jev with latency measured. A rule checker that has never checked a real diff is not done. - No AI attribution in commits or pull requests. No
Co-Authored-Byline for a model, no "Generated with" footer, no session link, no bot listed as an author. Whoever opened the pull request is the author of every commit in it. Coding agents add these by default:.claude/settings.jsonin this repo turns them off for Claude Code, and if you use another tool, find its switch before your first commit. A squash merge carries a co-author trailer over from the branch, so check the merge box too. - Pass user-facing words through the humanizer before shipping them. Anything a person reads — CLI output, rule instructions, README prose, error messages, the compile skill — goes through the humanizer skill first. Copy that reads as machine-written spends trust the tool then has to earn back.
General
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.
Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.
1. Think Before Coding
Don't assume. Don't hide confusion. Surface tradeoffs.
Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.
2. Simplicity First
Minimum code that solves the problem. Nothing speculative.
- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- If you write 200 lines and it could be 50, rewrite it.
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
3. Surgical Changes
Touch only what you must. Clean up only your own mess.
When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Preserve intentional blank lines between methods and logical blocks. Do not compact whitespace to reduce line count or satisfy a file-size target; restructure the code instead if length is a problem.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.
When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.
The test: Every changed line should trace directly to the user's request.
4. Goal-Driven Execution
Define success criteria. Loop until verified.
Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"
For multi-step tasks, state a brief plan:
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
5. Comment Sparingly
Default to no comment. Code says WHAT; comments say WHY — and only when the WHY isn't obvious.
- Don't narrate what the code does — the reader sees the
map, theswitch, the names. Restating them is noise. - Comment only the non-obvious: a reason, a gotcha, a workaround, a constraint, a "looks wrong but isn't."
- If code needs a comment to be understood, first make the code clearer (rename, extract). Comment only what better code can't express.
- Delete comments that restate the adjacent line. One earned comment beats ten obvious ones.
- Every comment must earn its place: if you can't name what it tells the reader that the code doesn't, drop it.
TypeScript quality — exhaustive, deterministic types
Quality software is built on types the compiler can enforce. These are non-negotiable in this codebase.
Closed sets use an exhaustive
switch+assertNever. For discriminated unions / enums,switchon the discriminant and end withdefault: return assertNever(value)so adding a variant fails to compile until every consumer handles it. Never use if/else-if chains for mutually-exclusive variants. When behavior depends on several related status checks, derive one closed decision/status type and switch over that — don't scatter conditionals through a method. DefineassertNeveronce in the schema package's utils and import it everywhere:export const assertNever = (value: never, message = "Unhandled variant"): never => { throw new Error(`${message}: ${JSON.stringify(value)}`); };- Use
type, notinterface. - Discriminated unions for state — every multi-shape value carries a
type/kinddiscriminant. No optional-field soup where one shape is meant. - No type casting.
asis a bug until proven otherwise — narrow withtypeof/discriminants/schema parsing instead. (as constand zod.parse()outputs are fine.) - Expected failures use typed domain errors with a stable machine-readable
code(SCREAMING_SNAKE_CASE) callers can switch on exhaustively. Concise messages, no terminal punctuation. - Deterministic ID/key formats have a single owner: one named creation function per format (rule ids, source hashes, rubric cache keys). Never inline-format the same ID in two places.
- Schema-first boundaries: anything crossing a process/API boundary is zod-parsed at the edge; internal code trusts parsed types, never re-validates ad hoc. The hook payload, the rubric file and the model's answers are all boundaries.
Repo specifics
- pnpm monorepo:
packages/schema(the contract — everything else consumes it),packages/cli,packages/hooks(the scripts each host registers),skills/abide-compile(what SessionStart hands to the agent). MIT © Coldtea AI. - Zero Coldtea dependency. This runs in anyone's repo on anyone's machine. Nothing here may require Coldtea to be installed, running, or reachable. The animated character is a separate product in a separate repo and is not this package's concern.
- The rubric is the product's trust surface. It is a committed, human-readable, hand-editable file. Every verdict must trace to a named rule a person can read and rewrite. A verdict that cannot be explained by pointing at a rule is a bug.
- No default rules. Rules come only from the user's own instruction files. Shipping a built-in ruleset turns this into a generic linter and loses the premise, which is enforcing their rules.
- Band verdicts, never threshold at 0.5. Act above a high score, flag the middle, ignore below. Measured calibration is good at the ends and genuinely uncertain in the middle, so the middle belongs to the human.
- Latency is flat with rule count; cost is not. Rule instructions are input tokens billed on every edit whether or not a rule fires. Trim instructions for tokens as well as for readability, and use
scopeglobs to keep out-of-scope questions out of the request entirely. - Prefer the mechanical check. A rule a linter can enforce exactly, for free, must never be sent to a model.
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.

