ai-engineering
AGENTS.md65 starsChanged 2 months agoApache-2.0View on GitHub
Guidance for AI coding agents working in this repository. Human teammates should be able to follow every line too. Only rules an agent CANNOT deduce from the code live here; if a rule becomes obvious from reading the code, delete it from this file.
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,843 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 repository41 other files it gives its agents.
- a11y-auditSkill
- ai-adversarial-loopSkill
- ai-agents-mdSkill
- ai-architectSkill
- ai-audit-codeSkill
- ai-audit-designSkill
- ai-audit-docsSkill
- ai-brainstormSkill
- ai-codegraphSkill
- ai-config-to-projectSkill
- ai-debugSkill
- ai-design-md-plannerSkill
- ai-exploreSkill
- ai-git-cleanupSkill
- ai-issue-reportSkill
- ai-noteSkill
- ai-orchestratorSkill
- ai-prototypeSkill
- ai-prSkill
- ai-read-docsSkill
- ai-researchSkill
- ai-review-uiSkill
- ai-securitySkill
- ai-stress-testSkill
- ai-test-plannerSkill
- ai-triageSkill
- ai-verifySkill
- ai-visual-recapSkill
- ai-writeSkill
- ai-writing-behaviorSkill
- build-checkSkill
- code-auditSkill
- design-checkSkill
- feature-verifySkill
- full-reviewSkill
- perf-auditSkill
- review-routerSkill
- second-opinionSkill
- security-auditSkill
- spec-extractSkill
- verify-featureSkill
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 1 is common, 5 are distinctive, and 6 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
6
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
- Very specific: line 6
Never bypass a git hook or a check: no --no-verify, no -n on commit, no HUSKY=0.
- Very specific: line 7
Never silence a linter: no noqa, @ts-ignore, eslint-disable, nosec.
- Common: line 8
No secrets, no personal data, no machine-specific absolute paths in any file.
- Very specific: line 16
Use positive conditions (if (isValid) over if (!isInvalid)).
- Distinctive: line 21
Write less code: rethink requirements, use stdlib, prune unused code.
- Very specific: line 32
Every skill declares its own contract — lane, artifact, successor — in a ## Lifecycle block inside its SKILL.md: follow the Next: a skill …
- Very specific: line 51
Prefer host worktree support.
- Very specific: line 53
After review, offer a PR, local merge, or keeping the branch.
- Distinctive: line 59
Run lint and the full test suite before committing.
- Distinctive: line 60
Add or update tests for the code you change, even if nobody asked.
- Distinctive: line 61
After moving files or changing imports, re-run lint and typecheck.
- Distinctive: line 63
Commit messages: subject ≤ 50 chars.
≈ “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 — governed by {ai} Engineering (ai-eng --version)
Guidance for AI coding agents working in this repository. Human teammates should be able to follow every line too. Only rules an agent CANNOT deduce from the code live here; if a rule becomes obvious from reading the code, delete it from this file.
Security
- Never bypass a git hook or a check: no
--no-verify, no-non commit, noHUSKY=0. - Never silence a linter: no
noqa,@ts-ignore,eslint-disable,nosec. - No secrets, no personal data, no machine-specific absolute paths in any file.
Code style
- KISS, YAGNI, DRY, SOLID, TDD, Clean Code.
- Explain it so someone who doesn't code can follow along.
- Readable code (Boswell & Foucher): minimize the time it takes someone else to understand your code.
- Names say purpose or value; no generic names (
data,temp,helperare forbidden). - Prefix booleans (
is,has,can,should); prefix limits (max,min). - Use positive conditions (
if (isValid)overif (!isInvalid)). - Early returns over deep nesting; flat control flow wins.
- Comments explain why, not what; never repeat the function signature in prose.
- Explain "huh?" moments; skip the obvious.
- One function, one job. Extract unrelated subproblems.
- Write less code: rethink requirements, use stdlib, prune unused code.
- Names say purpose or value; no generic names (
Build and test commands
typecheck: bun run typecheck (oxlint --type-aware --type-check) · lint: bun run lint (oxlint) · test: bun test · arch: bun test tests/arch.spec.ts
Workflow
- Green gate before "done": show the output of the check that proves it.
- A decision that always comes out the same is code, not a prompt.
- Task status convention (when a todo list exists): mark each task 🟢 done (paste the proving output) · 🟡 pending (name the next action) · 🔴 blocked on you (ask the exact question). No todo list → state status inline: done-with-proof, pending, or blocked.
Lifecycle
- Every skill declares its own contract — lane, artifact, successor — in a
## Lifecycleblock inside its SKILL.md: follow theNext:a skill hands you instead of asking what comes first. - The lanes are light (spike and bounded work — no contract), standard (
ai-brainstormthenai-orchestrator) and full (architectural, with the triggered nodes). - Approvals are spoken: when the human says approve, ok, or go, record that approval in the appropriate artifact and follow its next step. Never ask the human to type a command; never approve on your own initiative.
Architecture layers
You may edit src/** freely; the arch-test reads .ai-engineering/arch.rules.json — propose layer changes there via PR, never by editing the test in silence.
Voice
Replies to a person, and handoffs to another agent, follow the voice standard in the ai-write skill (references/voice.md). The file ships in the binary and is installed with the skill canon; this section is the part that has to be in context:
- First line is the action.
- More than one step is a numbered list, one action per step.
- Last line is one next action that takes under two minutes.
- Say which step just finished before starting the next.
Session hygiene (context economy)
/clear between tasks · /compact before stopping, not after · batch prompting · check /usage when the context inflates.
Where to work
- Work in the open checkout. Use a worktree only when requested or another feature is active; pause if work may overlap.
- Prefer host worktree support; otherwise run
ai-eng worktree new <branch>and use its reported path. The person chooses or approves the branch. - Resume in the feature checkout. Never stash, reset, overwrite, or remove foreign work; preserve uncertainty and ask.
- After review, offer a PR, local merge, or keeping the branch. Prefer PR with a forge remote, otherwise local merge;
ai-eng worktree merge <slug>handles it.
Git workflow
See Where to work for checkout, worktree, and integration choices. .ai-engineering/recap.html is optional and never required for merge.
Pull requests
- Run lint and the full test suite before committing; the commit must pass everything it will face in CI.
- Add or update tests for the code you change, even if nobody asked.
- After moving files or changing imports, re-run lint and typecheck.
- Title format:
<area>: <imperative summary>(e.g.chain: cache verdicts per tool_use_id). - Commit messages: subject ≤ 50 chars; body explains WHY when it is not obvious.
Anti-drift
This list contains only what the agent CANNOT deduce from the project.
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.

