refactor-agents-md
Skill12 starsChanged 49 days agoMITView on GitHub
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.
3 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- vinta/hal-9000their own version, first seen Oct 21, 2026
- The-Syntax-Slayer/skill-genieedited, first seen Oct 9, 2026
- secondorderai/ouroborostheir own version, first seen May 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- The-Syntax-Slayer/skill-genie★ 199% same
Wrote their own version · 2
- vinta/hal-9000★ 142same name
- secondorderai/ouroboros★ 3same 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 repository37 other files it gives its agents.
- 3mf-print-editorSkill
- aegis-protocolSkill
- ai-address-parser-debugSkill
- ai-address-parserSkill
- ai-csuiteSkill
- browser-driverSkill
- chatgpt-web-delegationSkill
- chinese-humanizerSkill
- claude-agent-sdk-authSkill
- close-loopSkill
- de-ai-englishSkill
- dev-inboxSkill
- dokploy-deploySkill
- dokploy-upgradeSkill
- ecommerce-golive-checkSkill
- fork-upstream-syncSkill
- foxcode-openclawSkill
- git-cryptSkill
- git-worktree-decisionSkill
- handoff-receiverSkill
- image-prompt-engineerSkill
- init-rulesSkill
- landing-launch-checkSkill
- linuxdo-applicationSkill
- npm-publishSkill
- omnidebug-autopilotSkill
- psychology-masterSkill
- research-to-wechatSkill
- right-sized-solutionSkill
- rtk-token-saverSkill
- session-handoffSkill
- shared-memorySkill
- stalwart-dokploy-resend-relaySkill
- typed-decisions-around-llmsSkill
- web-compliance-builderSkill
- wechat-compliance-checkSkill
- wordpress-vps-installSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
8
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
- could be automatic: a setting could enforce it
- Distinctive: line 14
Read the current AGENTS.md content and classify each instruction as root-essential, topic-specific, conflicting, redundant, vague, or stale.
- Distinctive: line 15
Keep only universal instructions in the root file, move the rest into topic docs, and surface any contradictions before editing.
- Distinctive: line 24
If two instructions disagree, do not silently merge them.
- Distinctive: line 36
Keep the root file as a router into narrower guidance.
- Distinctive: line 41
Ask the user which mode they want:
- Distinctive: line 46
If the user already gave enough context, skip extra questions and go straight to the matching workflow.
- Distinctive: line 56
All shared guidance lives in references/:
- Distinctive: line 69
keep root AGENTS.md content minimal
“Common” is measured: kept by at least 6 in 10 of the 3 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
<objective>
Refactor 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.
</objective><quick_start>
- Identify whether the user wants a review, a rewrite proposal, or an in-repo refactor.
- Read the current AGENTS.md content and classify each instruction as root-essential, topic-specific, conflicting, redundant, vague, or stale.
- Keep only universal instructions in the root file, move the rest into topic docs, and surface any contradictions before editing. </quick_start>
<essential_principles>
<principle name="keep-root-minimal">
The 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.
</principle>
<principle name="resolve-conflicts-first">
If 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.
</principle><principle name="group-by-purpose">
Move remaining guidance into separate files grouped by topic or behavior, not by author, chronology, or file location.
</principle><principle name="delete-bloat">
Flag redundant, vague, self-evident, or outdated instructions for deletion instead of preserving them in a new location.
</principle><principle name="prefer_progressive_disclosure">
Keep the root file as a router into narrower guidance. Detail belongs in follow-up docs that are only read when relevant.
</principle>
</essential_principles><intake>
Ask the user which mode they want:
1. Review only
2. Propose a rewrite
3. Apply the refactor in the repoIf the user already gave enough context, skip extra questions and go straight to the matching workflow.
</intake>
<routing>
<mode name="review-only">workflows/audit-agents-md.md</mode>
<mode name="propose-rewrite">workflows/audit-agents-md.md</mode>
<mode name="apply-refactor">workflows/refactor-agents-md.md</mode>
</routing><reference_index> All shared guidance lives in references/:
Principles and heuristics: references/principles.md </reference_index>
<workflows_index>
<workflow name="audit-agents-md.md">Review an AGENTS.md file, classify instructions, and propose a minimal split.</workflow>
<workflow name="refactor-agents-md.md">Inspect the repo and rewrite AGENTS.md files in place.</workflow>
</workflows_index>
<success_criteria> The skill is complete when it can consistently:
- identify contradictions before rewriting
- keep root AGENTS.md content minimal
- split topic-specific guidance into separate docs
- flag redundant, vague, and stale instructions for deletion
- produce a clear proposed file structure or apply it in the repo </success_criteria>
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.

