Agent skill
intent-layer
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.
Install this agent skill to your Project
npx add-skill https://github.com/crafter-station/skills/tree/main/context-engineering/intent-layer
SKILL.md
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:
- What does this area own? What's out of scope?
- What invariants must never be violated?
- What repeatedly confuses new engineers?
- 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 boundariesscripts/estimate_tokens.sh- Measure directory complexity
References:
references/templates.md- Root and child node templatesreferences/node-examples.md- Real-world examplesreferences/capture-protocol.md- SME interview protocol
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
skill-gen
Auto-generate Claude skills from documentation URLs using Firecrawl agent. Use when user wants to create a skill from docs, API references, or tool homepages. Asks up to 3 clarifying questions before deep extraction. Supports topic focus (e.g., "only auth endpoints") and outputs to local .claude/skills/ by default.
skillkit
Local-first analytics for AI agent skills. Use when user asks about skill usage, analytics, health, context budget, cost/burn rate, trigger conflicts, dead weight analysis, or wants to clean up unused skills.
spoti-cli
Create Spotify playlists using spoti-cli CLI. Use when: (1) user wants a playlist, (2) user says "playlist", "spotify", "music for", "songs for", (3) user describes a mood or activity implying music ("deep work", "chill", "workout"), (4) user asks for music based on their day/vault/logs. Supports vault-aware playlist generation by reading Obsidian daily logs to infer mood and context.
setup-pre-commit
Set up Husky pre-commit hooks with lint-staged (Prettier), type checking, and tests in the current repo. Use when user wants to add pre-commit hooks, set up Husky, configure lint-staged, or add commit-time formatting/typechecking/testing.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?