agent-md-refactor

Refactors bloated AGENTS.md, CLAUDE.md, and COPILOT.md files into minimal roots with linked categorized documentation.

6|1|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/mgajewskik/opencode-config --skill agent-md-refactor-mgajewskik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: agent-md-refactor
Source: https://github.com/mgajewskik/opencode-config/tree/main/skills/agent-md-refactor
Command: npx skills add https://github.com/mgajewskik/opencode-config --skill agent-md-refactor-mgajewskik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Refactor bloated agent instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.) to follow progressive disclosure principles. Keeps only universal instructions in the root and organizes everything else into focused, linked documentation to reduce context waste and maintenance burden.

Core Features & Use Cases

  • Contradiction detection and surfacing conflicts before restructuring.
  • Intelligent categorization: extracts essentials for the root and groups rest into logical categories.
  • File-structure creation: minimal root plus organized linked files for specialized topics.
  • Deletion flagging: identifies outdated or overly vague instructions for removal.
  • Template-driven outputs with verifiable references.

Use Case: When a project maintains large AGENTS.md/CLAUDE.md files, apply this skill to produce a compact root file and a hierarchy of topic-specific docs.

Quick Start

Refactor your bloated agent instruction files to implement progressive disclosure by creating a minimal root and categorized linked files.

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 bloated AGENTS.md or CLAUDE.md files to reduce context load?

Refactoring bloated AGENTS.md or CLAUDE.md files involves extracting universal instructions into a minimal root file and organizing specialized topics into linked documentation. This progressive disclosure approach reduces context waste and maintenance burden while preserving essential agent instructions.

What is progressive disclosure for agent instruction files?

Progressive disclosure for agent instruction files keeps only universal rules in the root document and moves specialized topics into categorized, linked docs. This structure minimizes the root file size, reduces context token consumption, and logically separates instructions for easier maintenance.

Can I detect contradictions in my COPILOT.md before splitting it into linked docs?

Yes, contradiction detection scans your COPILOT.md and other agent instruction files to surface conflicting rules before restructuring. Identifying these conflicts early ensures the resulting minimal root and linked documentation hierarchy remains consistent and accurate.

How do I organize agent instructions into a minimal root and linked documentation?

Organizing agent instructions into a minimal root and linked documentation requires intelligent categorization. The process extracts essentials for the root file, groups remaining instructions into logical categories, creates a hierarchy of topic-specific linked files, and flags outdated or vague instructions for deletion.

When should I clean up large agent instruction files using a refactor approach?

You should clean up large agent instruction files when context load becomes excessive or maintenance grows difficult. If your AGENTS.md or CLAUDE.md contains contradictory, outdated, or overly vague instructions, restructuring into a minimal root with linked docs resolves these issues.