From qe-framework
Refactors bloated AGENTS.md, CLAUDE.md, or similar agent instruction files by splitting them into systematically organized, linked documents following the progressive disclosure principle.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qe-framework:Mrefactor-agent-mdThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Refactors agent instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.) that have grown too large, following the **progressive disclosure principle**. Keeps core content at the root and organizes the rest into linked, categorized files.
Refactors agent instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.) that have grown too large, following the progressive disclosure principle. Keeps core content at the root and organizes the rest into linked, categorized files.
| Phase | Task | Output |
|---|---|---|
| 1. Analyze | Find contradictions | List of conflicts to resolve |
| 2. Extract | Identify core content | Core directives for root file |
| 3. Categorize | Group remaining directives | Logical categories |
| 4. Structure | Build file hierarchy | Root + linked files |
| 5. Prune | Mark items for deletion | Duplicate / ambiguous directives |
Identify directives that conflict with each other.
Check for:
When a contradiction is found:
## Contradiction Found
**Directive A:** [quote]
**Directive B:** [quote]
**Question:** Which should take priority, or should both apply conditionally?
Ask the user to resolve it before proceeding.
Extract only what belongs in the root file. Include only information that applies universally to all tasks.
Core content (keep at root):
| Category | Examples |
|---|---|
| Project description | One sentence: "A React dashboard for analytics" |
| Package manager | Only if non-default (e.g., "use pnpm") |
| Non-standard commands | Custom build/test/typecheck commands |
| Critical overrides | Items that must override defaults |
| Global rules | Rules that apply to 100% of all tasks |
Non-core content (move to linked files):
Common categories:
| Category | Content |
|---|---|
typescript.md | TS conventions, type patterns, strict mode |
testing.md | Test framework, coverage, mocking |
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, input validation, secrets |
performance.md | Optimization, caching, lazy loading |
Categorization rules:
{topic}.mdOutput structure:
project-root/
├── CLAUDE.md # Minimal root with links
└── .claude/
├── typescript.md
├── testing.md
├── code-style.md
├── git-workflow.md
└── architecture.md
Root file template:
# Project Name
One-sentence project description.
## Quick Reference
- **Package manager:** pnpm
- **Build:** `pnpm build`
- **Test:** `pnpm test`
- **Typecheck:** `pnpm typecheck`
## Detailed Guidelines
- [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)
Deletion criteria:
| Criterion | Example | Reason |
|---|---|---|
| Redundant | "Use TypeScript" (in a .ts project) | Agent already knows this |
| Too vague | "Write clean code" | Not actionable |
| Obvious | "Don't introduce bugs" | Wastes context |
| Default behavior | "Use meaningful variable names" | Standard practice |
| Outdated | References to deprecated APIs | Not applicable |
[ ] Phase 1: All contradictions identified and resolved
[ ] Phase 2: Root file contains only core content
[ ] Phase 3: All remaining directives categorized
[ ] Phase 4: File structure created with correct links
[ ] Phase 5: Duplicate / ambiguous directives removed
[ ] Verify: Each linked file is self-contained
[ ] Verify: Root file is under 50 lines
[ ] Verify: All links work correctly
| Avoid | Reason | Instead |
|---|---|---|
| Keep everything in root | Becomes bloated and hard to maintain | Split into linked files |
| Too many categories | Creates fragmentation | Merge related topics |
| Vague directives | Wastes tokens | Be specific or delete |
| Duplicating defaults | Agent already knows them | Only specify overrides |
| Deep nesting | Hard to navigate | Use a flat structure with links |
After refactoring:
npx claudepluginhub inho-team/qe-framework --plugin qe-frameworkCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.