setup-structure-index — Prompt Excerpts
Excerpt 1: Skill Description (YAML frontmatter from SKILL.md)
Technique: Trigger phrase enumeration in description field
---
name: setup-structure-index
description: This skill should be used when the user asks to "set up structure index", "add codebase structure tracking", "create structure files", "set up code structure YAML", or needs to set up the codebase structure index system in a project. It creates a two-tier structure index (compact file map in CLAUDE.md + detailed YAML files) and configures a TaskCompleted hook to enforce updates.
---
Analysis: The description contains a list of exact trigger phrases in quotes, making skill invocation predictable. The description also tells Claude what the skill creates (two artifacts + hook), which sets expectations for the setup steps.
Excerpt 2: Token Economics Rationale (from SKILL.md)
Technique: Quantified cost comparison to justify two-tier design
## Why Two Tiers?
Most of the exploration savings come from knowing *where things are*, not their exact method signatures. A compact file map (~100-200 lines) embedded in CLAUDE.md captures ~70% of the navigation value at zero extra token cost (CLAUDE.md is already loaded into the system prompt). Detailed YAML files with full signatures are only needed when working in an unfamiliar area of the codebase.
**Token economics of the old single-tier approach:**
- Reading a full structure YAML (~1000-2000 lines per module) every session
- Most sessions only touch 1-2 directories, wasting tokens on irrelevant detail
**Token economics of the two-tier approach:**
- Tier 1 (file map in CLAUDE.md): 0 extra tokens (already in system prompt)
- Tier 2 (detailed YAML): read only when needed, split by directory for targeted reads
- Net result: most sessions read 0 extra lines; deep exploration reads ~100-300 lines
Analysis: Quantified token counts (1000-2000 vs 100-300 vs 0) justify the two-tier design. The rationale is included in the skill itself to ensure the agent understands the design intent when setting up the system.
Excerpt 3: Hook Filtering Logic (from SKILL.md)
Technique: Conditional hook trigger with explicit scope definition
### TaskCompleted Hook
A hook that evaluates whether a completed task added, removed, or renamed files/classes. Only triggers updates for structural changes, not every code edit.
The hook evaluation question: "Did this task add, remove, or rename any source files, public classes, or public functions?"
- YES → block completion, update CLAUDE.md file map and relevant structure YAML
- NO → pass through, no update needed
Analysis: The hook's filtering logic is expressed as a binary decision tree, not vague guidance. "Added, removed, or renamed" is the precise trigger condition. "Bug fixes and implementation changes" are explicitly excluded. This prevents hook fatigue from too-frequent triggers.