1---2name: refactor-agents-md3description: Refactors AGENTS.md files into a minimal root file plus topic-specific follow-up docs using progressive disclosure. Use when cleaning up, splitting, or reviewing AGENTS.md / CLAUDE.md guidance — or when the file has grown into a "ball of mud" with contradictions, bloat, and stale instructions.4license: MIT-05---67<objective>8Refactor AGENTS.md files so the root file stays small, stable, and broadly useful while detailed guidance moves into focused follow-up docs. The skill helps identify contradictions, separate essentials from bloat, and produce a clearer instruction hierarchy that is easier for agents to follow.9</objective>1011<quick_start>121. Identify whether the user wants a review, a rewrite proposal, or an in-repo refactor.132. Read the current AGENTS.md content and classify each instruction as root-essential, topic-specific, conflicting, redundant, vague, or stale.143. Keep only universal instructions in the root file, move the rest into topic docs, and surface any contradictions before editing.15</quick_start>1617<essential_principles>18<principle name="keep-root-minimal">19The root AGENTS.md should contain only what applies to every task: a one-line project description, package manager expectations if non-default, non-standard build or typecheck commands, and truly universal constraints.20</principle>2122<principle name="resolve-conflicts-first">23If two instructions disagree, do not silently merge them. Surface the conflict, explain the tradeoff briefly, and ask the user which version to keep before rewriting.24</principle>2526<principle name="group-by-purpose">27Move remaining guidance into separate files grouped by topic or behavior, not by author, chronology, or file location.28</principle>2930<principle name="delete-bloat">31Flag redundant, vague, self-evident, or outdated instructions for deletion instead of preserving them in a new location.32</principle>3334<principle name="prefer_progressive_disclosure">35Keep the root file as a router into narrower guidance. Detail belongs in follow-up docs that are only read when relevant.36</principle>37</essential_principles>3839<intake>40Ask the user which mode they want:411. Review only422. Propose a rewrite433. Apply the refactor in the repo4445If the user already gave enough context, skip extra questions and go straight to the matching workflow.46</intake>4748<routing>49<mode name="review-only">workflows/audit-agents-md.md</mode>50<mode name="propose-rewrite">workflows/audit-agents-md.md</mode>51<mode name="apply-refactor">workflows/refactor-agents-md.md</mode>52</routing>5354<reference_index>55All shared guidance lives in references/:5657**Principles and heuristics:** references/principles.md58</reference_index>5960<workflows_index>61<workflow name="audit-agents-md.md">Review an AGENTS.md file, classify instructions, and propose a minimal split.</workflow>62<workflow name="refactor-agents-md.md">Inspect the repo and rewrite AGENTS.md files in place.</workflow>63</workflows_index>6465<success_criteria>66The skill is complete when it can consistently:67- identify contradictions before rewriting68- keep root AGENTS.md content minimal69- split topic-specific guidance into separate docs70- flag redundant, vague, and stale instructions for deletion71- produce a clear proposed file structure or apply it in the repo72</success_criteria>