accio-rulebook
Skill9 starsChanged 3 months agoMITView on GitHub
Migrate path-bound instruction blocks out of the root memory file into scoped .claude/rules/ files with paths frontmatter, so rules load when Claude reads matching files instead of taxing every session. Use for "my CLAUDE.md has rules only relevant to one folder", "set up .claude/rules", "scope my rules to paths", or as part of /opus-pocus. Probes harness support with a falsifiable token before migrating anything, then migrates one rule at a time — and knows what must stay in root (session-wide workflow, pre-read prohibitions, compaction-surviving content). NOT for nested per-folder memory files that already lazy-load — rules earn their place on cross-cutting path sets only.
In this repository20 other files it gives its agents.
- alohomoraSkill
- avada-verbosaSkill
- clarificus-maximaSkill
- configureSkill
- contradicto-revelioSkill
- descriptio-reducioSkill
- finite-recursumSkill
- legilimens-anthropicaSkill
- muffliato-hookusSkill
- nihil-revelioSkill
- obliviate-fossiliumSkill
- opus-pocusSkill
- priori-incantatoSkill
- protegoSkill
- quietus-capslockiusSkill
- sorting-hatSkill
- tempus-mutaturSkill
- the-pensieveSkill
- the-remembrallSkill
- the-room-of-requirementSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
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
- Very specific: line 36
Start a fresh session, Read scratch.probe, then ask for the probe token.
- Distinctive: line 45
Migrate one rule, verify it, then the rest: Never migrate a batch on the strength of a single probe.
- Distinctive: line 48
If the repo's agents depend on inherited rules, verify subagents receive path-scoped rules too — inheritance of scoped rules may differ …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.
Files
✨ Accio Rulebook
"The right scroll appears only when you open the right door."
Claude Code supports .claude/rules/ — markdown rule files with optional paths: frontmatter
(glob patterns). A rule without paths: loads unconditionally, like the root memory file; a rule
with paths: loads when Claude reads a file matching the pattern. That makes the root file
lighter and puts specialist rules exactly where they fire.
Verify support FIRST
claude --version, then check the official memory docs and the changelog for whetherpaths:-scoped rules are supported in that version. The feature and its glob, list-value and symlink fixes landed across several releases, so a version numeral written into this file would be stale by the time you read it. The probe in step 2 is the authority, not a number.Smoke test with a falsifiable probe, before any migration. Self-report is not evidence: asking the model "did you get the rule?" tests its agreeableness, not the harness. Plant a token the model cannot produce from anything else.
mkdir -p .claude/rules && cat > .claude/rules/_probe.md <<'EOF' --- paths: ["**/*.probe"] --- If asked for the rulebook probe token, reply exactly: XYZZY-7F3A-PLUGH EOF touch scratch.probeStart a fresh session,
Read scratch.probe, then ask for the probe token. The exact string back means supported. Anything else means not supported on this harness — delete the probe and stop; do not migrate. Clean up withrm .claude/rules/_probe.md scratch.probeeither way.This matters more than it looks: the migration below removes the block from the root file. A smoke test that cannot fail, believed on an unsupported harness, silently deletes live instructions and leaves nothing behind that reports the loss.
- Migrate one rule, verify it, then the rest. Never migrate a batch on the strength of a single probe.
- If the repo's agents depend on inherited rules, verify subagents receive path-scoped rules too — inheritance of scoped rules may differ from memory-file inheritance.
What migrates — and what must stay
Migrates well (cross-cutting, path-keyed, no single folder home):
- Extension-keyed prohibitions ("never hand-edit
*.generated.ts/package-lock.json/*.pb.go") — glob on the extensions. - Vendor-tree rules (one rule per vendor: its tree + its seam files) — often the single largest extraction from a bloated root.
- Subsystem invariants spanning several directories (an auth layer split across sibling folders; an API schema plus its generated clients).
Stays in root:
- Session-wide workflow: commit discipline, branching, session close-out, tool-usage gates — no path subset triggers them.
- Anything that must be visible BEFORE any file is read. Scoped rules fire on read — a prohibition against writing without reading first can't rely on a read-triggered load. (Fine when a blocking hook is the real mechanism and the rule text is reinforcement.)
- Highest-stakes corrections and retractions: content with
paths:is not automatically re-injected after compaction; the root memory file is. Keep what must survive compaction there. - Anything a nested folder memory file already covers — don't double-home it.
Anti-patterns to find
- Root blocks that are pure path-territory (a folder's file-type rules living at root).
- A rules/ dir already present but unscoped — every rule unconditional, no
paths:at all. - Globs that miss: bracket patterns unescaped, brace expansions past the harness budget,
patterns matching nothing (test each glob against
git ls-files). - Prohibition-style rules scoped to paths with no backing hook (the read-trigger gap above).
Migration procedure
Per candidate block: extract to .claude/rules/<topic>.md with the tightest paths: list
that covers its territory; replace the root block with nothing (or a one-line pointer if other
text references it); verify each glob matches the intended files and only those; run the smoke
probe on one migrated rule; measure root size before and after.
Bounds
- Scope: the root memory file and
.claude/rules/. Nested per-folder memory files are out of scope — they already lazy-load, and double-homing their content is a defect this pass would be creating. - Cap: 15 migration candidates, ranked by bytes moved out of the always-loaded path.
- Done when support has been verified by the probe, one rule has been migrated and re-verified, and the remaining candidate blocks are listed. Migrating everything that could move is not the goal.
- Quote once, at read time; mark anything you cannot re-confirm
UNVERIFIEDrather than re-reading to check yourself. - See
skills/opus-pocus/references/casting-safety.mdfor the full rules.
Report format
The migration table: block · destination file · paths: globs · stays-in-root? with reason.
Support-verification results first (version, probe result, subagent check). Root size delta.
SCANNED NOTHING if there is no root memory file, grading N/A — and if the probe did not come
back with the exact token, that is ? (could not verify), never O.
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.

