agentleFS
Fei2-LabsFei2-Labs/skill-genie/skills/refactor-agents-md/SKILL.md

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

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
  1. Distinctive:

    Read the current AGENTS.md content and classify each instruction as root-essential, topic-specific, conflicting, redundant, vague, or stale.

    line 14
  2. Distinctive:

    Keep only universal instructions in the root file, move the rest into topic docs, and surface any contradictions before editing.

    line 15
  3. Distinctive:

    If two instructions disagree, do not silently merge them.

    line 24
  4. Distinctive:

    Keep the root file as a router into narrower guidance.

    line 36
  5. Distinctive:

    Ask the user which mode they want:

    line 41
  6. Distinctive:

    If the user already gave enough context, skip extra questions and go straight to the matching workflow.

    line 46
  7. Distinctive:

    All shared guidance lives in references/:

    line 56
  8. Distinctive:

    keep root AGENTS.md content minimal

    line 69

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<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>

  1. Identify whether the user wants a review, a rewrite proposal, or an in-repo refactor.
  2. Read the current AGENTS.md content and classify each instruction as root-essential, topic-specific, conflicting, redundant, vague, or stale.
  3. 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 repo

If 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>

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.