agent-md-refactor

Refactor monolithic agent instruction files into linked documentation hierarchies.

3|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/legout/pi-config --skill agent-md-refactor-legout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-md-refactor
Source: https://github.com/legout/pi-config/tree/main/installed-skills/agent-md-refactor
Command: npx skills add https://github.com/legout/pi-config --skill agent-md-refactor-legout

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill solves the problem of bloated, unmaintainable agent instruction files (like CLAUDE.md or AGENTS.md) that waste context tokens and contain contradictory or vague rules.

Core Features & Use Cases

  • Progressive Disclosure: Automatically splits monolithic instruction files into a minimal root file and categorized, linked sub-files.
  • Contradiction Detection: Identifies and surfaces conflicting guidelines for user resolution before restructuring.
  • Pruning: Flags redundant, vague, or outdated instructions for deletion to optimize agent performance.

Quick Start

Ask the agent to refactor your CLAUDE.md file to apply progressive disclosure principles and organize your instructions.

Frequently Asked Questions about agent-md-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a bloated CLAUDE.md file to improve agent context management?

Refactoring a bloated CLAUDE.md file involves splitting monolithic instructions into a minimal root file with linked sub-files using progressive disclosure. This structure categorizes rules and minimizes root file size to optimize agent context and instruction clarity.

What is progressive disclosure for agent instruction files?

Progressive disclosure for agent instruction files is an organizational technique that splits monolithic configurations into a minimal root file and categorized, linked sub-files. This hierarchy prevents context token waste and improves overall agent performance.

Why does my agent instruction file contain contradictory guidelines?

Agent instruction files accumulate contradictory guidelines over time as rules are added. A refactoring process systematically analyzes instruction content to identify and surface these conflicting guidelines for user resolution before restructuring.

How do I prune redundant or vague rules in AGENTS.md?

Pruning redundant or vague rules in AGENTS.md requires systematically analyzing instruction content to flag outdated or repetitive guidelines for deletion. This optimization reduces token waste and clarifies the agent's operational boundaries.

Does refactoring agent instructions work for any project-specific configuration file?

Refactoring agent instructions applies to any project-specific configuration file like CLAUDE.md or AGENTS.md. The process analyzes the file's instruction content to categorize rules and build a linked documentation hierarchy regardless of the specific filename.

What's the best way to organize monolithic agent prompts for clarity?

The best way to organize monolithic agent prompts is applying progressive disclosure principles to split them into a structured, linked documentation hierarchy. This approach categorizes rules, detects contradictions, and prunes vague instructions to minimize root file size.