agent-md-refactor

agent-md-refactor is a skill for Claude Code, Codex from bartstc/vite-ts-react-template. It costs 40 tokens per session (1,830 once invoked), scanned A, a copy of agent-md-refactor, MIT.

A workflow for reorganizing long instruction files used by coding agents, such as AGENTS.md or CLAUDE.md. It keeps essential rules in the main file and moves detailed guidance into linked documents.

In plain words
What is it for?
Use it to review instruction files, resolve contradictions, group related guidance, create a clearer file structure, and flag content that can be removed.
Why use it?
It makes agent instructions easier to find and maintain when one file has become too large. It also helps identify conflicting, vague, or repeated rules.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/bartstc/vite-ts-react-template/agent-md-refactor
Any agent
npx skills add bartstc/vite-ts-react-template --skill agent-md-refactor
Clone the repo
git clone --depth 1 https://github.com/bartstc/vite-ts-react-template

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-md-refactor

README.md
[![agentmods](https://agentmods.dev/badge/skills/bartstc/vite-ts-react-template/agent-md-refactor.svg)](https://agentmods.dev/skills/bartstc/vite-ts-react-template/agent-md-refactor)
Your own site
<a href="https://agentmods.dev/skills/bartstc/vite-ts-react-template/agent-md-refactor"><img src="https://agentmods.dev/badge/skills/bartstc/vite-ts-react-template/agent-md-refactor.svg" alt="Measured on agentmods" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,830 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01830
Opus 5 $0.00020 $0.00915
Sonnet 5 $0.00008 $0.00366
Haiku 4.5 $0.00004 $0.00183

Measured 4d ago against content hash 29163f7e8d27, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agent-md-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to agent-md-refactor — 68 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.agents/skills/agent-md-refactor/SKILL.md · 310 lines

How it starts

The opening of the file, as written. The whole thing — 310 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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

Phase Action Output
1. Analyze Find contradictions List of conflicts to resolve
2. Extract Identify essentials Core instructions for root file
3. Categorize Group remaining instructions Logical categories
4. Structure Create file hierarchy Root + linked files
5. Prune Flag for deletion Redundant/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:

## 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):

Category Example
Project description One sentence: "A React dashboard for analytics"
Package manager Only if not npm (e.g., "Uses pnpm")
Non-standard commands Custom build/test/typecheck commands
Critical overrides Things that MUST override defaults
Universal rules Applies to 100% of tasks

Read the full file on GitHub · 310 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 310 lines · 40 tokens per session scan A 29163f7e8d27

Subscribe to this mod's changes

agent-md-refactor is a skill published in the GitHub repository bartstc/vite-ts-react-template (121 stars, last pushed 1mo ago), licensed MIT. It adds 40 tokens to every session and 1,830 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to agent-md-refactor, differing in 68 lines, and is treated as a copy.

Related

Other skills, from other repositories

webflow-to-react

Converts a Webflow HTML export into a maintainable React app with TanStack Start (SSR, TanStack Router conventions) using an idiomatic React-first approach. Sets up Storybook early, builds UI primitive + page-section SOT components with variant stories before composing routes. Use when the user has a Webflow export…

dmenchaca/webflow-to-react · 258 tokens

reskin

Author a NEW skin for the reskinnable-demo app. A skin is a self-contained domain plugin under src/skins/ / that implements the frozen Skin contract (src/shell/skin-contract.ts) to swap the app's entire experience — brand, theme, layout, pages, tools, data, and agent — as a live sales demo. Use when the user says "add…

CopilotKit/CopilotKit · 154 tokens

setup-slack-channel

Use for the PROVIDER half of getting a locally running CopilotKit Channels agent to answer in Slack, when no Slack app exists yet — setting up a Channels bot in Slack for the first time, creating the Slack app and its tokens, attaching it to a managed Intelligence Channel, or when a Channel reports setuprequired, sits…

CopilotKit/CopilotKit · 206 tokens

copilotkit-channels

Use for the CODE half of a managed Intelligence Channel with Slack or Microsoft Teams: customising the Channel a CLI-scaffolded project already ships, or — for a project the CLI did not generate — writing the Channel declaration, the long-running host, and the awaited activation call. Teams provider setup is in scope…

CopilotKit/CopilotKit · 112 tokens

runtime

@copilotkit/runtime — mount a fetch-native CopilotRuntime on any JS server, wire middleware, pick an AgentRunner, instantiate BuiltInAgent (Factory Mode with TanStack AI is the preferred default) or plug in any of 12 external agent frameworks (Mastra, LangGraph, CrewAI Crews/Flows, PydanticAI, ADK, LlamaIndex, Agno…

CopilotKit/CopilotKit · 150 tokens

copilotkit-integrations

Use when wiring an external agent framework (LangGraph, CrewAI, PydanticAI, Mastra, ADK, LlamaIndex, Agno, Strands, Microsoft Agent Framework, or others) into a CopilotKit application via the AG-UI protocol.

CopilotKit/CopilotKit · 61 tokens