If your AGENTS.md or CLAUDE.md has ballooned into a 500-line monolith, this walks you through splitting it into a minimal root file plus organized, linked documentation. It's built around progressive disclosure: keep only universal info at the top (commands, project basics), then move language-specific rules, testing patterns, and style guides into separate files like typescript.md or code-style.md. The process flags contradictions first, then helps you prune vague instructions like "write clean code" that just waste tokens. The checklist aims for a root file under 50 lines. Solid if you're drowning in agent instructions and need a structured cleanup.

skills.sh installs
446
GitHub stars
33.2K
last updated
Aug 21, 2026

Install

$ npx -y skills add davila7/claude-code-templates --skill agent-md-refactor --agent claude-code

Installs into .claude/skills of the current project.

Files

Agent MD Refactor

Refactor bloated agent instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.) to follow progressive disclosure principles - keeping essentials at root and organizing the rest into linked, categorized files.


Triggers

Use this skill when:

  • "refactor my AGENTS.md" / "refactor my CLAUDE.md"
  • "split my agent instructions"
  • "organize my CLAUDE.md file"
  • "my AGENTS.md is too long"
  • "progressive disclosure for my instructions"
  • "clean up my agent config"

Quick Reference

PhaseActionOutput
1. AnalyzeFind contradictionsList of conflicts to resolve
2. ExtractIdentify essentialsCore instructions for root file
3. CategorizeGroup remaining instructionsLogical categories
4. StructureCreate file hierarchyRoot + linked files
5. PruneFlag for deletionRedundant/vague instructions

Process

Phase 1: Find Contradictions

Identify any instructions that conflict with each other.

Sponsors

Details

Repository
github.com/davila7/claude-code-templates
Categories
Documentation, Code Review & Quality, AI & Agent Building
First seen
Jun 3, 2026

More from davila7/claude-code-templates

All 618
1galaxy-dawn avatarkaggle-learnergalaxy-dawn/claude-scholarThis skill should be used when the user asks to "learn from Kaggle", "study Kaggle solutions", "analyze Kaggle competitions", or mentions Kaggle competition URL446skills.sh installs
2posit-dev avatarlifecycleposit-dev/skillsGuidance for managing R package lifecycle according to tidyverse principles using the lifecycle package. Use when: (1) Setting up lifecycle infrastructure in a 446skills.sh installs
3thomaspraun avatarmql-developerthomaspraun/mql-developerComprehensive MQL4/MQL5 development for MetaTrader 4 and MetaTrader 5 platforms. Use when writing, reviewing, debugging, or architecting: Expert Advisors (EAs),446skills.sh installs
4defillama avataryield-strategiesdefillama/defillama-skillsGuide for querying DeFi yield and APY data using get_yield_pools. Covers pool filtering by token, chain, protocol, category, stablecoin-only mode, and capacity 442skills.sh installs
5jwynia avatarproduct-analysisjwynia/agent-skillsDiagnose competitive product analysis state and guide through systematic market evaluation. Use when analyzing a product category, building feature comparisons,438skills.sh installs
6manutej avatarapache-airflow-orchestrationmanutej/luxor-claude-marketplaceComplete guide for Apache Airflow orchestration including DAGs, operators, sensors, XComs, task dependencies, dynamic workflows, and production deployment438skills.sh installs