Agent skill

Agent Md Refactor

by meshery in meshery/meshery-operator

Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles.

MITAuto-check passedAgent Workflows

Install Agent Md Refactor

skills CLI
$ npx skills add meshery/meshery-operator --skill agent-md-refactor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install meshery/meshery-operator agent-md-refactor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/meshery/meshery-operator.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/agent-md-refactor .claude/skills/agent-md-refactor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agent-md-refactor
GitHub stars
151
Used in
5 other repos
Token cost
~1.9k tokens
SKILL.md length
523 words
Files
2
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles.

  • Works in 5 steps: Find Contradictions → Identify the Essentials → Group the Rest → …
  • Tasks that involve Agent instruction files
  • SKILL.md covers Triggers, Quick Reference, Process and Execution Checklist, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Agent Md Refactor is an agent skill from meshery/meshery-operator. Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `README.md`).

It sits in Agent Workflows, covering Agent instruction files and Refactoring. It works with Kubernetes. The repository describes itself as: Meshery Operator is a Kubernetes Operator that deploys and manages the lifecycle of two Meshery components critical to Meshery's operations of Kubernetes clusters. The licence is MIT.

When your agent uses it

  • Tasks that involve Agent instruction files
  • Tasks that involve Refactoring

Example prompts

  • “/agent-md-refactor”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Find Contradictions
  2. Identify the Essentials
  3. Group the Rest
  4. Create the File Structure
  5. Flag for Deletion

What it can do on your machine

Read from SKILL.md and the folder at commit 632cd41. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agent Md Refactor loads about 1.9k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 523 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from meshery/meshery-operator at commit 632cd41, republished under its MIT licence (© meshery). 523 words, ~1,858 tokens.

Download SKILL.mdSave it as .claude/skills/agent-md-refactor/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
agent-md-refactor
description
Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Splits monolithic files into organized, linked documentation.
license
MIT

Agent MD Refactor

Refactor bloated agent instruction files (AGENTS.md, CLAUDE.md, COPILOT.md, etc.) to follow progressive disclosure principles - keeping essentials at root and organizing the rest into linked, categorized files.


Triggers

Use this skill when:

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

Quick Reference

PhaseActionOutput
1. AnalyzeFind contradictionsList of conflicts to resolve
2. ExtractIdentify essentialsCore instructions for root file
3. CategorizeGroup remaining instructionsLogical categories
4. StructureCreate file hierarchyRoot + linked files
5. PruneFlag for deletionRedundant/vague instructions

Process

Phase 1: Find Contradictions

Identify any instructions that conflict with each other.

Look for:

  • Contradictory style guidelines (e.g., "use semicolons" vs "no semicolons")
  • Conflicting workflow instructions
  • Incompatible tool preferences
  • Mutually exclusive patterns

For each contradiction found:

markdown
## Contradiction Found

**Instruction A:** [quote]
**Instruction B:** [quote]

**Question:** Which should take precedence, or should both be conditional?

Ask the user to resolve before proceeding.


Phase 2: Identify the Essentials

Extract ONLY what belongs in the root agent file. The root should be minimal - information that applies to every single task.

Essential content (keep in root):

CategoryExample
Project descriptionOne sentence: "A React dashboard for analytics"
Package managerOnly if not npm (e.g., "Uses pnpm")
Non-standard commandsCustom build/test/typecheck commands
Critical overridesThings that MUST override defaults
Universal rulesApplies to 100% of tasks

NOT essential (move to linked files):

  • Language-specific conventions
  • Testing guidelines
  • Code style details
  • Framework patterns
  • Documentation standards
  • Git workflow details

Phase 3: Group the Rest

Organize remaining instructions into logical categories.

Common categories:

CategoryContents
typescript.mdTS conventions, type patterns, strict mode rules
testing.mdTest frameworks, coverage, mocking patterns
code-style.mdFormatting, naming, comments, structure
git-workflow.mdCommits, branches, PRs, reviews
architecture.mdPatterns, folder structure, dependencies
api-design.mdREST/GraphQL conventions, error handling
security.mdAuth patterns, input validation, secrets
performance.mdOptimization rules, caching, lazy loading

Grouping rules:

  1. Each file should be self-contained for its topic
  2. Aim for 3-8 files (not too granular, not too broad)
  3. Name files clearly: {topic}.md
  4. Include only actionable instructions

Show full SKILL.md (188 more words)Show less
Phase 4: Create the File Structure

Output structure:

project-root/
├── CLAUDE.md (or AGENTS.md)     # Minimal root with links
└── .claude/                      # Or docs/agent-instructions/
    ├── typescript.md
    ├── testing.md
    ├── code-style.md
    ├── git-workflow.md
    └── architecture.md

Root file template:

markdown
# Project Name

One-sentence description of the project.

## Quick Reference

- **Package Manager:** pnpm
- **Build:** `pnpm build`
- **Test:** `pnpm test`
- **Typecheck:** `pnpm typecheck`

## Detailed Instructions

For specific guidelines, see:
- [TypeScript Conventions](.claude/typescript.md)
- [Testing Guidelines](.claude/testing.md)
- [Code Style](.claude/code-style.md)
- [Git Workflow](.claude/git-workflow.md)
- [Architecture Patterns](.claude/architecture.md)

Each linked file template:

markdown
# {Topic} Guidelines

## Overview
Brief context for when these guidelines apply.

## Rules

### Rule Category 1
- Specific, actionable instruction
- Another specific instruction

### Rule Category 2
- Specific, actionable instruction

## Examples

### Good
\`\`\`typescript
// Example of correct pattern
\`\`\`

### Avoid
\`\`\`typescript
// Example of what not to do
\`\`\`

Phase 5: Flag for Deletion

Identify instructions that should be removed entirely.

Delete if:

CriterionExampleWhy Delete
Redundant"Use TypeScript" (in a .ts project)Agent already knows
Too vague"Write clean code"Not actionable
Overly obvious"Don't introduce bugs"Wastes context
Default behavior"Use descriptive variable names"Standard practice
OutdatedReferences deprecated APIsNo longer applies

Output format:

markdown
## Flagged for Deletion

| Instruction | Reason |
|-------------|--------|
| "Write clean, maintainable code" | Too vague to be actionable |
| "Use TypeScript" | Redundant - project is already TS |
| "Don't commit secrets" | Agent already knows this |
| "Follow best practices" | Meaningless without specifics |

Execution Checklist

[ ] Phase 1: All contradictions identified and resolved
[ ] Phase 2: Root file contains ONLY essentials
[ ] Phase 3: All remaining instructions categorized
[ ] Phase 4: File structure created with proper links
[ ] Phase 5: Redundant/vague instructions removed
[ ] Verify: Each linked file is self-contained
[ ] Verify: Root file is under 50 lines
[ ] Verify: All links work correctly

Anti-Patterns

AvoidWhyInstead
Keeping everything in rootBloated, hard to maintainSplit into linked files
Too many categoriesFragmentationConsolidate related topics
Vague instructionsWastes tokens, no valueBe specific or delete
Duplicating defaultsAgent already knowsOnly override when needed
Deep nestingHard to navigateFlat structure with links

Examples

Before (Bloated Root)
markdown
# CLAUDE.md

This is a React project.

## Code Style
- Use 2 spaces
- Use semicolons
- Prefer const over let
- Use arrow functions
... (200 more lines)

## Testing
- Use Jest
- Coverage > 80%
... (100 more lines)

## TypeScript
- Enable strict mode
... (150 more lines)
After (Progressive Disclosure)
markdown
# CLAUDE.md

React dashboard for real-time analytics visualization.

## Commands
- `pnpm dev` - Start development server
- `pnpm test` - Run tests with coverage
- `pnpm build` - Production build

## Guidelines
- [Code Style](.claude/code-style.md)
- [Testing](.claude/testing.md)
- [TypeScript](.claude/typescript.md)

Verification

After refactoring, verify:

  1. Root file is minimal - Under 50 lines, only universal info
  2. Links work - All referenced files exist
  3. No contradictions - Instructions are consistent
  4. Actionable content - Every instruction is specific
  5. Complete coverage - No instructions were lost (unless flagged for deletion)
  6. Self-contained files - Each linked file stands alone

© meshery, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .claude/skills/agent-md-refactor of meshery/meshery-operator.

  • SKILL.md
  • README.md

Open the folder on GitHubat commit 632cd41

Used in 5 other repositories

We found 5 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 5 other GitHub owners. This page covers the copy in meshery/meshery-operator, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Agent Md Refactor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agent Md Refactor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agent Md Refactor this skillmeshery/meshery-operator1515 repos~1.9kAutomated safety check: PassMIT
Docslatitude-dev/latitude-llm4.7k—~2.5kAutomated safety check: PassMIT
Agent Md Refactormicronaut-projects/micronaut-openapi114—~766Automated safety check: PassApache-2.0
Steadyagent WorkflowKhalilzhang0825/boring-is-all-you-need173—~1kAutomated safety check: PassMIT
Reclaudebrianlovin/agent-config3761 repos~981Automated safety check: PassNone
Agents Md MapperalchemiststudiosDOTai/harness-engineering105—~1.8kAutomated safety check: PassMIT

Similar skills

  • Docs

    latitude-dev/latitude-llm

    Review the current conversation context and git changes, then persist durable repository knowledge into dev-docs/.md by domain and into AGENTS.md for cross-cutting repo rules.

    4.7k GitHub stars~2.5k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Agent Md Refactor

    micronaut-projects/micronaut-openapi

    Refactor oversized agent instruction files into a progressive-disclosure structure.

    114 GitHub stars~766 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Steadyagent Workflow

    Khalilzhang0825/boring-is-all-you-need

    Local-first Codex workflow for planning, debugging, reviewing, refactoring, improving AGENTS.md, building skills, publishing agent harness repositories, or running complex multi-step coding tasks…

    173 GitHub stars~1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Reclaude

    brianlovin/agent-config

    Refactor CLAUDE.md files to follow progressive disclosure principles.

    376 GitHub starsUsed in 1 repo~981 tokens
    Agent WorkflowsAuto-check passed
  • Agents Md Mapper

    alchemiststudiosDOTai/harness-engineering

    This skill should be used when creating, refreshing, or validating a repository AGENTS.md so it stays concise, current, and grounded in repository evidence.

    105 GitHub stars~1.8k tokensUpdated 6 mo ago
    Agent WorkflowsAuto-check passed
  • Update Docs

    peterkrueck/Claude-Code-Development-Kit

    Update project documentation after code changes. An agent skill from peterkrueck/Claude-Code-Development-Kit.

    1.4k GitHub stars~2.7k tokensUpdated 2 mo ago
    Agent WorkflowsAuto-check passed

More from meshery/meshery-operator

All 8 skills in this repo
  • Iterate PR

    meshery/meshery-operator

    Iterate on a PR until CI passes. An agent skill from meshery/meshery-operator.

    151 GitHub starsUsed in 8 repos~2.2k tokens
    Auto-check passed
  • QA Test Planner

    meshery/meshery-operator

    Generate comprehensive test plans, manual test cases, regression test suites, and bug reports for QA engineers.

    151 GitHub starsUsed in 5 repos~4.6k tokens
    Auto-check passed
  • Command Creator

    meshery/meshery-operator

    This skill should be used when creating a Claude Code slash command.

    151 GitHub starsUsed in 4 repos~1.7k tokens
    Auto-check passed
  • Gepetto

    meshery/meshery-operator

    Creates detailed, sectionized implementation plans through research, stakeholder interviews, and multi-LLM review.

    151 GitHub starsUsed in 4 repos~2.7k tokens
    Auto-check passed
  • Database Schema Designer

    meshery/meshery-operator

    Design robust, scalable database schemas for SQL and NoSQL databases.

    151 GitHub starsUsed in 3 repos~4.4k tokens
    Auto-check passed
  • Reducing Entropy

    meshery/meshery-operator

    Manual-only skill for minimizing total codebase size. An agent skill from meshery/meshery-operator.

    151 GitHub starsUsed in 3 repos~640 tokens
    Auto-check passed

Works with

Categories

Questions about Agent Md Refactor

What does Agent Md Refactor do?

Refactor bloated AGENTS.md, CLAUDE.md, or similar agent instruction files to follow progressive disclosure principles. Agent Md Refactor is an agent skill from meshery/meshery-operator.md, or similar agent instruction files to follow progressive disclosure principles.

When should I use Agent Md Refactor?

Agent Md Refactor fits situations like: tasks that involve Agent instruction files; tasks that involve Refactoring.

How do I install Agent Md Refactor in Claude Code?

Run `npx skills add meshery/meshery-operator --skill agent-md-refactor -a claude-code`. Or copy the skill folder (.claude/skills/agent-md-refactor in meshery/meshery-operator) into .claude/skills/agent-md-refactor in your project. Claude Code loads it when a task matches its description.

How do I install Agent Md Refactor in Codex?

Run `npx skills add meshery/meshery-operator --skill agent-md-refactor -a codex`. Or copy the skill folder (.claude/skills/agent-md-refactor in meshery/meshery-operator) into .agents/skills/agent-md-refactor in your project. Codex loads it when a task matches its description.

Can I use Agent Md Refactor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add meshery/meshery-operator --skill agent-md-refactor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agent-md-refactor, .gemini/skills/agent-md-refactor, .github/skills/agent-md-refactor and .opencode/skills/agent-md-refactor in your project.

What does Agent Md Refactor need to run?

SKILL.md names no scripts, command-line tools or credentials: Agent Md Refactor is instructions for the agent only.

Does Agent Md Refactor access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Agent Md Refactor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agent Md Refactor use?

Agent Md Refactor is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agent Md Refactor use?

About 1.9k tokens (SKILL.md is roughly 7.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agent Md Refactor?

Skills that share tags, products or a category with Agent Md Refactor: Docs (latitude-dev/latitude-llm, 4.7k stars), Agent Md Refactor (micronaut-projects/micronaut-openapi, 114 stars), Steadyagent Workflow (Khalilzhang0825/boring-is-all-you-need, 173 stars) and Reclaude (brianlovin/agent-config, 376 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agent Md Refactor?

meshery (a GitHub organization) maintains it in meshery/meshery-operator, which has 151 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 21, 2026.

Source: meshery/meshery-operator on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.