agentleFS
odere-proodere-pro/claude-calibration/skills/calibrate-claude-md/SKILL.md

calibrate-claude-md

Skill1 starsChanged 6 months agoMITView on GitHub

Audits `CLAUDE.md`, `CLAUDE.local.md`, and every nested `**/CLAUDE.md` across user / project scopes. Flags committed secrets, files over 200 / 400 effective lines, aspirational ("must" / "always" / "never") wording that should be a hook, vague rules without specifics, `@`-import chains > 5 hops, contradictions between nested files, and `AGENTS.md` siblings that are present but un-imported. Also scaffolds trimmed CLAUDE.md replacements when a file is over budget — the removed content moves into `.claude/rules/<topic>.md` with `paths:` scoping (companion work in `calibrate-rules`). Invoked by the calibration orchestrator (`/calibrate`) and standalone via `/claude-calibration:calibrate-claude-md`.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When the planner detects a recurrence that this bundle scaffolds, the create row is usually routed to a sibling bundle (per …

    line 77
  2. Very specific:

    After every edit or create, re-run bash <BUNDLE>/scripts/lint.sh <changed path> and record verify: ✓ if the signature no longer fires (or …

    line 91
  3. Very specific:

    Never trim load-bearing content silently — when removing a block, either move it to .claude/rules/<topic>.md with appropriate paths: …

    line 96
  4. Distinctive:

    Don't reformat unrelated content when applying a fix.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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
SKILL.md

calibrate-claude-md — per-feature bundle

You audit and tune CLAUDE.md / CLAUDE.local.md / nested **/CLAUDE.md. You receive one of two kinds of work:

  • Direct invocation (/claude-calibration:calibrate-claude-md) — audit everything, report findings, propose fixes inline. The user drives the conversation.
  • Dispatch from the calibrator — one approved plan row at a time, applied surgically.

In both cases the workflow is the same; only the framing differs.

1. Enumerate

bash <BUNDLE>/scripts/enumerate.sh "$PROJECT_DIR"

Yields TSV scope\tpath. Scope is user (~/CLAUDE.md, ~/.claude/CLAUDE.md), project (<PROJECT_DIR>/CLAUDE.md, <PROJECT_DIR>/CLAUDE.local.md), or nested (any other <PROJECT_DIR>/**/CLAUDE.md).

2. Lint

bash <BUNDLE>/scripts/lint.sh <path …>

Yields TSV path\tsignature\tseverity\tdetail. The signatures this bundle owns (see reference.md):

  • claude-md:secret-leak (CRITICAL)
  • claude-md:over-200 (MEDIUM)
  • claude-md:over-400 (HIGH)
  • claude-md:vague-rules (MEDIUM)
  • claude-md:no-agents-md-import (LOW)
  • claude-md:imports-too-deep (HIGH)
  • claude-md:contradicts-nested (MEDIUM)
  • claude-md:must-rule-with-no-hook (MEDIUM)
  • claude-md:restated-readme (LOW)

3. Fix — kind: edit rows

For each finding, the remediation pattern is in examples/<case>/:

  • claude-md:over-200 / claude-md:over-400 → examples/over-200/{before,after}.md (trim the CLAUDE.md; move topic blocks into .claude/rules/<topic>.md with paths: — companion work in calibrate-rules).
  • claude-md:secret-leak → remove the secret, rotate it, move sensitive values to CLAUDE.local.md (git-ignored) or .env.
  • claude-md:vague-rules → replace aspirational verbs with concrete, verifiable rules; recurrence promotes to a .claude/rules/conventions.md (companion work in calibrate-rules).
  • claude-md:must-rule-with-no-hook → either soften the wording or add the matching enforcement hook (companion work in calibrate-hooks).
  • claude-md:no-agents-md-import → add @AGENTS.md near the top of CLAUDE.md.
  • claude-md:imports-too-deep → flatten the import chain; collapse intermediate hops.
  • claude-md:contradicts-nested → reconcile: pick a canonical statement and link the others.
  • claude-md:restated-readme → replace duplicated content with @README.md or a link.

4. Create — kind: create rows

When the planner detects a recurrence that this bundle scaffolds, the create row is usually routed to a sibling bundle (per rules/dispatch.md):

  • claude-md:over-200 ×N → companion calibrate-rules create row scaffolds the new path-scoped rule file containing the moved-out block.
  • claude-md:vague-rules ×N → calibrate-rules scaffolds .claude/rules/conventions.md.
  • claude-md:must-rule-with-no-hook ×N → calibrate-hooks scaffolds the matching enforcement hook.

This bundle owns templates/claude-md.tmpl (used when a CLAUDE.md is being recreated from scratch — a fresh project, or a full rewrite after a secret-leak).

5. Verify

After every edit or create, re-run bash <BUNDLE>/scripts/lint.sh <changed path> and record verify: ✓ if the signature no longer fires (or verify: ✗ <signature> if it still does).

Hard rules

  • Never trim load-bearing content silently — when removing a block, either move it to .claude/rules/<topic>.md with appropriate paths: scoping, or surface the removal in the plan.
  • CLAUDE.md is committed; CLAUDE.local.md is git-ignored. Never put secrets in CLAUDE.md.
  • Effective-line counts come from lint.sh; don't pre-compute them yourself.
  • Don't reformat unrelated content when applying a fix.

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.