agent-md-refactor — Claude Code skill: what it does, how to install
Splits oversized CLAUDE.md or AGENTS.md files into modular docs. It leaves only universal directives in root and links out to detailed subtopics.
npx claude-code-templates@latest --skill development/agent-md-refactorWhat agent-md-refactor does
The skill breaks monolithic agent instruction files into a lean root file and linked documents inside .claude/. The main document retains only context relevant to every single task: a brief project summary, package manager nuances, and custom build scripts. Specific areas like TypeScript rules, testing practices, and architecture patterns migrate into standalone guides.
Execution moves across five distinct steps: flagging contradictions, extracting essential defaults, sorting guidelines into topical files, generating markdown links, and pruning dead weight. It targets vague phrasing, obvious programming basics, and redundant settings for deletion.
If your current instructions contain opposing rules, the skill pauses immediately during analysis and demands a manual resolution.
What it helps with
- shrink bloated root CLAUDE.md files
- uncover conflicting guidelines inside agent documentation
- strip vague rules and generic advice from instructions
- split coding conventions into focused topic files
Example prompts for the agent
- Refactor my CLAUDE.md using progressive disclosure
- Split this long AGENTS.md into separate topic files
- Check agent instructions for conflicts and eliminate fluff
How to install agent-md-refactor
1claude-code-templates
npx claude-code-templates@latest --skill development/agent-md-refactor2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill agent-md-refactor -a claude-code3Manually: put the files in place
~/.claude/skills/agent-md-refactor/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/agent-md-refactor/
Manually: put the files in place
.agents/skills/agent-md-refactor/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/agent-md-refactor/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates agent-md-refactor2Manually: put the files in place
.github/skills/agent-md-refactor/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/agent-md-refactorManually: put the files in place
.devin/skills/agent-md-refactor/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about agent-md-refactor
How to install agent-md-refactor in Claude Code?
Run npx claude-code-templates@latest --skill development/agent-md-refactor in your terminal.
What is agent-md-refactor?
It is an agent skill that restructures monolithic instruction files into a clean root index linked to specific guideline documents.
What content stays in the root instruction file?
The root retains only project-wide essentials: a single-sentence overview, non-standard package managers, custom test or build commands, and universal requirements.