skills/spec/SKILL.md
Research a codebase and produce a target-state spec and implementation plan — what to build and how. Two approval gates: spec (what) then plan (how). Triggers: 'spec', 'specify', 'define the target', 'what are we building', 'write a spec', 'plan'. Use for both greenfield features and bug investigations.
npx skillsauth add luan/dot-claude specInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Research a codebase and produce a target-state spec (what to build) and an implementation plan (how to build it). Two approval gates — the user approves the spec before seeing the plan. The plan becomes the contract /develop consumes.
Subagents do all codebase exploration. The main thread synthesizes, validates, and presents.
<topic> — what to spec (required unless --continue)--auto — skip both approval gates. Return the plan file path silently.--continue — resume from existing spec or plan file--spec-only — stop after spec approval, don't generate a plan--depth medium|high|max — controls research and plan granularity (default: medium)
Dispatch Agent (subagent_type="Explore"):
Research <topic>. Return findings as text.
## Output
1. **Current Behavior**: what the system does today, where it falls short, and why
2. **Component Boundaries**: modules/layers involved, their contracts, how they interact
3. **Constraints**: what's load-bearing, what must not break, external interfaces
4. **Design Space**: viable approaches with tradeoffs — name at least two, recommend one with rationale
Warm-start: When the prompt contains prior research (from brainstorm or previous spec), include it and say: "Prior research provided below. Validate and fill gaps — focus on what's new."
Complex domains (3+ subsystems or 3+ viable approaches): Dispatch 3 parallel Explore agents — Researcher (breadth), Architect (approach), Skeptic (risks). Synthesize the architect's approach with the skeptic's contradictions.
Spot-check architectural claims — wrong understanding invalidates the spec. Check every odd-numbered claim (1st, 3rd, 5th...), minimum 3. Each check: Grep or Read a few lines. Failed check → follow-up subagent to correct.
Production data correlation (when upstream context includes logs, error traces, database state): list each concrete observation, state which hypothesis explains it, flag observations that multiple hypotheses explain equally. An unvalidated hypothesis produces a wrong spec.
Build the spec from validated research. The spec defines the target state — the system as if already built, present tense throughout. A developer should understand the target system from the spec alone — without needing to read source code to resolve ambiguities about intent.
Sections:
Problem: What's broken or missing. The only section describing current state.
Recommendation: The system as-if-built — behavior, contracts, data flow. This is the heart of the spec and must be self-sufficient. Include:
For refactors, add a removal table mapping every current element to its disposition — deleted, renamed, absorbed into X. Every element accounted for.
File paths do not belong in the Recommendation. The spec defines what the system is, not where code lives. Implementation geography belongs in the plan.
Architecture Context: How components relate post-implementation. Use Mermaid diagrams to show relationships visually. Include a brief new/modified/deleted file list as a reference — the diagram carries the meaning, but the file list gives developers a geographic anchor. Keep prose minimal; the file list is cheap.
Risks: Each risk names a concrete failure scenario and a mitigation. Not vague categories — specific things that can go wrong and what prevents them.
Confidence gate (for bug investigations):
Quality gates (run in parallel before presenting):
Scaffold with blueprint_create, Edit the body, then blueprint_commit. Before committing, call vault_related on the topic — if matches, append a ## Related section with wiki-links.
If --auto → skip to Phase 2 silently.
Otherwise → present the spec: Problem, Recommendation, Architecture Context, Risks (+ confidence gate if bug investigation). Include devil's advocate challenges. Stop for user review.
If user gives feedback:
If --spec-only → after approval, output spec path and stop.
Generated from the approved spec + research findings. The plan is tactical and consumable — /develop auto-parses it into tasks.
From the approved spec and retained research, produce an execution plan. The plan is the contract /develop consumes — precise enough that an agent can execute each step without judgment calls about intent.
Plan structure:
Start with an execution model — a Mermaid graph showing phases and their dependencies. The shape of this graph should reflect the work's actual dependency structure, not a template. Most plans are sequential; parallelism is justified only when phases touch genuinely independent code with no shared state. Show agent allocation on each node when multiple tiers are used.
Think critically about agent allocation. Default to the strongest available agent — only delegate to faster/cheaper agents when the work is unambiguously mechanical (additive type definitions, dead code deletion, imports). If in doubt, use the stronger agent.
Add gates (build/test/review checkpoints) between phases when the next phase depends on correctness of the previous one. Gates are where an agent reviews the diff against the spec and flags deviations. Not every phase boundary needs a gate — use them at natural convergence points.
Per-phase details:
## Phase N: <title>
- **Agent**: <tier>, <execution mode>
- **Files**: Modify: <paths> | Create: <paths>
- **Approach**: what this phase accomplishes and why it's sequenced here
- **Steps**:
1. `<file path>` — <exact change: "add X with Y", "change A from B to C", "remove D">
2. ...
- **Dependencies**: Phase M (if any)
- **Verification**: <build/test> + <spec compliance checks for this phase>
Rules:
--depth high|max includes a spec compliance checklist — concrete requirements from the spec that this phase should satisfy.Same pattern as spec storage — scaffold with blueprint_create, Edit, commit. Pass the spec stem as source so the plan wiki-links back to it.
If --auto → return the plan file path silently.
Otherwise → present the plan phases. Stop for user review.
If user gives feedback:
Output:
Spec: <topic>
<one-line recommendation>
Spec file: <spec-path>
Plan file: <plan-path>
Phases: N
Next: /develop <plan-path> or /vibe
--continue)Check for an existing plan first (blueprint_latest with kind=plan). If found, blueprint_read it, re-present, resume from step 9.
Otherwise check for a spec (blueprint_latest with kind=spec). blueprint_read returns body and inline HTML comments together — if comments are non-empty, append them as ## Inline Comments to the re-presented spec (user review feedback to address during refinement). Resume from step 5.
tools
Tree-sitter indexed code navigator (ct sym CLI). Use INSTEAD OF Read/Grep/Glob/Bash when exploring existing code, understanding how something works, locating a symbol, tracing the call graph up (impact) or down (trace), finding implementations of an interface, scoping a diff to one symbol, or preparing to edit code you have not read yet. Triggers: 'how does X work', 'explain this class/file/symbol', 'walk me through X', 'what does X do', 'where is X defined', 'who calls X', 'what does X call', 'find implementations of', 'what breaks if I change X', 'outline this file', 'map imports', 'show me this symbol', exploring unfamiliar repo, tracing call graph, scoping diff to a symbol, preparing to edit code I haven't read, about to Read a file over ~500 lines to understand it. Do NOT use for: writing new code from scratch, editing prose or config, running tests, or when a stack trace already names the file and line.
development
Fully autonomous development workflow from prompt to commit. Chains spec → develop → review → commit. Triggers: /vibe, 'vibe this', 'autonomous workflow', 'just do it all', 'build this end-to-end', 'full pipeline', 'handle everything'.
development
Comprehensive vault maintenance — cross-references blueprints against codebase state to produce a maintenance plan: archive consumed artifacts, audit docs for staleness, propose new docs for undocumented stable systems. Triggers: 'vault sweep', 'sweep the vault', 'clean up vault', 'vault maintenance', 'what can we archive', 'audit blueprints', 'vault hygiene', 'blueprint cleanup'. Use whenever the user wants a holistic view of vault health rather than archiving a single artifact (that's /archive). Also use when the user asks what's stale, what needs docs, or whether artifacts can be cleaned up.
development
Analyze current diff, classify changes by risk, and produce structured manual test plan. Triggers: 'test plan', 'what should I test', 'manual testing', 'verification steps', 'QA checklist'. Exits early for trivial changes. Do NOT use when: writing automated tests — use /develop with TDD. Do NOT use when: reviewing code quality — use /crit instead.