简介
Refactors bloated agent instruction files into an organized, multi-file structure using progressive disclosure principles.
通过你的 Agent 添加
安装目录:agent-md-refactor/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
name: agent-md-refactor
description: Refactor oversized agent instruction files into a progressive-disclosure structure. Use when users ask to split AGENTS.md/CLAUDE.md/COPILOT.md, reduce instruction bloat, or organize guidance into linked topic files.
license: Apache-2.0
compatibility: Repositories using markdown instruction files such as AGENTS.md, CLAUDE.md, or COPILOT.md
metadata:
author: Álvaro Sánchez-Mariscal
version: "1.0.0"
Agent MD Refactor
Refactor monolithic instruction files into a compact root file plus linked topic files. Keep this file focused on execution flow and load detailed templates/examples from references.
Goal
Deliver a maintainable instruction system with:
- a minimal root instruction file containing only universal guidance,
- linked topic files for detailed rules,
- contradictions resolved and vague/redundant rules removed.
Trigger Examples
Should trigger:
- "Refactor this AGENTS.md to use progressive disclosure."
- "Split my CLAUDE.md into focused instruction files."
- "My instruction file is too long, reorganize it."
Should not trigger:
- "Explain what AGENTS.md is."
- "Fix one typo in CLAUDE.md."
- "Write a brand-new coding standard from scratch."
More examples: examples-and-anti-patterns.
Procedure
- Inventory instruction sources (
AGENTS.md, CLAUDE.md, COPILOT.md, related guidance docs).
- Detect contradictions and resolve by repository precedence.
- Keep only root-level essentials in the root instruction file.
- Group remaining content into 3-8 linked topic files with clear names.
- Remove non-actionable, redundant, and outdated directives.
- Validate links, coverage, and consistency before completion.
AGENTS.md, CLAUDE.md, COPILOT.md, related guidance docs).Detailed step playbook: refactor-playbook.
Inputs
- Root instruction file path(s)
- Existing repository conventions (commands, toolchain, style)
- User constraints (must-keep rules, preferred layout)
Outputs
- Refactored root instruction file (minimal, universal guidance)
- Topic files with detailed rules
- List of removed/merged rules with rationale
- Notes on contradiction handling
Edge Cases
- If rule precedence is impossible to infer, request one targeted user decision.
- If multiple files repeat the same rule, keep one canonical source and replace others with links.
- If the instruction file is already concise, avoid unnecessary splitting.
- Use relative markdown links for portability.
Validation Checklist
- Frontmatter is valid YAML and
name matches directory.
- Description states capability and usage triggers.
- Root file contains only universal instructions.
- Topic files are self-contained and linked from root.
- Contradictions are resolved or explicitly called out.
- Vague/default/redundant directives are removed or rewritten.
- Relative links resolve.
References
- Refactored root instruction file (minimal, universal guidance)
- Topic files with detailed rules
- List of removed/merged rules with rationale
- Notes on contradiction handling
Edge Cases
- If rule precedence is impossible to infer, request one targeted user decision.
- If multiple files repeat the same rule, keep one canonical source and replace others with links.
- If the instruction file is already concise, avoid unnecessary splitting.
- Use relative markdown links for portability.
Validation Checklist
- Frontmatter is valid YAML and
name matches directory.
- Description states capability and usage triggers.
- Root file contains only universal instructions.
- Topic files are self-contained and linked from root.
- Contradictions are resolved or explicitly called out.
- Vague/default/redundant directives are removed or rewritten.
- Relative links resolve.
References
- Frontmatter is valid YAML and
namematches directory. - Description states capability and usage triggers.
- Root file contains only universal instructions.
- Topic files are self-contained and linked from root.
- Contradictions are resolved or explicitly called out.
- Vague/default/redundant directives are removed or rewritten.
- Relative links resolve.
References
原始仓库
作者的项目地址:https://github.com/micronaut-projects/micronaut-core