adaptive-docs-extract
БесплатноБез исполняемых скриптовНе проверенUse when the user says 'extract docs', 'split AGENTS.md', 'split CLAUDE.md', 'refactor the docs', 'slim AGENTS.md', or has sprawling root instructions to…
от divad12★ 26 звёзд на GitHubОб этом скилле
Adaptive Docs - Extract
Refactor an existing project's AGENTS.md (and/or CLAUDE.md) into the three-layer adaptive docs system: slim root + on-demand docs/ai/ references + auto-activating skills + nested AGENTS.md guardrails.
This is a consultant skill - it doesn't blindly extract. It interviews the user about which topics deserve their own file, which directories warrant guardrails, and which need skill triggers.
AGENTS.md is treated as the primary root file (agent-agnostic universal standard). CLAUDE.md, if it exists, is for Claude Code-specific additions only.
Prerequisites
Run /adaptive-docs-init first if the structure isn't in place:
test -d docs/ai && test -L .claude/skills && test -f docs/ai/writing-docs.md
If any of those is missing, run init before proceeding.
Steps
1. Read the current root files
Read whichever exist at the project root:
AGENTS.md(primary)CLAUDE.md(may be legacy from pre-agent-agnostic setup, or may contain Claude-specific content)
Note their length and structure. If they both exist with near-identical content, flag this as a consolidation opportunity: the universal rules belong in AGENTS.md, and CLAUDE.md should either be deleted (if no Claude-specific content remains) or slimmed to just the Claude-specific parts.
If the root files are under ~100 lines each and well-organized, tell the user there may not be much to extract. Confirm before proceeding.
2. Identify candidate topics
Read through the root file(s) and group content into topics. A topic is a coherent area where 3+ paragraphs (or one substantial section) cluster around a single concern. Common candidates:
| Topic | Often worth extracting if... |
|---|---|
| Testing | There are TDD rules, framework choice, test patterns, fixtures |
| API patterns | There are auth patterns, route handler conventions, error handling |
| Data model | There's schema info, relationships, validation rules |
| Forms / dialogs | There are form-specific conventions or UX rules |
| UI components | There are visual standards, design system rules, component patterns |
| State management | There are caching, optimistic update, or sync patterns |
| Git workflow | There are branch/rebase/PR conventions |
| Domain glossary | There's product-specific terminology that recurs |
| Build / deploy | There are deployment-specific rules or environment notes |
| Code review | There are review-specific checklists or rules |
For each potential topic, decide:
- Extract - clearly its own area, gets read often when working on relevant tasks
- Keep in root - universal, applies to ANY task (e.g. "never use em dashes", "comment the why not the what")
- Drop - stale, redundant, or covered by linters
3. Confirm the extraction plan with the user
Present the plan using the AskUserQuestion tool. For each candidate, ask:
"I see content about {{topic}}. Should this become
docs/ai/{{filename}}.md?"
Options:
- "Yes, extract it"
- "No, keep in root"
- "No, drop it (stale/redundant)"
For larger refactors, batch related questions into a single AskUserQuestion call.
Also ask:
- "What's the project name?" (only if you can't infer it)
- Tech stack details if not already obvious
4. For each approved extraction
For each topic the user approves:
Create
docs/ai/{{topic}}.mdwith the banner header at the top:> **IMPORTANT: Before reading, check if you already read this file earlier in this session. If yes, skip the read and announce "Context already loaded: {{topic}}.md (re-using from earlier)". If no, read it and announce "Context loaded: {{topic}}.md".** # {{Topic Title}} {{extracted content here}}Remove the extracted content from the root files (AGENTS.md and CLAUDE.md if duplicated).
Add a row to the reference table in
AGENTS.md(andCLAUDE.mdif it has its own table):| Working on... | Read | | {{when this applies}} | `docs/ai/{{topic}}.md` |Update the file tables in
docs/ai/README.mdanddocs/ai/writing-docs.md.
5. Propose skills (optional per topic)
For each new doc, ask: "Should this auto-activate via a skill?"
A skill makes sense when:
- The topic has clear file/directory triggers (e.g. "anything in
src/components/") - The topic has user-facing action triggers (e.g. "writing tests", "creating a form")
- Forgetting to read the doc is a recurring problem
A skill doesn't make sense when:
- The topic is rarely needed
- The reference table entry is already enough
For each approved skill, copy ~/.claude/templates/adaptive-docs/skill-template/SKILL.md.template to .agents/skills/{{skill-name}}/SKILL.md. Replace placeholders:
{{SKILL_NAME}}→ kebab-case name{{DESCRIPTION}}→ a description rich in trigger keywords (file paths, action verbs, library names). The description IS the activation - write it well.- `{{S
Установить adaptive-docs-extract в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл adaptive-docs-extract?
Use when the user says 'extract docs', 'split AGENTS.md', 'split CLAUDE.md', 'refactor the docs', 'slim AGENTS.md', or has sprawling root instructions to break up.
Как установить скилл adaptive-docs-extract?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adaptive-docs-extract запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic