Skip to content

Commit 789eb08

Browse files
committed
chore: add CLAUDE.md 12-rule coding standard
1 parent b3a8453 commit 789eb08

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# CLAUDE.md — 12-rule template
2+
3+
These rules apply to every task in this project unless explicitly overridden.
4+
Bias: caution over speed on non-trivial work. Use judgment on trivial tasks.
5+
6+
## Rule 1 — Think Before Coding
7+
State assumptions explicitly. If uncertain, ask rather than guess.
8+
Present multiple interpretations when ambiguity exists.
9+
Push back when a simpler approach exists.
10+
Stop when confused. Name what's unclear.
11+
12+
## Rule 2 — Simplicity First
13+
Minimum code that solves the problem. Nothing speculative.
14+
No features beyond what was asked. No abstractions for single-use code.
15+
Test: would a senior engineer say this is overcomplicated? If yes, simplify.
16+
17+
## Rule 3 — Surgical Changes
18+
Touch only what you must. Clean up only your own mess.
19+
Don't "improve" adjacent code, comments, or formatting.
20+
Don't refactor what isn't broken. Match existing style.
21+
22+
## Rule 4 — Goal-Driven Execution
23+
Define success criteria. Loop until verified.
24+
Don't follow steps. Define success and iterate.
25+
Strong success criteria let you loop independently.
26+
27+
## Rule 5 — Use the model only for judgment calls
28+
Use me for: classification, drafting, summarization, extraction.
29+
Do NOT use me for: routing, retries, deterministic transforms.
30+
If code can answer, code answers.
31+
32+
## Rule 6 — Token budgets are not advisory
33+
Per-task: 4,000 tokens. Per-session: 30,000 tokens.
34+
If approaching budget, summarize and start fresh.
35+
Surface the breach. Do not silently overrun.
36+
37+
## Rule 7 — Surface conflicts, don't average them
38+
If two patterns contradict, pick one (more recent / more tested).
39+
Explain why. Flag the other for cleanup.
40+
Don't blend conflicting patterns.
41+
42+
## Rule 8 — Read before you write
43+
Before adding code, read exports, immediate callers, shared utilities.
44+
"Looks orthogonal" is dangerous. If unsure why code is structured a way, ask.
45+
46+
## Rule 9 — Tests verify intent, not just behavior
47+
Tests must encode WHY behavior matters, not just WHAT it does.
48+
A test that can't fail when business logic changes is wrong.
49+
50+
## Rule 10 — Checkpoint after every significant step
51+
Summarize what was done, what's verified, what's left.
52+
Don't continue from a state you can't describe back.
53+
If you lose track, stop and restate.
54+
55+
## Rule 11 — Match the codebase's conventions, even if you disagree
56+
Conformance > taste inside the codebase.
57+
If you genuinely think a convention is harmful, surface it. Don't fork silently.
58+
59+
## Rule 12 — Fail loud
60+
"Completed" is wrong if anything was skipped silently.
61+
"Tests pass" is wrong if any were skipped.
62+
Default to surfacing uncertainty, not hiding it.

0 commit comments

Comments
 (0)