refactor-docs
Skill2 starsChanged 9 months agoMITView on GitHub
Split oversized or multi-topic docs into focused files with progressive disclosure
In this repository12 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- add-core-guideSkill
- add-project-guideSkill
- bootstrapSkill
- evolveSkill
- releaseSkill
- researchSkill
- setupSkill
- sync-skillsSkill
- update-readmeSkill
- verify-docsSkill
- setupSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 7 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 20
If $ARGUMENTS is a file path, analyze only that file
- Very specific: line 21
If $ARGUMENTS is a directory, analyze all .md files in it
- Very specific: line 22
If $ARGUMENTS is empty, scan all .md files in: core/, projects/, templates/, skill/, .claude/skills/, .claude/rules/
- Distinctive: line 42
Create new files with extracted content
- Distinctive: line 43
Update the original file to reference the new files
- Very specific: line 44
Update @import directives in CLAUDE.md if applicable
- Distinctive: line 45
Update cross-references in other files that linked to the original
- Distinctive: line 47
Verify: After refactor, confirm:
- Distinctive: line 48
No broken cross-references (Grep for old paths, check they've been updated)
- Distinctive: line 49
All new files are under 300 lines
- Distinctive: line 50
No content was lost in the split
≈ “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
Refactor Docs
Split oversized or multi-topic documentation files into focused, smaller files following progressive disclosure principles.
Steps
- Determine scope:
- If
$ARGUMENTSis a file path, analyze only that file - If
$ARGUMENTSis a directory, analyze all.mdfiles in it - If
$ARGUMENTSis empty, scan all.mdfiles in:core/,projects/,templates/,skill/,.claude/skills/,.claude/rules/
- If
- Identify candidates: For each file, flag if:
- Over 300 lines
- Covers multiple distinct topics (detected by counting
##sections on unrelated subjects) - Has large reference sections that could be extracted
Propose split strategy for each flagged file:
Core guides: Split into
{topic}-guide.md(essentials, <150 lines) +{topic}-reference.md(deep-dive details, examples, edge cases)CLAUDE.md files: Move detailed sections to separate files importable via
@import, keep CLAUDE.md as a concise overview (<100 lines)Rule files: Break multi-topic rule files into single-topic files, each with appropriate
pathsfrontmatter for scoped loadingSkill files: Extract large reference sections into companion files only if the skill exceeds 250 lines (skills should be self-contained where possible)
- Present the plan with before/after line counts for each file. Wait for user approval before proceeding.
- Execute the refactor:
- Create new files with extracted content
- Update the original file to reference the new files
- Update
@importdirectives in CLAUDE.md if applicable - Update cross-references in other files that linked to the original
- Verify: After refactor, confirm:
- No broken cross-references (Grep for old paths, check they've been updated)
- All new files are under 300 lines
- No content was lost in the split
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.

