Agent MD Refactor

Agent

by davila7 · Added 5mo ago

Claude

Install

npx claude-code-templates@latest --agent=cli-tool/components/skills/development/agent-md-refactor --yes

Add to Claude

claude mcp add agent-md-refactor

About

Agent MD Refactor

A Claude Code skill that transforms bloated agent instruction files into clean, organized documentation using progressive disclosure principles.

Based on https://x.com/mattpocockuk/status/2012906065856270504 (Matt Pocock's Prompt Idea)

Purpose

Over time, agent instruction files like CLAUDE.md, AGENTS.md, or COPILOT.md tend to grow into unwieldy documents containing hundreds of lines of mixed instructions. This creates several problems:

  • Context waste: Every task loads the entire file, even when most instructions are irrelevant
  • Maintenance burden: Finding and updating specific instructions becomes difficult
  • Contradictions: Conflicting guidelines accumulate without being noticed
  • Signal-to-noise ratio: Important rules get buried among obvious or vague statements

This skill solves these problems by applying progressive disclosure - keeping only essential, universal instructions in the root file while organizing everything else into focused, linked documentation files.

When to Use

Use this skill when you need to clean up agent instruction files. Common trigger phrases include:

  • "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"

Good candidates for refactoring:

  • Root agent files exceeding 50-100 lines
  • Files mixing multiple unrelated topics (testing, code style, architecture, etc.)
  • Documents that have grown organically without structure
  • Files containing contradictory or redundant instructions

How It Works

The skill follows a systematic 5-phase process:

Phase 1: Find Contradictions

Before restructuring, the skill identifies conflicting instructions that need resolution. Examples include contradictory style guidelines ("use semicolons" vs "no semicolons") or incompatible workflow instructions. Each contradiction is surf

Tags

FullStackaitmplclaude-code-templates

From Our Store

View all →
Claude Code

Claude Code Power User Kit

$39+

Advanced Claude Code skills and configurations

OpenClaw

OpenClaw Business Starter Kit

$59+

Set Up Your AI Assistant in 60 Minutes