intent-layer — скилл для Claude Code: иерархия AGENTS.md в проекте
Раскладывает контекст по папкам: корневой AGENTS.md плюс дочерние узлы, чтобы агент понимал код как старший инженер.
npx skills add crafter-station/skills --skill intent-layer -a claude-codeЧто делает intent-layer
Скилл собирает иерархическую структуру файлов AGENTS.md. Корневой файл один, в подкаталогах со сложной логикой появляются дочерние узлы. CLAUDE.md и AGENTS.md в корне не должны сосуществовать — это главный принцип, и на нём чаще всего спотыкаются те, у кого уже лежит CLAUDE.md.
Работа идёт по шагам. Сначала scripts/detect_state.sh показывает состояние: none, partial или complete. Дальше scripts/analyze_structure.sh ищет смысловые границы, а scripts/estimate_tokens.sh меряет сложность каталогов. Узел заводят, когда в папке больше 20k токенов или меняется зона ответственности. Для тестовых папок и простых утилит — не надо.
Шаблоны структуры лежат в references/templates.md, примеры — в references/node-examples.md, вопросы для разговора с автором кода — в references/capture-protocol.md. Каждый узел держат короче 4k токенов и ставят директиву READ-FIRST. Когда состояние complete, скилл переходит в режим поддержки: аудит узлов, поиск новых кандидатов или и то и другое.
Какие задачи решает
- разложить контекст проекта по папкам вместо одного длинного файла
- научить агента различать зоны ответственности подсистем
- зафиксировать инварианты, которые нельзя нарушать
- найти каталоги, где пора завести отдельный AGENTS.md
- провести аудит уже существующих узлов контекста
Примеры запросов агенту
- настрой intent layer в этом проекте
- добавь AGENTS.md для папки src/payments
- проверь состояние intent layer и предложи новые узлы
Как установить intent-layer
1Через Skills CLI (Vercel)
npx skills add crafter-station/skills --skill intent-layer -a claude-code2Вручную: положить файлы
~/.claude/skills/intent-layer/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/intent-layer/
1Через Skills CLI (Vercel)
npx skills add crafter-station/skills --skill intent-layer -a codex2Вручную: положить файлы
.agents/skills/intent-layer/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add crafter-station/skills --skill intent-layer -a cursor2Вручную: положить файлы
.cursor/skills/intent-layer/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install crafter-station/skills intent-layer2Вручную: положить файлы
.github/skills/intent-layer/SKILL.md1Через Skills CLI (Vercel)
npx skills add crafter-station/skills --skill intent-layer -a gemini-cli2Командой платформы
gemini skills install https://github.com/crafter-station/skills --path skills/intent-layerВручную: положить файлы
.devin/skills/intent-layer/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add crafter-station/skills --skill intent-layer -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Похожие
Рядом в теме «Настройка агента: память, контекст, субагенты»
Все скиллы по теме «Настройка агента: память, контекст, субагенты» →Вопросы о intent-layer
Как установить intent-layer в Claude?
Выполните npx skills add crafter-station/skills --skill intent-layer -a claude-code. После этого файл скилла окажется по пути ~/.claude/skills/intent-layer/SKILL.md.
Что делает intent-layer?
Строит иерархию AGENTS.md: один корневой файл и дочерние узлы в подкаталогах. Плюс умеет проверять уже готовую структуру и предлагать новые узлы.
Можно ли держать CLAUDE.md и AGENTS.md в корне одновременно?
Нет. Корневой контекстный файл должен быть один, иначе агент получает два источника правды. Дочерние AGENTS.md в подкаталогах при этом приветствуются.
Исходный текст
SKILL.md · MIT
--- name: intent-layer version: 1.0.0 description: > Set up hierarchical Intent Layer (AGENTS.md files) for codebases. Use when initializing a new project, adding context infrastructure to an existing repo, user asks to set up AGENTS.md, add intent layer, make agents understand the codebase, or scaffolding AI-friendly project documentation. --- # Intent Layer Hierarchical AGENTS.md infrastructure so agents navigate codebases like senior engineers. ## Core Principle **Only ONE root context file.** CLAUDE.md and AGENTS.md should NOT coexist at project root. Child AGENTS.md in subdirectories are encouraged for complex subsystems. ## Workflow ``` 1. Detect state scripts/detect_state.sh /path/to/project → Returns: none | partial | complete 2. Route none/partial → Initial setup (steps 3-5) complete → Maintenance (step 6) 3. Measure [gate - show table first] scripts/analyze_structure.sh /path/to/project scripts/estimate_tokens.sh /path/to/each/source/dir 4. Decide No root file → Ask: CLAUDE.md or AGENTS.md? Has root file → Add Intent Layer section + child nodes if needed 5. Execute Use references/templates.md for structure Use references/node-examples.md for real-world patterns Validate: one root, READ-FIRST directive, <4k tokens per node 6. Maintenance mode (when state=complete) Ask user: a) Audit nodes → Use references/capture-protocol.md for SME questions b) Find candidates → Re-measure tokens, suggest new nodes c) Both ``` ## When to Create Child Nodes | Signal | Action | |--------|--------| | >20k tokens in directory | Create AGENTS.md | | Responsibility shift | Create AGENTS.md | | Hidden contracts/invariants | Document in nearest ancestor | | Cross-cutting concern | Place at LCA | Do NOT create for: every directory, simple utilities, test folders (unless complex). ## Capture Questions When documenting existing code, ask: 1. What does this area own? What's out of scope? 2. What invariants must never be violated? 3. What repeatedly confuses new engineers? 4. What patterns should always be followed? ## Resources **Scripts:** - `scripts/detect_state.sh` - Check Intent Layer state (none/partial/complete) - `scripts/analyze_structure.sh` - Find semantic boundaries - `scripts/estimate_tokens.sh` - Measure directory complexity **References:** - `references/templates.md` - Root and child node templates - `references/node-examples.md` - Real-world examples - `references/capture-protocol.md` - SME interview protocol
© crafter-station · MIT · crafter-station/skills