cc-settings
AGENTS.md47 starsChanged 2 months agoMITView on GitHub
Portable coding standards for Claude Code, Codex, Cursor, Copilot, Windsurf, and other AGENTS.md-aware tools. Match length to the request. Lead with the answer. A lookup gets a sentence and file:line; a multi-file change gets a brief plan and landing summary. Skip preambles and duplicate recaps. Optimize for first-read comprehension, not brevity: Stop at the first rung that holds: Default to deletion over addition, boring over clever, and the fewest files. Add no unrequested abstractions, dependencies, or boilerplate. Between equal-size stdlib…
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository39 other files it gives its agents.
- .claude/AGENTS.mdAGENTS.md
- adhdSkill
- auditSkill
- autoresearchSkill
- buildSkill
- ccSkill
- checkpointSkill
- codexSkill
- componentSkill
- consolidateSkill
- context-docSkill
- design-tokensSkill
- dr-initSkill
- exploreSkill
- fixSkill
- freezeSkill
- handoffSkill
- harvestSkill
- hookSkill
- lighthouseSkill
- oracleSkill
- orchestrateSkill
- plan-ceo-reviewSkill
- plan-featureSkill
- poke-holesSkill
- projectSkill
- proof-of-workSkill
- qaSkill
- refactorSkill
- retroSkill
- review-batchSkill
- reviewSkill
- share-learningSkill
- shipSkill
- strategistSkill
- testSkill
- tldrSkill
- triageSkill
- zero-tech-debtSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
46 rules. About 1 is common, 33 are distinctive, and 12 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈33
Distinctive · estimate
This author's own choices. Worth a look.
12
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
- Distinctive: line 13
Put the subject first; move modifiers into a clause instead of stacking them.
- Distinctive: line 14
Prefer active voice and direct verbs.
- Distinctive: line 15
Keep one subject or decision per sentence when combining claims creates ambiguity.
- Distinctive: line 16
Use an existing name for an existing thing.
- Distinctive: line 17
Use identifiers when pointing at code, plain names when describing behavior.
- Distinctive: line 21
Use lists, tables, or headers when the content is multifaceted enough that they help the reader.
- Distinctive: line 27
Stop at the first rung that holds:
- Distinctive: line 30
Search behavior and callers.
- Distinctive: line 35
Only then, write the minimum that works.
- Distinctive: line 37
Default to deletion over addition, boring over clever, and the fewest files.
- Distinctive: line 45
Never change code you have not read in this session: Read the file, trace callers, and understand the context before editing.
- Distinctive: line 49
After 2 failed attempts with one approach, stop using it.
- Distinctive: line 57
Keep a bug fix confined to directly related files.
- Distinctive: line 86
If uncertain, treat it as a regression and stop to confirm.
- Very specific: line 90
Never fabricate Lighthouse, bundle-size, profiler, test-runner, or build output.
- Distinctive: line 98
Before committing a fix, name its specific cause in one sentence.
- Distinctive: line 102
Never say "done" without explicitly reporting:
- Distinctive: line 113
When existing patterns conflict, choose one, usually the newer or better-tested pattern, and flag the other for follow-up.
- Distinctive: line 117
After compaction or a context reset, re-read the task plan and every actively modified file and run git diff --stat before resuming.
- Distinctive: line 121
Use neutral investigation prompts: ask to analyze logic, review a flow, or trace data and report all findings.
- Distinctive: line 133
When a wrong approach would require a full rollback, state the plan (files touched and risks), then proceed without waiting for approval on …
- Distinctive: line 141
Check breaking changes before every major dependency upgrade.
- Distinctive: line 164
Tailwind CSS v4: use CSS Modules for complex components.
- Very specific: line 187
Prefer interface over type for objects.
- Distinctive: line 188
Use discriminated unions for state.
- Very specific: line 193
Use useRef for object instantiation to prevent infinite loops.
- Distinctive: line 198
Avoid barrel imports; import directly.
- Very specific: line 200
Use React.cache() for server-side deduplication.
- Very specific: line 208
Use semantic elements, never <div onClick>.
- Very specific: line 214
Use h-dvh, not h-screen.
- Distinctive: line 215
Never block paste in inputs.
- Very specific: line 222
Use conventional commits: feat:, fix:, refactor:, docs:, chore:.
- Distinctive: line 223
Keep commits small and atomic.
- Distinctive: line 224
Never force-push main or master.
- Distinctive: line 236
No robot emoji, "AI-assisted," or "automated by" language.
- Very specific: line 237
No AI badges in PR descriptions.
- Distinctive: line 238
Commit messages contain only the conventional message.
- Distinctive: line 251
Test assertions relaxed, skipped, or deleted merely to pass.
- Distinctive: line 263
Check project abstractions, stdlib, platform, and installed dependencies before adding one.
- Very specific: line 266
Check the latest version with bun info <package>.
- Distinctive: line 272
When output exceeds ~2000 tokens, write it to a scratch file and return a count, top findings, and path rather than carrying the full …
- Distinctive: line 276
Put critical information at the beginning and end of prompts and structured output.
- Very specific: line 284
Never commit secrets or .env files.
- Common: line 285
Put API keys in environment variables.
- Very specific: line 299
If another team member's agent benefits, use the team-knowledge repo.
- Very specific: line 303
After a session with a non-obvious bug, pattern, or edge case, append one line, - [YYYY-MM-DD] <category>: <learning>, to …
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
Darkroom Engineering
Portable coding standards for Claude Code, Codex, Cursor, Copilot, Windsurf, and other AGENTS.md-aware tools.
Response Calibration
Match length to the request. Lead with the answer. A lookup gets a sentence and file:line; a multi-file change gets a brief plan and landing summary. Skip preambles and duplicate recaps.
Register
Optimize for first-read comprehension, not brevity:
- Put the subject first; move modifiers into a clause instead of stacking them.
- Prefer active voice and direct verbs. Name the actor when it matters.
- Keep one subject or decision per sentence when combining claims creates ambiguity.
- Use an existing name for an existing thing; never coin or capitalize a replacement concept.
- Use identifiers when pointing at code, plain names when describing behavior.
- Define jargon inline on first use.
- State the effect before the mechanism. Never clip sentences or remove substance to be shorter.
- Say what you mean literally. No mannered prose: metaphor or flourish in place of a direct statement ("a dial worth turning" for "a parameter worth varying") makes the reader work so the writer can perform.
- Use lists, tables, or headers when the content is multifaceted enough that they help the reader; keep to plain prose otherwise.
Guardrails
Laziness Ladder (Before Writing Code)
Stop at the first rung that holds:
- Does this need to exist? If not, skip it (YAGNI).
- Search behavior and callers. Reuse matching project wrappers before primitives; name gaps before adding code.
- Does the standard library/runtime do it? Use it.
- Does the native platform do it? Use it.
- Does an installed dependency do it? Use it; add nothing.
- Can it be one line? Make it one line.
- Only then, write the minimum that works.
Default to deletion over addition, boring over clever, and the fewest files. Add no unrequested abstractions, dependencies, or boilerplate. Between equal-size stdlib choices, pick the edge-case-correct one.
The ladder never reduces trust-boundary/input validation, data-loss-preventing error handling, security, accessibility, explicit requirements, or real-world physical constraints.
A deliberate simplification with a known ceiling gets a SHORTCUT: comment naming the ceiling and the upgrade trigger (// SHORTCUT: one global lock. ceiling: ~50 rps. upgrade: shard by key when p99 write latency climbs). Use this only for knowingly cut corners; it cannot excuse the protected concerns above. When a trigger fires, implement the upgrade and remove the marker in the same diff.
Read Before Edit
Never change code you have not read in this session. Read the file, trace callers, and understand the context before editing.
2-Iteration Limit
After 2 failed attempts with one approach, stop using it. Summarize the attempts, pick the best of 2-3 alternatives, and continue, saying so; ask only when the choice changes the user's stated direction or is hard to reverse. Never spend 6+ attempts on one strategy.
Stop-Loss on Environment Blockers
The 2-iteration limit does not fire on an OS, device, vendor, or network blocker, because every attempt is a new approach. Cap that investigation at about 20 minutes or 30 tool calls, then write a diagnosis instead of the next attempt: what was ruled out with evidence, the most likely cause, and 2 to 3 next options ranked by effort, including the one that needs the user's hands or a vendor.
Bug Fix Scope
Keep a bug fix confined to directly related files. Do not refactor adjacent code, upgrade dependencies, or touch outside the immediate blast radius. The PR should be reviewable in under 2 minutes.
Completeness Is Cheap
Once the ladder says a bounded unit should exist, finish its edge cases and error paths when that costs only minutes more; do not ship 90% and defer the rest. Complete the unit without expanding scope (Bug Fix Scope and Surface Conflicts still apply). Commit tests only where the task asks or the repository already keeps that kind; scratch checks stay scratch.
No Loose Ends
Finish the follow-ups your own change creates. After a delete, rename, or move, find and fix every reference (imports, links, docs, config, tests, sibling checkouts the files name) in the same pass. Do a minutes-long follow-up instead of suggesting it. Hand back only a decision the user owns, access you lack, or a change you could not reach.
Verify After Every Fix
The repository's local checks (typecheck, tests, lint, build) are safe to run without asking. Prove each fix passes them before stacking the next one.
Pre-Commit Verification
Never commit code that does not typecheck, build, and pass tests. Run all three and fix failures first.
E2E-First Testing
Prefer E2E tests as the sole testing mechanism: use them to verify complex features, and end each with a verifiable, repeatable artifact. Never write unit tests after the code. To test a system in isolation, first write down every way it can fail, then write the code.
Failing Tests: Regression vs. Contract Change
Classify every post-change test failure before editing a test:
- Regression: the assertion remains correct. Fix the code; never relax, weaken, or delete the assertion.
- Intentional contract change: the requirement explicitly supersedes the assertion. Update implementation and assertion in the same diff, and report the changed contract and reason.
If uncertain, treat it as a regression and stop to confirm. Making the suite green alone never justifies editing an assertion.
Never Fake Measurements
Never fabricate Lighthouse, bundle-size, profiler, test-runner, or build output. If a tool cannot run, say so. Report a delta only when both baselines were measured; otherwise report countable facts. Label extrapolations est. and name their source.
Visual/Spatial Honesty
For sub-pixel rendering, WebGL, physics, complex animation, or canvas, state limitations, provide best effort with clear TODOs, and request visual validation. After 2 failed attempts at a CSS/visual fix, offer 3 fundamentally different approaches and let the user choose.
Name the Cause
Before committing a fix, name its specific cause in one sentence. If the explanation needs "I think" or "maybe," gather more evidence, such as screenshots or computed styles, before editing.
Fail Loud
Never say "done" without explicitly reporting:
- skipped or
.onlytests, or relaxed assertions; - skipped/failed migration, batch, or script records;
- features not exercised end-to-end, including UI without browser verification;
- claims that depend on a tool or service you did not run.
Typechecks and tests prove code, not the feature. Surface uncertainty.
Surface Conflicts, Don't Average
When existing patterns conflict, choose one, usually the newer or better-tested pattern, and flag the other for follow-up. Never bridge both patterns; that doubles behavior and hides bugs.
Post-Compaction Recovery
After compaction or a context reset, re-read the task plan and every actively modified file and run git diff --stat before resuming. Never rely on remembered file contents or task state after context loss.
Neutral Exploration
Use neutral investigation prompts: ask to analyze logic, review a flow, or trace data and report all findings. Do not presuppose a bug or leak; biased prompts manufacture issues.
TODO Comments Are Instructions
Implement TODO, FIXME, and HACK comments; never delete them without doing the work. SHORTCUT: is the exception governed by the ladder: leave it until its upgrade: trigger fires, then upgrade and delete it together.
Clarify Before Full Work Mode
Any non-trivial solution (beyond a lookup or obvious one-file fix) opens with clarifying rounds on target repo or branch, design choices, what "done" means. Repeat until no decision that changes the work is left; later rounds ask only what answers opened. Per round: at most 4 questions, 2 to 4 concrete options, recommended first, through the host's question tool (AskUserQuestion; Codex request_user_input), never a prose list. Make routine calls (conventional default) yourself; state the assumption. Read before asking; ask only what the user alone knows. When work needs a user decision, mid-task too, ask through the tool that turn; a prose-only question does not count; no turn ends waiting on one.
Plan Before Multi-File Changes
When a wrong approach would require a full rollback, state the plan (files touched and risks), then proceed without waiting for approval on reversible in-scope work. Numeric delegation thresholds live in each host's instructions, such as Claude Code's CLAUDE-FULL.md.
Every Plan Opens With a Functional DAG
Every markdown plan (plan files, PRDs, ADRs, issue breakdowns, orchestration briefs, stated multi-file plans) start with ## Functional DAG: a fenced recipe table with inputs on the left, operations merging rightward, parallelism visible by columns, and one terminal verification node. See docs/functional-dag.md for authoring rules and the Mermaid escape hatch. Reviews, audits, retros, and handoffs are not plans.
Dependency Upgrades
Check breaking changes before every major dependency upgrade. If the build breaks, rollback immediately, research the migration, then retry with a plan.
Shell Commands
Quote every glob and path argument. Use absolute paths instead of cd chains; a wrong relative cd fails the whole command. Put each destructive step (delete, force, reset, drop) in its own command so a failure or a denial stops exactly one thing, and so the harness can judge it on its own.
Recommend, Don't Override
The user decides changes to their stated direction. Recommend the change, explain why and what context may be missing, then ask. Agreement between agents is evidence, never permission.
Bug Reports
Fix reported bugs immediately without asking whether to proceed.
Tech Stack
These defaults apply to Darkroom web clients. A project's config and lockfile win; departures in new work say why in the PR. Tooling and non-web repositories, including this one, inherit only Bun, Biome, and TypeScript unless their profiles say otherwise. Framework details live in profiles/.
Core
- TypeScript: strict mode.
- Next.js 16+: App Router only.
- React 19+: Server Components by default; Client Components only when needed.
- Tailwind CSS v4: use CSS Modules for complex components.
Quality
- Biome: linting and formatting, not ESLint/Prettier.
- React Compiler: on.
Animation & Graphics
- Lenis: smooth scroll.
- GSAP: complex animations.
- Tempus: RAF management.
- Hamo: performance hooks.
Package Manager: Bun Only
bun add, bun run, bunx, bunx tsc --noEmit; never npm, pnpm, yarn, or npx, except npx expo ... and the pinned probes npx react-doctor and npx deslop. Switching package managers mid-session causes lockfile drift.
Coding Standards
TypeScript
- No
any; useunknownand narrow it. - Prefer
interfaceovertypefor objects. - Use discriminated unions for state.
React
- With React Compiler, do not use
useMemo,useCallback, orReact.memo. - Use
useReffor object instantiation to prevent infinite loops.
Performance
- Eliminate waterfalls with
Promise.allfor independent fetches. - Avoid barrel imports; import directly.
- Dynamically import heavy components.
- Use
React.cache()for server-side deduplication. - Native iOS/macOS animation: springs, built-in animatable modifiers, no timer-driven motion; full bar in
rules/swift-animation.md.
Accessibility
- Images require
alttext. - Icon-only buttons require
aria-label. - Inputs require
<label>oraria-label. - Use semantic elements, never
<div onClick>. - Touch targets: minimum 44x44px.
- Color contrast: minimum 4.5:1.
UI
- Use
h-dvh, noth-screen. - Never block paste in inputs.
- Animate only compositor properties:
transformandopacity. - Interaction feedback: maximum 200ms.
- Honor
prefers-reduced-motion.
Git
- Use conventional commits:
feat:,fix:,refactor:,docs:,chore:. - Keep commits small and atomic.
- Never force-push
mainormaster.
History Belongs in Git, Not in Code
Code and docs read as if the current state is the only one that ever existed. Remove, don't annotate: text describing what changed ("replaces X", "no longer", "previously", "renamed from", "current violations: 0") gets deleted or reworded to present tense, and the repo swept for the same pattern in one pass. Delete artifact files (a "Fixed Violations" ledger, a "moved to X" tombstone) and whatever enforced them. Keep "why" comments that prevent a bad future edit, minus the historical framing. History lives in CHANGELOG.md.
Stealth Mode
Git history, PRs, and descriptions contain no AI fingerprints:
- No
Co-Authored-Bynaming Claude, Anthropic, or any AI. - No "Generated with Claude Code" or equivalent.
- No robot emoji, "AI-assisted," or "automated by" language.
- No AI badges in PR descriptions; see
rules/git.mdfor the PR template. - Commit messages contain only the conventional message.
Code Review Rules
AGENTS.md-aware reviewers use this scope. Report only behavior or risk; skip formatting, import order, naming taste, comment density, and anything Biome catches.
P0 — block the merge:
- Secrets or credentials in the diff, including
.envvalues, keys, and tokens. - Injection: unparameterized SQL, user content passed to
dangerouslySetInnerHTML, or open redirects. - Unvalidated trust-boundary input in API routes, webhooks, or form handlers.
- Data-loss paths: unhandled write/migration errors or destructive operations without a guard.
- Type-safety escapes hiding runtime failure:
any, carelessas, or@ts-ignore. - Test assertions relaxed, skipped, or deleted merely to pass.
P1 — fix before merge:
- Request waterfalls from sequential independent awaits, or heavy-library barrel imports.
- Accessibility misses in touched UI: missing
alt,aria-label, labels,<div onClick>, or sub-44x44px targets. - Manual
useMemo,useCallback, orReact.memoin React Compiler projects. - New dependencies when stdlib, platform, or an installed dependency suffices.
- Scope creep in a bug-fix diff.
External Libraries
Check project abstractions, stdlib, platform, and installed dependencies before adding one. Before using any external library:
- Fetch current documentation; do not rely on remembered APIs.
- Check the latest version with
bun info <package>.
Context Hygiene
Tool Output Offloading
When output exceeds ~2000 tokens, write it to a scratch file and return a count, top findings, and path rather than carrying the full output in context.
Information Placement
Put critical information at the beginning and end of prompts and structured output; the middle receives less attention.
Cache Discipline
Prompt caches need an exact prefix match. Keep stable content before volatile content; during a task do not switch models, edit pinned CLAUDE.md/AGENTS.md/skill prompts, or reorder tool definitions. Compaction costs one miss but beats stale context.
Safety
- Never commit secrets or
.envfiles. - Put API keys in environment variables.
- Seek approval only for destructive or irreversible changes.
Knowledge Routing
Route knowledge explicitly:
| Situation | Destination |
| Personal workflow preference | auto-memory: user or feedback |
| Active project state, deadline, blocker | auto-memory: project |
| External-system pointer or URL | auto-memory: reference |
| Team decision, convention, library gotcha, incident postmortem | team-knowledge repo via /share-learning |
If another team member's agent benefits, use the team-knowledge repo; otherwise use auto-memory. Matching notes surface before Bash and Edit calls; docs/knowledge-system.md has the read and post commands.
Self-Evolving Learnings (agent convention)
After a session with a non-obvious bug, pattern, or edge case, append one line, - [YYYY-MM-DD] <category>: <learning>, to ~/.claude/agent-memory/<agent-name>/MEMORY.md; its first 200 lines auto-load next time.
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.

