execute-spec
Execute an implementation spec generated by ideation. Invokes Scout for codebase exploration, builds components with feedback loops, then runs a Verify-Review-Fix cycle with the Reviewer agent before committing.
What this skill does
# Execute Ideation Specification
## Arguments: $ARGUMENTS
Execute a spec file generated by the ideation skill.
**Parse arguments:**
- `--parallel` flag: Enable parallel execution via subagents
- `--headless` flag: Auto-proceed through all confirmation steps (no `AskUserQuestion` calls). Used by `/ideation:autopilot` to run phases without blocking. In headless mode: scout HOLD → proceed anyway, review cycle 3 FAIL → report failure and stop (do not commit), spec selection → pick first unblocked.
- Remaining argument: Spec file path (optional)
Example: `/ideation:execute-spec --parallel` or `/ideation:execute-spec --headless docs/ideation/foo/spec-phase-1.md`
## Pre-Execution
### 1. Load Specification
**If argument provided:** Read the spec file directly.
**If no argument:** Auto-detect from task list:
1. Run `TaskList` to find existing phase tasks
2. Look for tasks with:
- `status: pending` (not started)
- Empty `blockedBy` (dependencies completed)
- Subject starting with "Phase" or metadata containing `specFile`
3. If found, use `TaskGet` to read the task's `specFile` from metadata or description
4. Read that spec file
**Fallback (no tasks found):** Search for specs manually:
```
./docs/ideation/*/spec-phase-*.md
```
If multiple found, use `AskUserQuestion` to select one. **Headless mode:** pick the first unblocked spec.
### 2. Scout Codebase
**Invoke the Scout agent** to explore the codebase and produce a structured context map. The scout replaces manual codebase exploration — it runs as a read-only subagent, scores implementation readiness, and persists its findings.
**Determine the project directory** from the spec file path. If the spec is at `docs/ideation/my-project/spec-phase-1.md`, the project directory is `docs/ideation/my-project/`.
**Invoke the Scout** using the `Agent` tool:
1. Read `${CLAUDE_PLUGIN_ROOT}/agents/scout.md` to get the scout's full workflow and output format
2. Use the `Agent` tool with:
- **subagent_type**: `general-purpose`
- **prompt**: Include the full content of `scout.md` as the agent's instructions, followed by the specific inputs: spec file path, project directory, phase number, and whether a prior `context-map.md` exists
**Note on tool restrictions**: The scout's frontmatter declares `tools: ["Read", "Glob", "Grep"]`, but when invoked as a `general-purpose` subagent, these restrictions are policy-based (enforced by the prompt), not mechanism-based. The scout prompt instructs read-only behavior.
The scout may perform up to 2 internal exploration rounds before reaching a verdict. Execute-spec waits for the final output — it does not re-invoke the scout.
**After the scout completes**, parse the scout's text response for the context map and verdict. Write the context map to `{project-directory}/context-map.md` using the `Write` tool (the scout cannot write files itself — it returns the map as text).
**If scout returns GO** (confidence >= 70):
- The context map is ready. Use its sections during implementation:
- **Key Patterns**: Already-identified patterns to follow (avoid redundant file reads)
- **Dependencies**: Know what's affected by your changes
- **Conventions**: Naming, imports, error handling to match
- **Risks**: Watch for these during build
- Proceed to spec parsing
**If scout returns HOLD** (confidence < 70):
- The scout couldn't confidently map the codebase. Present the gap analysis to the user via `AskUserQuestion` (**headless mode:** auto-select "Proceed anyway"):
```
Question: "Scout confidence is {score}/100 (below 70 threshold). Gaps: {summary of lowest dimensions}. How to proceed?"
Options:
- "Proceed anyway" — Build with known gaps. May require more iteration.
- "Update spec" — The spec may be underspecified. Pause to revise.
- "Abort" — Stop execution for this phase.
```
**If the user chose "Proceed anyway" after HOLD**: The context map (if produced) may have gaps. During build, treat missing context map sections as unavailable and read files directly for those areas. Pay extra attention to the Risks section of a partial context map.
**If no scout agent is available** (agent file missing or invocation fails): Fall back to inline exploration and log a warning. The inline fallback is:
1. Read all "Pattern to follow" file paths from the spec
2. Read all files in the spec's "Modified Files" section
3. If creating files alongside existing analogues, read the analogues
4. Use `Grep` to check what imports or references the modified files (blast radius)
5. Read `CLAUDE.md` or project README for conventions
### 3. Parse Spec Structure
Extract from the spec file (and template if applicable):
- **Technical Approach** - Overall implementation strategy
- **File Changes** - New files, modified files, deleted files
- **Implementation Details** - Per-component instructions with code patterns
- **Testing Requirements** - Unit tests, integration tests, manual testing
- **Validation Commands** - Commands to verify implementation
- **Feedback Strategy** - Top-level inner-loop command and playground type (if present)
- **Per-component Feedback Loops** - Playground, experiment, and check command for each component (if present)
**Also extract and retain for the review cycle:**
- **Pattern file list** — scan all components' Implementation Details for "Pattern to follow" entries. Collect every referenced file path into a single list. This list is passed to the reviewer agent during the post-execution review cycle. Keep it available throughout the build and review phases.
### 4. Check or Create Implementation Tasks
**If tasks already exist** (detected in Step 1 from TaskList):
- Skip task creation
- The phase task is the parent; component tasks may already exist
- Mark the phase task as `in_progress` and proceed to execution
**If no tasks exist** (fresh execution):
Use `TaskCreate` to create structured tasks from the spec's Implementation Details:
**For each component**, create a task with:
- **subject**: Component name from the spec
- **description**: Implementation steps, file changes, and validation criteria from the spec's Implementation Details section
- **activeForm**: "Implementing {component name}"
**After creating all component tasks, add dependency relationships** using TaskUpdate with `addBlockedBy` — if Component B depends on Component A, mark B as blocked by A's task ID.
**Create validation tasks** (blocked by all component tasks):
- "Run validation commands" — execute all validation commands from spec
- "Verify acceptance criteria" — review each acceptance criterion from spec
### 5. Establish Task Dependencies
Parse the spec's Implementation Details for component order:
1. **Identify dependencies**: Check "File Changes" for overlapping files
2. **Create blocking relationships**:
- Sequential components: Component N blocked by Component N-1
- Independent components: No blockers (can run in parallel)
3. **Validation tasks**: Blocked by ALL component tasks
### 6. Set Up Feedback Environment
Before implementing any component, establish the spec's feedback environment. This is a one-time setup.
1. **Read the Feedback Strategy** section from the spec. Identify the playground type and inner-loop command.
2. **Auto-detect feedback infrastructure** — even if the spec has no Feedback Strategy section, probe the codebase:
- Read `package.json` (or equivalent manifest) for scripts: `test`, `dev`, `start`, `storybook`, `typecheck`
- Check for test runner configs: `jest.config.*`, `vitest.config.*`, `.mocharc.*`, `pytest.ini`, `go.mod` (for `go test`)
- Check for dev server configs: `vite.config.*`, `next.config.*`, `webpack.config.*`
- Check for storybook: `.storybook/` directory
- Check for existing script harnesses: `scripts/`, `bin/`, `Makefile`
3. **Set up the playground** if it requires infrastructure:
- **Test runner**: Verify the test command works (even with no tests yet — confirm the runner doesn't crash)
- **Dev Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.