agent-md-refactor

Refactor monolithic CLAUDE.md or AGENTS.md files into modular linked documentation.

9|2|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/stephanj/claude-code-collections --skill agent-md-refactor-stephanj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-md-refactor
Source: https://github.com/stephanj/claude-code-collections/tree/main/skills/agent-md-refactor
Command: npx skills add https://github.com/stephanj/claude-code-collections --skill agent-md-refactor-stephanj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the issue of bloated, unmanageable agent instruction files like CLAUDE.md or AGENTS.md that suffer from context waste, maintenance difficulty, and contradictory guidelines.

Core Features & Use Cases

  • Contradiction Detection: Identifies conflicting instructions before restructuring.
  • Progressive Disclosure: Moves non-essential, topic-specific rules into linked, categorized files.
  • Root Minimization: Ensures the main instruction file remains concise and focused on universal project rules.

Quick Start

Ask the agent to refactor your current 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 reduce context waste?

Refactor a bloated CLAUDE.md file by applying progressive disclosure principles, which extract non-essential rules into linked, categorized files to reduce context waste and improve instruction clarity.

What is progressive disclosure for agent configuration files?

Progressive disclosure for agent configuration is a structuring technique that moves topic-specific rules out of a monolithic root instruction file into modular, linked documents, ensuring universal project rules remain concise.

How do I detect contradictory instructions in AGENTS.md before restructuring?

Detect contradictory instructions in AGENS.md by running a refactoring process that identifies conflicting guidelines during its initial analysis phase before extracting and categorizing essential rules.

What is the best way to organize project-level AI agent instructions?

The best way to organize project-level AI agent instructions is through a five-phase process: contradiction detection, essential extraction, categorization, structural hierarchy creation, and redundant instruction pruning.

When do I need to split a monolithic agent instruction file into linked documentation?

You need to split a monolithic agent instruction file when it suffers from context waste, maintenance difficulty, or contradictory guidelines, requiring categorization and structural hierarchy creation to manage AI context effectively.

Does refactoring agent instructions work for files without external dependencies?

Yes, refactoring agent instructions works without external dependencies, using a standalone five-phase process to prune redundant instructions and minimize the root configuration file for better AI context management.