marknest
CLAUDE.md15 starsChanged 2 months agoMITView on GitHub
- Commits and pushes
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
36 rules. About 0 are common, 21 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Always communicate and work in English.
- Very specific: line 4
Before starting development, check if PRD.md exists in the project root.
- Very specific: line 6
IMPORTANT: Read and follow
METHODOLOGY.md: before starting any task. - Distinctive: line 7
When editing CLAUDE.md, use the minimum words and sentences needed to convey 100% of the meaning.
- Very specific: line 8
Before each commit, run auto-formatting.
- Distinctive: line 14
Write tests first. Follow Red-Green-Refactor: (1) failing test, (2) minimal code to pass, (3) refactor.
- Distinctive: line 15
Use real-world scenarios and realistic data in tests.
- Distinctive: line 17
Test behavior, not implementation.
- Distinctive: line 18
Every new feature or bug fix must have corresponding tests.
- Very specific: line 19
Optimize test execution speed: Run independent tests in parallel (multi-process/multi-thread, async, or parallel runner).
- Distinctive: line 21
If full test suite exceeds 30 seconds, investigate: split slow integration tests from fast unit tests, run unit tests first for quick …
- Distinctive: line 28
Prefer automated visual and structural checks that catch clipping, truncation, missing images, missing text, broken tables, and page-loss …
- Distinctive: line 30
Do not assume a behavior is impossible and choose an easier degraded output without first testing whether a print-safe implementation is …
- Distinctive: line 31
When a corpus document reveals a fidelity bug, add a regression fixture or test for that pattern before fixing it.
- Distinctive: line 35
Add structured logs at key decision points, state transitions, and external calls — not every line.
- Very specific: line 37
Use appropriate log levels: ERROR for failures requiring action, WARN for recoverable issues, INFO for business events, DEBUG for …
- Distinctive: line 38
Keep logging thread-safe. Use thread/coroutine IDs in log context for multi-threaded environments.
- Distinctive: line 39
Never log sensitive data (credentials, tokens, PII).
- Distinctive: line 40
Avoid excessive logging in hot paths — logging must not degrade performance or increase latency noticeably.
- Very specific: line 45
Prefer clarity over brevity, but don't over-pad.
- Very specific: line 51
Prefer explicit type annotations over type inference.
- Distinctive: line 59
Delete comments when the code changes — outdated comments are worse than no comments.
- Distinctive: line 70
Read only the single most relevant reference file unless more are clearly necessary.
- Very specific: line 71
If no relevant project exists in references/ for a task above, search for a well-maintained open-source project that solves a similar …
- Very specific: line 72
Add each useful new reference to references/INDEX.md and create a matching detail file in references/.
- Very specific: line 78
All commits must use the local git config user.name and user.email.
- Very specific: line 79
All commits must include Signed-off-by line (always use git commit -s).
- Distinctive: line 83
All changes go through pull requests.
- Distinctive: line 89
Do not delete worktrees immediately after task completion — remove only when starting new work or upon user confirmation.
- Distinctive: line 93
Follow all steps in order:
- Distinctive: line 97
Check for conflicts. If main has advanced, rebase/merge as needed.
- Very specific: line 98
Wait for CI to pass: gh pr checks <number> --watch.
- Very specific: line 103
Delete local branch: git branch -d <branch-name>
- Very specific: line 104
Delete remote branch: git push origin --delete <branch-name>
- Distinctive: line 108
When creating a GitHub Release, include a Contributors section crediting all external contributors since the previous release.
- Very specific: line 109
Use git log <prev-tag>..HEAD --format='%an' | sort -u to find contributors.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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
Project Rules
- Always communicate and work in English.
- Before starting development, check if
PRD.mdexists in the project root. If it does, read and follow the requirements defined in it throughout the development process. - IMPORTANT: Follow Test-Driven Development (TDD). See the Testing (TDD) section below for detailed rules.
- IMPORTANT: Read and follow
METHODOLOGY.mdbefore starting any task. - When editing
CLAUDE.md, use the minimum words and sentences needed to convey 100% of the meaning. - Before each commit, run auto-formatting. Follow
FORMATTING.mdfirst; if it has no command, use the project's existing formatter; if none exists, use the language-default formatter and record the exact command inFORMATTING.md. - After completing each planned task, run tests and commit before moving to the next task. Skip tests if the change has no impact on runtime behavior (e.g., docs, comments, CI config). Changes to runtime config files (YAML, JSON, etc. read by code) must still trigger tests.
- After any code change (feature addition, bug fix, refactoring, PR merge), check if
README.mdneeds updating. If project description, usage, setup, architecture, or API changed, updateREADME.mdwith clear, concise language. Keep it minimal — only document what users need to know.
Testing (TDD)
- Write tests first. Follow Red-Green-Refactor: (1) failing test, (2) minimal code to pass, (3) refactor.
- Use real-world scenarios and realistic data in tests. Prefer actual use cases over trivial/contrived examples.
- Never overfit to tests. Implementation must solve the general problem, not just the specific test cases. No hardcoded returns, no input-matching conditionals, no logic that only handles test values. Use triangulation — when a fake/hardcoded implementation passes, add tests with different inputs to force generalization.
- Test behavior, not implementation. Assert on observable outcomes, not internal details — tests must survive refactoring.
- Every new feature or bug fix must have corresponding tests.
- Optimize test execution speed. Run independent tests in parallel (multi-process/multi-thread, async, or parallel runner). Use the framework's built-in parallel execution (e.g.,
pytest-xdist,jest --workers,go test -parallel). Keep each test isolated — no shared mutable state — so parallel execution is safe. - For I/O-bound tests (network, file, DB), prefer async or use mocks to avoid blocking. For CPU-bound tests, use multi-process/multi-thread parallelism.
- If full test suite exceeds 30 seconds, investigate: split slow integration tests from fast unit tests, run unit tests first for quick feedback.
- Skip tests when no runtime impact. In CI/CD, use path filters to trigger tests only when source code, test files, or runtime config files (YAML, JSON, etc. read by code) are modified. Non-runtime changes (docs, README,
.md, CI pipeline config) should not trigger test runs. Locally, verify whether a change affects runtime behavior before running tests.
PDF Fidelity
- For Markdown/HTML/PDF rendering work, do not rely on manual inspection alone. Add or run automated fidelity checks.
- Maintain a real-world validation corpus of about 50 popular public GitHub repos with diverse README patterns.
- Prefer automated visual and structural checks that catch clipping, truncation, missing images, missing text, broken tables, and page-loss regressions.
- Fidelity target is content preservation, not pixel-perfect browser parity. If an interactive browser pattern does not map to PDF, transform it into a print-safe layout that still shows all content, such as wrapping, stacking, expanding, or paginating.
- Do not assume a behavior is impossible and choose an easier degraded output without first testing whether a print-safe implementation is feasible.
- When a corpus document reveals a fidelity bug, add a regression fixture or test for that pattern before fixing it.
Logging
- Add structured logs at key decision points, state transitions, and external calls — not every line. Logs alone should reveal the execution flow and root cause.
- Include context: request/correlation IDs, input parameters, elapsed time, and outcome (success/failure with reason).
- Use appropriate log levels:
ERRORfor failures requiring action,WARNfor recoverable issues,INFOfor business events,DEBUGfor development diagnostics. - Keep logging thread-safe. Use thread/coroutine IDs in log context for multi-threaded environments.
- Never log sensitive data (credentials, tokens, PII). Mask or omit them.
- Avoid excessive logging in hot paths — logging must not degrade performance or increase latency noticeably.
Naming
- Names must be self-descriptive — understandable without reading surrounding code. Avoid cryptic abbreviations (
proc,mgr,tmp). - Prefer clarity over brevity, but don't over-pad.
user_email>e,calculate_shipping_cost>calc— but no need forcalculate_the_total_shipping_cost_for_user. - Booleans should read as yes/no questions:
is_valid,has_permission,should_retry. - Functions/methods should describe the action and target:
parse_config,send_notification,validate_input.
Types
- Prefer explicit type annotations over type inference. Implicit types (
auto, untyped Python,any) force readers to infer from context, increasing ambiguity. - At minimum, annotate function signatures (parameters and return types). Annotate variables when the type isn't obvious from the assigned value.
Comments
- Explain why, not what. Code already shows what it does — comments should capture intent, constraints, and non-obvious decisions.
- Comment business rules, workarounds, and "why this approach over the obvious one" — context that can't be inferred from code alone.
- Mark known limitations with
TODO(reason)orFIXME(reason)— always include why, not just what. - Delete comments when the code changes — outdated comments are worse than no comments.
Reference Projects
- First check
references/INDEX.mdif it exists whenever the task includes at least one of the following:- adding a new feature
- changing runtime behavior
- changing public CLI or API behavior
- introducing a new dependency
- modifying code in more than one module or crate
- making an architectural or data model decision
- Read only the single most relevant reference file unless more are clearly necessary.
- If no relevant project exists in
references/for a task above, search for a well-maintained open-source project that solves a similar problem. Search across languages when useful. Evaluate by maintenance activity and architectural similarity. - Add each useful new reference to
references/INDEX.mdand create a matching detail file inreferences/. Keep detail files under 50 lines. - Skip this step for documentation-only edits, formatting-only edits, comments-only edits, renames without behavior changes, and isolated test-only changes that do not require new design decisions.
- Cite the reference project that informed the implementation when applying its patterns.
Git Configuration
- All commits must use the local git config
user.nameanduser.email. Verify withgit config user.nameandgit config user.emailbefore committing. - All commits must include
Signed-off-byline (always usegit commit -s). TheSigned-off-byname must match the commit author.
Branching & PR Workflow
- All changes go through pull requests. No direct commits to
main. - Branch naming:
<type>/<short-description>(e.g.,feat/add-parser,fix/table-bug). - One branch = one focused unit of work.
- Use git worktrees for all branch work. Do not use
git checkout/git switchin the main repo.- Create:
git worktree add ../<repo-name>-<branch-name> -b <type>/<short-description> - Work and push from inside the worktree.
- Do not delete worktrees immediately after task completion — remove only when starting new work or upon user confirmation.
- Create:
PR Merge Procedure
Follow all steps in order:
- Rewrite PR description if empty/unclear via
gh pr edit. Include: what changed, why, key changes, and relevant context. - Cross-reference related issues (
gh issue list). Use "Related: #N" — avoid auto-close keywords unless instructed. - Check for conflicts. If
mainhas advanced, rebase/merge as needed. - Wait for CI to pass:
gh pr checks <number> --watch. Abort if tests fail. - Final code review via
gh pr diff <number>— check for debug statements, hardcoded paths, credentials, unused imports. - Merge:
gh pr merge <number> --merge. Never use--delete-branch(worktree depends on the branch). - Return to main repo,
git pullto sync. - Remove worktree:
git worktree remove ../<repo-name>-<branch-name> - Delete local branch:
git branch -d <branch-name> - Delete remote branch:
git push origin --delete <branch-name>
Releases
- When creating a GitHub Release, include a Contributors section crediting all external contributors since the previous release.
- Use
git log <prev-tag>..HEAD --format='%an' | sort -uto find contributors. List each with their GitHub profile link and a brief summary of their contribution.
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.

