agent-md-refactor
Skill122 starsChanged 37 days agoMITView on GitHub
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
10 other projects use a version of this, 9 of them edited.
Adopted by
Most recently taken up by
- imMamdouhaboammar/kaku-chatgpt-harnessedited, first seen Oct 25, 2026
- Samueladewole/claude-skillsedited, first seen Oct 13, 2026
- meshery/meshkitedited, first seen Oct 8, 2026
- micronaut-projects/micronaut-coretheir own version, first seen Oct 8, 2026
- meshery/mesheryedited, first seen Oct 8, 2026
- shalomb/agent-skillsedited, first seen Aug 23, 2026
Used with
Projects with it also use feedback-mastery, skill-judge and 5 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
nbirknerSkillfeedback-mastery
Use when preparing to give difficult feedback, approaching a hard conversation with a direct report, peer, or manager, or navigating conflict at work. Also use before performance reviews or when addressing repeated behavior issues. Keywords: give feedback, hard conversation, conflict, performance issue, SBI framework.
Also in 3 projects that use this
wpankSkillskill-judge
Evaluate Agent Skill quality against official specifications. Use when reviewing SKILL.md files, auditing skill packages, improving skill design, or checking if a skill follows best practices. Provides 8-dimension scoring (120 points) with actionable improvements. Triggers on review skill, evaluate skill, audit skill, improve skill, skill quality, SKILL.md review.
Also in 3 projects that use this
wpankSkillgame-changing-features
Find 10x product opportunities and high-leverage improvements. Use when the user wants strategic product thinking, mentions 10x, wants to find high-impact features, or asks what would make a product dramatically more valuable.
Also in 3 projects that use this
nahisahoSkilldatabase-schema-designer
Copilot agent for database schema design, ER diagrams, normalization, DDL generation, and performance optimization
Also in 5 projects that use this
eugenepyvovarovSkillcrafting-effective-readmes
Use when writing or improving README files. Not all READMEs are the same — provides templates and guidance matched to your audience and project type.
Also in 3 projects that use this
lookfreeSkillexcalidraw
Generate architecture diagrams as .excalidraw files from codebase analysis. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, or generate excalidraw files.
Also in 3 projects that use this
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 9
- meshery/meshery★ 12k100% same
- meshery/meshkit★ 233100% same
- jeasonstudio/mastergo-skills★ 14100% same
- shalomb/agent-skills★ 398% same
- FelipeAngeli/skills★ 2100% same
- digitalspeed/claude-code-skillset★ 1100% same
- imMamdouhaboammar/kaku-chatgpt-harness★ 0100% same
- nbirkner/digital-brain★ 094% same
- Samueladewole/claude-skills★ 0100% same
Wrote their own version · 1
- micronaut-projects/micronaut-core★ 6.4ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/instructions/copilot-instructions.mdCopilot instructions
- brainstormingSkill
- building-blocksSkill
- commit-workSkill
- dependency-updaterSkill
- explaining-codeSkill
- frontend-designSkill
- github-actions-templatesSkill
- playwright-page-objectsSkill
- qa-test-plannerSkill
- react-useeffectSkill
- test-building-blocksSkill
- test-driven-developmentSkill
- typescript-advanced-typesSkill
- vercel-react-best-practicesSkill
- writing-specSkill
The file
We split this skill into the rules it gives an agent
5 rules. 5 are common, 0 are distinctive, and 0 are very specific to this project.
5
Common
Most of the 10 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 15
Use this skill when:
- Common: line 62
Ask the user to resolve before proceeding.
- Common: line 303
Links work: - All referenced files exist
- Common: line 305
Actionable content: - Every instruction is specific
- Common: line 306
Complete coverage: - No instructions were lost (unless flagged for deletion)
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
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
| Phase | Action | Output |
| 1. Analyze | Find contradictions | List of conflicts to resolve |
| 2. Extract | Identify essentials | Core instructions for root file |
| 3. Categorize | Group remaining instructions | Logical categories |
| 4. Structure | Create file hierarchy | Root + linked files |
| 5. Prune | Flag for deletion | Redundant/vague instructions |
Process
Phase 1: Find Contradictions
Identify any instructions that conflict with each other.
Look for:
- Contradictory style guidelines (e.g., "use semicolons" vs "no semicolons")
- Conflicting workflow instructions
- Incompatible tool preferences
- Mutually exclusive patterns
For each contradiction found:
## Contradiction Found
**Instruction A:** [quote]
**Instruction B:** [quote]
**Question:** Which should take precedence, or should both be conditional?Ask the user to resolve before proceeding.
Phase 2: Identify the Essentials
Extract ONLY what belongs in the root agent file. The root should be minimal - information that applies to every single task.
Essential content (keep in root):
| Category | Example |
| Project description | One sentence: "A React dashboard for analytics" |
| Package manager | Only if not npm (e.g., "Uses pnpm") |
| Non-standard commands | Custom build/test/typecheck commands |
| Critical overrides | Things that MUST override defaults |
| Universal rules | Applies to 100% of tasks |
NOT essential (move to linked files):
- Language-specific conventions
- Testing guidelines
- Code style details
- Framework patterns
- Documentation standards
- Git workflow details
Phase 3: Group the Rest
Organize remaining instructions into logical categories.
Common categories:
| Category | Contents |
typescript.md | TS conventions, type patterns, strict mode rules |
testing.md | Test frameworks, coverage, mocking patterns |
code-style.md | Formatting, naming, comments, structure |
git-workflow.md | Commits, branches, PRs, reviews |
architecture.md | Patterns, folder structure, dependencies |
api-design.md | REST/GraphQL conventions, error handling |
security.md | Auth patterns, input validation, secrets |
performance.md | Optimization rules, caching, lazy loading |
Grouping rules:
- Each file should be self-contained for its topic
- Aim for 3-8 files (not too granular, not too broad)
- Name files clearly:
{topic}.md - Include only actionable instructions
Phase 4: Create the File Structure
Output structure:
project-root/
├── CLAUDE.md (or AGENTS.md) # Minimal root with links
└── .claude/ # Or docs/agent-instructions/
├── typescript.md
├── testing.md
├── code-style.md
├── git-workflow.md
└── architecture.mdRoot file template:
# Project Name
One-sentence description of the project.
## Quick Reference
- **Package Manager:** pnpm
- **Build:** `pnpm build`
- **Test:** `pnpm test`
- **Typecheck:** `pnpm typecheck`
## Detailed Instructions
For specific guidelines, see:
- [TypeScript Conventions](.claude/typescript.md)
- [Testing Guidelines](.claude/testing.md)
- [Code Style](.claude/code-style.md)
- [Git Workflow](.claude/git-workflow.md)
- [Architecture Patterns](.claude/architecture.md)Each linked file template:
# {Topic} Guidelines
## Overview
Brief context for when these guidelines apply.
## Rules
### Rule Category 1
- Specific, actionable instruction
- Another specific instruction
### Rule Category 2
- Specific, actionable instruction
## Examples
### Good
\`\`\`typescript
// Example of correct pattern
\`\`\`
### Avoid
\`\`\`typescript
// Example of what not to do
\`\`\`Phase 5: Flag for Deletion
Identify instructions that should be removed entirely.
Delete if:
| Criterion | Example | Why Delete |
| Redundant | "Use TypeScript" (in a .ts project) | Agent already knows |
| Too vague | "Write clean code" | Not actionable |
| Overly obvious | "Don't introduce bugs" | Wastes context |
| Default behavior | "Use descriptive variable names" | Standard practice |
| Outdated | References deprecated APIs | No longer applies |
Output format:
## Flagged for Deletion
| Instruction | Reason |
| -------------------------------- | --------------------------------- |
| "Write clean, maintainable code" | Too vague to be actionable |
| "Use TypeScript" | Redundant - project is already TS |
| "Don't commit secrets" | Agent already knows this |
| "Follow best practices" | Meaningless without specifics |Execution Checklist
[ ] Phase 1: All contradictions identified and resolved
[ ] Phase 2: Root file contains ONLY essentials
[ ] Phase 3: All remaining instructions categorized
[ ] Phase 4: File structure created with proper links
[ ] Phase 5: Redundant/vague instructions removed
[ ] Verify: Each linked file is self-contained
[ ] Verify: Root file is under 50 lines
[ ] Verify: All links work correctlyAnti-Patterns
| Avoid | Why | Instead |
| Keeping everything in root | Bloated, hard to maintain | Split into linked files |
| Too many categories | Fragmentation | Consolidate related topics |
| Vague instructions | Wastes tokens, no value | Be specific or delete |
| Duplicating defaults | Agent already knows | Only override when needed |
| Deep nesting | Hard to navigate | Flat structure with links |
Examples
Before (Bloated Root)
# CLAUDE.md
This is a React project.
## Code Style
- Use 2 spaces
- Use semicolons
- Prefer const over let
- Use arrow functions
... (200 more lines)
## Testing
- Use Jest
- Coverage > 80%
... (100 more lines)
## TypeScript
- Enable strict mode
... (150 more lines)After (Progressive Disclosure)
# CLAUDE.md
React dashboard for real-time analytics visualization.
## Commands
- `pnpm dev` - Start development server
- `pnpm test` - Run tests with coverage
- `pnpm build` - Production build
## Guidelines
- [Code Style](.claude/code-style.md)
- [Testing](.claude/testing.md)
- [TypeScript](.claude/typescript.md)Verification
After refactoring, verify:
- Root file is minimal - Under 50 lines, only universal info
- Links work - All referenced files exist
- No contradictions - Instructions are consistent
- Actionable content - Every instruction is specific
- Complete coverage - No instructions were lost (unless flagged for deletion)
- Self-contained files - Each linked file stands alone
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.

