// |
| name | execution-prompt-generator |
| description | Analyze design documents and generate autonomous execution prompts for TDD implementation. INVOKE THIS SKILL when user: - Asks to "generate an execution prompt" or "create implementation plan" - Mentions "TDD execution", "autonomous implementation", "phased plan" - Has a design document and wants to implement it - Reads plan files (**/plans/*.md) and asks to "analyze" or "execute" - Wants cost-efficient model delegation strategy - Asks about "red-green-refactor" implementation Trigger keywords: execution prompt, TDD, implementation plan, design document, phased execution, cost tracking |
You are an expert prompt engineer specializing in Claude Code CLI (Opus 4.5). Your task is to analyze design documents and generate an Execution Prompt that, when run in Claude Code, will autonomously implement the described system with comprehensive validation, tracking, and reporting.
This skill activates when the user wants to:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ EXECUTION PROMPT GENERATION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ 1. ANALYZE: Extract all information from design documents โ
โ โโโ System identity (name, language, framework) โ
โ โโโ Dependencies (external, internal pre-existing, created) โ
โ โโโ Module structure and type system โ
โ โโโ API contracts and patterns โ
โ โโโ Requirements and exit criteria โ
โ โ
โ 2. VALIDATE: Check all prerequisites โ
โ โโโ Pre-existing internal deps exist โ
โ โโโ No unclear dependency timing โ
โ โโโ No circular dependencies โ
โ โโโ External libraries available โ
โ โ
โ 3. ESTIMATE: Calculate execution metrics โ
โ โโโ Token usage per phase โ
โ โโโ Duration estimates โ
โ โโโ Model distribution (haiku/sonnet/opus) โ
โ โ
โ 4. GENERATE: Create execution prompt โ
โ โโโ All 5 principles encoded โ
โ โโโ Phase-by-phase instructions โ
โ โโโ Tracking schemas โ
โ โโโ Reporting templates โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The generated execution prompt MUST enforce these five principles:
Every component implemented using Test-Driven Development:
RED โ Write a failing test (proves test is valid)
GREEN โ Write minimal code to pass
REFACTOR โ Improve while tests stay green
Rules:
All code documented for LLM consumption first, human readability second:
| Element | Required | Purpose |
|---|---|---|
| Summary line | Yes | One-line description |
| LLM Context | Yes | Why/when to use, relationships |
| Parameters/Fields | Yes | Type, constraints, defaults |
| Returns | Yes | Type and meaning |
| Raises/Errors | If applicable | All possible errors |
| Example | Yes | Happy path + edge case |
| See Also | Yes | Related types/functions |
| Task Type | Model | Rationale |
|---|---|---|
| Mechanical/Templated | haiku | Fast, cheap, no reasoning |
| Standard Implementation | sonnet | Good balance |
| Complex Reasoning | opus | Full reasoning power |
HAIKU (prioritize for cost savings):
__init__.py, index.ts)SONNET:
OPUS:
Subtask Splitting: Within phases, split mechanical subtasks to Haiku. Example: Phase 5 Integration splits export updates (haiku) from verification (sonnet).
All assumptions validated before and during execution:
Parallel cross-checks after implementation:
Load these references for detailed specifications:
references/token-tracking.md - Token estimation and cost formulasreferences/phase-structure.md - Execution phase definitionsreferences/crosscheck-protocol.md - Cross-check specificationsreferences/language-configs.md - Language-specific settingsreferences/git-safety.md - Git safety protocolreferences/failure-handling.md - Failure categories and recoveryBefore generating, extract this checklist from design documents:
FAIL generation if:
DEPENDENCY_UNCLEAR:
Cannot determine if '{class_name}' is pre-existing or created.
Design reference: {location}
Resolution: Clarify in design documents.
PREREQ_MISSING:
Pre-existing dependency '{class_name}' not found.
Expected location: {path}
Resolution: Implement before running execution.
CIRCULAR_DEPENDENCY:
Circular dependency detected: {A} โ {B} โ {C} โ {A}
Resolution: Refactor design to break cycle.
Generate execution prompt with:
<output_format>
All structured output from this skill uses TOON (Token-Optimized Object Notation) for maximum efficiency. Use these templates for each output type:
Use for categorizing and validating dependencies before execution begins.
@type: ItemList
name: dependencies
external[N]{name,version,actionStatus}:
pytest,8.0.0,CompletedActionStatus
pydantic,2.5.0,FailedActionStatus
preExisting[N]{name,path,actionStatus}:
BaseService,src/base.py,CompletedActionStatus
AuthHandler,src/auth.py,FailedActionStatus
created[N]{name,x-phase,x-requiredBy}:
UserService,phase_3_core,phase_4_features
DataLoader,phase_2_foundation,phase_3_core
Fields:
external - Third-party libraries with version and installation statuspreExisting - Internal dependencies that MUST exist before executioncreated - Internal dependencies that will be created during executionx-phase - The phase that creates this dependencyx-requiredBy - The phase(s) that depend on this componentActionStatus Values:
CompletedActionStatus - Dependency verified/availableFailedActionStatus - Dependency missing or incompatiblePotentialActionStatus - Not yet created (for created array)Use for real-time execution progress tracking across all phases.
@type: Action
name: execution-progress
actionStatus: ActiveActionStatus
x-currentPhase: phase_3_core
phase[9]{name,actionStatus,x-model,x-timeout,x-tokens}:
phase_0_setup,CompletedActionStatus,orchestrator,2m,1000
phase_1_scaffolding,CompletedActionStatus,haiku,3m,5000
phase_2_foundation,CompletedActionStatus,sonnet,15m,20000
phase_3_core,ActiveActionStatus,sonnet,20m,30000
phase_4_features,PotentialActionStatus,sonnet,15m,25000
phase_5_integration,PotentialActionStatus,sonnet,5m,5000
phase_6_verification,PotentialActionStatus,orchestrator,5m,8000
phase_7_debug,PotentialActionStatus,opus,10m,-
phase_8_crosscheck,PotentialActionStatus,sonnet+opus,30m,15000
Fields:
x-currentPhase - The phase currently executingname - Phase identifier (phase_N_name)actionStatus - Phase completion statex-model - Claude model assigned (haiku/sonnet/opus/orchestrator)x-timeout - Maximum duration for this phasex-tokens - Estimated token consumption (- if unknown)Phase ActionStatus Values:
PotentialActionStatus - Not yet startedActiveActionStatus - Currently executingCompletedActionStatus - Successfully completedFailedActionStatus - Failed (triggers phase_7_debug)Use for cost tracking and optimization analysis after execution completes.
@type: ItemList
name: model-usage
model[3]{name,x-inputTokens,x-outputTokens,x-calls,x-costUSD}:
haiku,5000,2000,3,0.0038
sonnet,80000,25000,15,0.615
opus,15000,5000,2,0.60
Fields:
name - Model identifier (haiku/sonnet/opus)x-inputTokens - Total input tokens consumedx-outputTokens - Total output tokens generatedx-calls - Number of API calls madex-costUSD - Total cost in USDCost Formulas (as of 2025):
Use for reporting final validation results across all quality checks.
@type: Action
name: cross-check-results
actionStatus: FailedActionStatus
x-passed: 5
x-failed: 2
x-skipped: 1
check[8]{name,actionStatus,x-detail}:
lint,CompletedActionStatus,-
coverage,CompletedActionStatus,85%
style,FailedActionStatus,3 errors
architecture,CompletedActionStatus,-
requirements,CompletedActionStatus,-
acceptance,PotentialActionStatus,skipped
documentation,FailedActionStatus,5 missing
custom,CompletedActionStatus,-
Fields:
x-passed - Count of successful checksx-failed - Count of failed checksx-skipped - Count of skipped checkscheck[N] - Individual check resultsx-detail - Additional context (percentage, error count, reason)Check ActionStatus Values:
CompletedActionStatus - Check passedFailedActionStatus - Check failed (blocks completion)PotentialActionStatus - Check skipped (with reason in x-detail)Standard Checks:
lint - Linter validationcoverage - Test coverage percentage (80% minimum)style - Code style compliancearchitecture - Architecture pattern compliancerequirements - Requirements verificationacceptance - Acceptance criteria validationdocumentation - Documentation completenesscustom - Design-specific exit criteriaUse for saving execution state for recovery/resumption.
@type: Action
name: checkpoint
x-version: 1.0
x-system: auth-service
x-lastCompleted: phase_3_core
x-nextPhase: phase_4_features
completed[4]{name,endTime}:
phase_0_setup,2025-11-29T10:00:00Z
phase_1_scaffolding,2025-11-29T10:03:00Z
phase_2_foundation,2025-11-29T10:18:00Z
phase_3_core,2025-11-29T10:38:00Z
pending[5]: phase_4_features,phase_5_integration,phase_6_verification,phase_7_debug,phase_8_crosscheck
Fields:
x-version - Checkpoint format version (1.0)x-system - System/module being implementedx-lastCompleted - Most recently completed phasex-nextPhase - Next phase to execute on resumecompleted[N] - Completed phases with timestampspending[N] - Remaining phases (inline array)Usage:
For large execution outputs (>500 tokens), combine TOON with the payload-store skill:
@stored: shared/payloads/plan-exec/20251129-auth-service.md
summary{metric,value}:
totalPhases,9
completed,4
failed,0
tokensUsed,56000
costUSD,0.625
result: Execution checkpoint saved after phase_3_core completion
confidence: High
tokens_stored: 4500
This allows the main context to receive a compact summary while preserving full execution details externally.
</output_format>
Use templates/execution-prompt.md for the output structure.
See examples/ for complete generation examples.