agentleFS
healthier-vitaminshealthier-vitamins/agentic-grimoire/guidelines/claude.md

agentic-grimoire / guidelines

CLAUDE.md2 starsChanged 10 days agoMITView on GitHub

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed. Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment. Before finishing coding work, run the validation commands that match the changed scope (project scripts first, else the installed tool directly): Do not finish with known safe-to-fix issues in the changed scope. Do not weaken rules or hide failures. End every commit message with Claude Code's classic attribution, exactly: This replaces the model-named…

The file

Show its rules and text

We split this claude.md into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before finishing coding work, run the validation commands that match the changed scope (project scripts first, else the installed tool …

    line 9
  2. Distinctive:

    Do not finish with known safe-to-fix issues in the changed scope.

    line 15
  3. Distinctive:

    Keep planning and final review on the top model and let Sonnet handle mechanical execution.

    line 35
  4. Distinctive:

    Do not downgrade further (e.g.

    line 36
  5. Distinctive:

    Keep planning and review on the main thread.

    line 46
  6. Distinctive:

    If multiple interpretations exist, present them — don't pick silently.

    line 59
  7. Distinctive:

    If a simpler approach exists, say so.

    line 60
  8. Distinctive:

    If something is unclear, stop.

    line 61
  9. Distinctive:

    No features beyond what was asked.

    line 67
  10. Distinctive:

    If you write 200 lines and it could be 50, rewrite it.

    line 69
  11. Distinctive:

    Don't "improve" adjacent code, comments, or formatting.

    line 75
  12. Distinctive:

    Remove only the imports/variables YOUR changes made unused.

    line 77
  13. Very specific:

    Use the context7 tool for library/framework/API documentation, setup, and configuration steps.

    line 93
  14. Very specific:

    Prefer fd over find and rg over grep.

    line 98

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
claude.md

CLAUDE.md — agentic-grimoire guidelines

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.

Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

Validation

Before finishing coding work, run the validation commands that match the changed scope (project scripts first, else the installed tool directly):

  • JS/TS: lint, typecheck, format:check, test scripts — or npx eslint ., npx tsc --noEmit, npx prettier --check .
  • Python: uv run ruff check ., uv run ruff format --check ., uv run pyright, uv run pytest

Do not finish with known safe-to-fix issues in the changed scope. Do not weaken rules or hide failures.

Commits

End every commit message with Claude Code's classic attribution, exactly:

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

This replaces the model-named Co-Authored-By line and the Claude-Session session-id/URL trailer the harness suggests — add neither. (Codex has no default co-author trailer, so it attaches nothing — that is expected.)

Model Selection

For cost efficiency without quality loss, use the opusplan alias (/model opusplan): Opus plans and reviews, then auto-switches to Sonnet for execution within the same session. Keep planning and final review on the top model and let Sonnet handle mechanical execution. Do not downgrade further (e.g. Haiku) for non-trivial work — failed loops cost more than they save.

Route subagents by difficulty — each agent's own model sets its cost, whatever model the main session runs:

  • research and hard analysis → researcher (Opus)
  • implementing an already-decided plan → executor (Sonnet)
  • codebase search → Explore (Haiku), rather than reading widely inline, so the orchestrator's context stays clean

Keep planning and review on the main thread.

Keystone

Invoke the keystone skill before implementing non-trivial logic, structuring a module, or judging whether existing code reads well — it carries the reading standard all code is written to. React components, pages, and features take keystone-react on top of it.

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

  • State your assumptions explicitly. If uncertain, ask.
  • If multiple interpretations exist, present them — don't pick silently.
  • If a simpler approach exists, say so. Push back when warranted.
  • If something is unclear, stop. Name what's confusing. Ask.

2. Simplicity First

Minimum code that solves the problem. Nothing speculative.

  • No features beyond what was asked; no abstractions for single-use code.
  • No "flexibility" that wasn't requested; no error handling for impossible scenarios.
  • If you write 200 lines and it could be 50, rewrite it.

3. Surgical Changes

Touch only what you must. Clean up only your own mess.

  • Don't "improve" adjacent code, comments, or formatting; don't refactor what isn't broken.
  • Match existing style. If you notice unrelated dead code, mention it — don't delete it.
  • Remove only the imports/variables YOUR changes made unused.
  • The test: every changed line traces directly to the request.

4. Goal-Driven Execution

Define success criteria. Loop until verified. Transform tasks into verifiable goals ("fix the bug" → "write a failing test that reproduces it, then make it pass"). For multi-step work, state a brief plan with a verify step per step.

5. Design Patterns

Reach for an established Gang-of-Four / architectural pattern before inventing structure — don't build a bespoke solution a reviewer must reverse-engineer.

Context7

Use the context7 tool for library/framework/API documentation, setup, and configuration steps. Do not rely on memory for library versions or APIs when verification is possible.

Shell Tool Preferences

Prefer fd over find and rg over grep. If either is missing, say so and ask before installing.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.