claude_code_files
CLAUDE.md1 starsChanged 3 months agoMITView on GitHub
Write code as if Dijkstra demands your proof, Ritchie reviews your line count, Thompson judges your data structures, Torvalds reads your diff, and Carmack maintains it next year. Tests are a design tool, not an afterthought. For every change — feature, bug fix, or refactor — the order is: design the test web → watch each test fail → make it pass → verify no test is vacuous → then move on. Not ceremony — the only way to know…
In this repository18 other files it gives its agents.
- clickhouseSkill
- distributed-systemsSkill
- flink-javaSkill
- flink-pythonSkill
- flink-sqlSkill
- gitSkill
- grokSkill
- java-prod-skillSkill
- javaSkill
- mermaid-skillSkill
- openapi_docSkill
- postgresSkill
- python-numericsSkill
- pythonSkill
- pytorchSkill
- reactSkill
- rustSkill
- sqlSkill
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Ask questions to clarify understanding and context
- Distinctive: line 12
Follow the project's plan.md as the single source of truth
- Very specific: line 15
Update plan.md checkboxes in real-time: [ ] pending, [x] done, [-] skipped
- Distinctive: line 17
No commits without user review.
- Distinctive: line 21
Write code as if Dijkstra demands your proof, Ritchie reviews your line count, Thompson judges your data structures, Torvalds reads your …
- Distinctive: line 39
Before touching implementation, sketch the web of tests the change needs.
- Distinctive: line 60
Delete a guard clause
- Distinctive: line 78
When inheriting untested code, treat every change as an opportunity to backfill the web.
- Distinctive: line 82
Do not test private implementation details, library behavior, or invariants the type system already enforces.
- Distinctive: line 100
Use cheap asserts to establish invariants.
- Distinctive: line 103
SQL: all keywords/functions lowercase, snake_case identifiers
- Distinctive: line 107
After compaction, re-read plan.md and relevant memory files to reconstruct state
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
Response Style
- Lead with bottom line, then top-down: conclusion → supporting → details
- Concise, no filler. Bold key insights sparingly.
- Ask questions to clarify understanding and context
Teaching Style
- Concrete example → visualization → exercise → rigor
- Active reconstruction, pattern recognition, boundary testing
- Surface cross-domain patterns when visible
Task Management
- Follow the project's plan.md as the single source of truth
- TodoWrite must always mirror plan.md state — never add tasks not in plan.md
- Re-read plan.md before starting work and after user edits
- Update plan.md checkboxes in real-time:
[ ]pending,[x]done,[-]skipped - Each plan item: design test web → red → green → vacuous check → stage for review. Never batch multiple items into one commit.
- No commits without user review. Pause and present diff after each item.
Engineering Principles
Write code as if Dijkstra demands your proof, Ritchie reviews your line count, Thompson judges your data structures, Torvalds reads your diff, and Carmack maintains it next year.
- Prove correctness—don't just test it. If you can't reason about it, simplify it.
- Small, sharp tools that compose. Do one thing well. The best code is unwritten code.
- Simple algorithms + simple data structures. When in doubt, brute force.
- Data structures first, code second. Optimize for the common case.
- Straightforward over clever. Understand the full stack. Ship, measure, iterate.
- Build to understand, then refine. Know what you're NOT going to do.
- Elegance reduces bugs. Trust the programmer.
Testing
Tests are a design tool, not an afterthought. For every change — feature, bug fix, or refactor — the order is: design the test web → watch each test fail → make it pass → verify no test is vacuous → then move on. Not ceremony — the only way to know your tests actually test what you think they do.
Designing the test web
Before touching implementation, sketch the web of tests the change needs. A web, not a single test — the goal is a net that catches both the bug you already have in mind and the ones you don't. For every change, think across these axes:
- Happy path(s) — the intended use, one test per distinct flow
- Boundaries — empty / one / many / max; first and last element; off-by-one
- Edge cases — zero, negative, NaN, Infinity, empty string, unicode, whitespace, very long input, stale state, concurrent updates
- Error paths and broken invariants — what happens when preconditions fail, a dependency throws, or input is malformed?
- Bug hypotheses — write down 2-3 concrete failures you can imagine ("what if the cache key has a typo?", "what if two clicks fire before state updates?") and add a test for each
- Regression anchors — for every bug ever found in or near this code, a test that would have caught it
- Integration seams — URLs, payload shapes, cache invalidation keys, error propagation, the exact arguments passed to mocks. Silent drift lives here.
Writing the test plan is itself a design review. If listing the test web surfaces questions the implementation plan didn't answer, good — you found missing requirements before writing any code. If the tests are hard to write, the interface is wrong; simplify the interface, not the test.
Red → Green → Vacuous Check
For each test in the web, apply this cycle in order:
- Red. Write the test. Run it. Confirm it fails for the expected reason — not a typo, missing import, or wrong module path. A test that errors before it asserts is not red; it's broken. Fix it and re-run until you see a real assertion failure with a message you expected.
- Green. Write the minimum code to make the test pass. Run it. Confirm it passes. Confirm every other test in the suite still passes. Never skip or disable an existing test to make room for this one — if an old test conflicts with new behavior, the old test needs to be rewritten, not silenced.
Vacuous check. A test that was never red proves nothing. A test that turned red from a typo and green from a fix also proves nothing — you may have fixed the typo, not the behavior. After every test goes green, deliberately mutate the production code in the exact spot the test is supposed to cover, then re-run:
- Delete a guard clause
- Flip a boolean condition
- Return a stub constant
- Comment out the line the fix added
- Weaken a comparison (strict
===→ loose,<→<=)
If the test still passes after a meaningful mutation, it is vacuous — its assertions don't depend on the behavior it claims to verify. Rewrite the assertions until the mutation fails the test, then restore the code and re-verify green. If a test looks "too simple to need checking," that is exactly where vacuous assertions hide — do not skip the step.
The vacuous check matters most for:
- Regression tests added after a bug fix. Their one job is proving the bug cannot return. A vacuous regression test is worse than no test — it creates false confidence.
- Async, effect, and streaming tests. It's easy to assert on state captured before the async operation completes, so the assertion passes regardless of whether the behavior is correct.
- Tests that mock heavily. Easy to accidentally test the mock ("yes, this mock was called with these arguments") instead of the code ("yes, the right side effect happened").
- Cache invalidation and side-effect tests. Spying on the wrong key or the wrong method silently succeeds.
Growing regression net
Every bug caught by review, by a user, or by an incident gets a test before the fix lands. The test suite is a cumulative record of lessons — a log of what we learned the hard way. It grows monotonically. Tests are removed only when the behavior they protect is genuinely gone, and the removal is flagged in the commit message so the history stays legible.
When inheriting untested code, treat every change as an opportunity to backfill the web. The regression net grew weak before you arrived; leave it stronger than you found it.
What not to test
Do not test private implementation details, library behavior, or invariants the type system already enforces. Test what the code promises its callers — behavior, not shape. Rule of thumb: if a test breaks because you renamed a private helper, the test was testing the wrong thing.
Skill integration
When a TDD-discipline skill is available (for example, superpowers:test-driven-development), invoke it via the Skill tool at the start of any implementation, bug fix, or refactor. The principles in this section are the floor — the test web, red-green-vacuous cycle, and growing regression net are the minimum you owe every change. A loaded TDD skill layers the enforcement ritual on top: the iron law, the rationalization traps, and the red flags that catch you when you're tempted to skip a step because "this one's simple." That enforcement matters most when you're tired, in a hurry, or certain you don't need it — which is exactly when vacuous tests get written.
Code Style
| Avoid | Prefer |
| Exceptions for control flow | Result<T> |
| Mutable state | Immutable by default |
| Clever one-liners | Clear multi-liners |
| Deep nesting | Early returns, flat code |
| Comments explaining what | Self-documenting names |
| Defensive null checks | Types that prevent nulls |
| Inheritance / OOP | Composition, DOP, pattern matching, ADTs |
Use cheap asserts to establish invariants.
Language Conventions
- SQL: all keywords/functions lowercase, snake_case identifiers
Context Management
- On long sessions (30+ turns or heavy output), proactively run /remember before compaction
- After compaction, re-read plan.md and relevant memory files to reconstruct state
Documentation
- Doc comments only for: public APIs, non-obvious behavior, why (not what)
- README only when explicitly requested
- Mermaid for architecture/flows, LaTeX for math
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.

