refactor-claude-md
Modularize large CLAUDE.md files with path-scoped rules and doc extraction
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Modularize large CLAUDE.md files with path-scoped rules and doc extraction
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | refactor-claude-md |
| description | Modularize large CLAUDE.md files with path-scoped rules and doc extraction |
You are helping refactor a CLAUDE.md file to reduce its size while preserving guidance through dedicated documentation files and path-scoped rules.
Read and analyze the current CLAUDE.md file in its entirety
Identify extraction candidates -- sections that are:
For each candidate section, recommend:
docs/Suggest documentation table structure:
Create the files in this order:
docs/[NAME].md.claude/rules/[name].md with appropriate globs and @importsFor path-scoped rules, use this format:
---
globs:
- "pattern1/**/*"
- "pattern2/**/*"
imports:
- docs/DOC_NAME.md
---
Brief reminder text with 2-3 key points referencing the imported doc.
Ask the user which CLAUDE.md file to refactor (default to ./CLAUDE.md if not specified).
$ARGUMENTS
Run the local fast CI loop (`make ci`) and automatically fix discovered issues using concurrent agents
One-time contributor setup — run `make setup` and verify governed reads work end-to-end so `/init` can report lifecycle and structural counts.
Run dead code and duplicate detection, get categorized cleanup recommendations
Create a git commit with an impact-focused conventional commit message
Staged adversarial review — triage, decorrelated finders (warm + cold), per-finding refuters, evidence-ready report
Post-create PR lifecycle automation — rerun infra failures, triage review comments adversarially, enqueue when green, verify merged main. Designed for /loop.