gepetto
Gepetto orchestrates multi-phase planning for complex features by combining research, stakeholder interviews, specification synthesis, implementation planning, and external review cycles. Use this skill when scoping substantial features that require thorough pre-implementation analysis before development begins, as it generates detailed sectionized implementation plans and documentation artifacts to guide the development process.
git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/gepetto && cp -r /tmp/gepetto/cli-tool/components/skills/ai-research/gepetto ~/.claude/skills/gepettoSKILL.md
# Gepetto
Orchestrates a multi-step planning process: Research → Interview → Spec Synthesis → Plan → External Review → Sections
## CRITICAL: First Actions
**BEFORE anything else**, do these in order:
### 1. Print Intro
Print intro banner immediately:
```
═══════════════════════════════════════════════════════════════
GEPETTO: AI-Assisted Implementation Planning
═══════════════════════════════════════════════════════════════
Research → Interview → Spec Synthesis → Plan → External Review → Sections
Note: GEPETTO will write many .md files to the planning directory you pass it
```
### 2. Validate Spec File Input
**Check if user provided @file at invocation AND it's a spec file (ends with `.md`).**
If NO @file was provided OR the path doesn't end with `.md`, output this and STOP:
```
═══════════════════════════════════════════════════════════════
GEPETTO: Spec File Required
═══════════════════════════════════════════════════════════════
This skill requires a markdown spec file path (must end with .md).
The planning directory is inferred from the spec file's parent directory.
To start a NEW plan:
1. Create a markdown spec file describing what you want to build
2. It can be as detailed or as vague as you like
3. Place it in a directory where gepetto can save planning files
4. Run: /gepetto @path/to/your-spec.md
To RESUME an existing plan:
1. Run: /gepetto @path/to/your-spec.md
Example: /gepetto @planning/my-feature-spec.md
═══════════════════════════════════════════════════════════════
```
**Do not continue. Wait for user to re-invoke with a .md file path.**
### 3. Setup Planning Session
Determine session state by checking existing files:
1. Set `planning_dir` = parent directory of the spec file
2. Set `initial_file` = the spec file path
3. Scan for existing planning files:
- `claude-research.md`
- `claude-interview.md`
- `claude-spec.md`
- `claude-plan.md`
- `claude-integration-notes.md`
- `claude-ralph-loop-prompt.md`
- `claude-ralphy-prd.md`
- `reviews/` directory
- `sections/` directory
4. Determine mode and resume point:
| Files Found | Mode | Resume From |
|-------------|------|-------------|
| None | new | Step 4 |
| research only | resume | Step 6 (interview) |
| research + interview | resume | Step 8 (spec synthesis) |
| + spec | resume | Step 9 (plan) |
| + plan | resume | Step 10 (external review) |
| + reviews | resume | Step 11 (integrate) |
| + integration-notes | resume | Step 12 (user review) |
| + sections/index.md | resume | Step 14 (write sections) |
| all sections complete | resume | Step 15 (execution files) |
| + claude-ralph-loop-prompt.md + claude-ralphy-prd.md | complete | Done |
5. Create TODO list with TodoWrite based on current state
Print status:
```
Planning directory: {planning_dir}
Mode: {mode}
```
If resuming:
```
Resuming from step {N}
To start fresh, delete the planning directory files.
```
---
## Logging Format
```
═══════════════════════════════════════════════════════════════
STEP {N}/17: {STEP_NAME}
═══════════════════════════════════════════════════════════════
{details}
Step {N} complete: {summary}
───────────────────────────────────────────────────────────────
```
---
## Workflow
### 4. Research Decision
See [research-protocol.md](references/research-protocol.md).
1. Read the spec file
2. Extract potential research topics (technologies, patterns, integrations)
3. Ask user about codebase research needs
4. Ask user about web research needs (present derived topics as multi-select)
5. Record which research types to perform in step 5
### 5. Execute Research
See [research-protocol.md](references/research-protocol.md).
Based on decisions from step 4, launch research subagents:
- **Codebase research:** `Task(subagent_type=Explore)`
- **Web research:** `Task(subagent_type=Explore)` with WebSearch
If both are needed, launch both Task tools in parallel (single message with multiple tool calls).
**Important:** Subagents return their findings - they do NOT write files directly. After collecting results from all subagents, combine them and write to `<planning_dir>/claude-research.md`.
Skip this step entirely if user chose no research in step 4.
### 6. Detailed Interview
See [interview-protocol.md](references/interview-protocol.md)
Run in main context (AskUserQuestion requires it). The interview should be informed by:
- The initial spec
- Research findings (if any)
### 7. Save Interview Transcript
Write Q&A to `<planning_dir>/claude-interview.md`
### 8. Write Initial Spec (Spec Synthesis)
Combine into `<planning_dir>/claude-spec.md`:
- **Initial input** (the spec file)
- **Research findings** (if step 5 was done)
- **Interview answers** (from step 6)
This synthesizes the user's raw requirements into a complete specification.
### 9. Generate Implementation Plan
Create detailed plan → `<planning_dir>/claude-plan.md`
**IMPORTANT**: Write for an unfamiliar reader. The plan must be fully self-contained - an engineer or LLM with no prior context should understand *what* we're building, *why*, and *how* just from reading this document.
### 10. External Review
See [external-review.md](references/external-review.md)
Launch TWO subagents in parallel to review the plan:
1. **Gemini** via Bash
2. **Codex** via Bash
Both receive the plan content and return their analysis. Write results to `<planning_dir>/reviews/`.
### 11. Integrate External Feedback
Analyze the suggestions in `<planning_dir>/reviews/`.
You are the authority on what to integrate or not. It's OK if you decide to not integrate anything.
**Step 1:** Write `<planning_dir>/claude-integration-notes.md` documenting:
- What suggestions you're integrating and why
- What suggestions you're NOT integrating and why
**Step 2:** Update `<planning_dir>/claude-plan.md` with the integrated changes.
### 12. User Review of Integrated Plan
Use AskUserQuestion:
```
The plan has been updated with external feedback. You can now review and editUse this agent when creating specialized Claude Code agents for the claude-code-templates components system. Specializes in agent design, prompt engineering, domain expertise modeling, and agent best practices. Examples: <example>Context: User wants to create a new specialized agent. user: 'I need to create an agent that specializes in React performance optimization' assistant: 'I'll use the agent-expert agent to create a comprehensive React performance agent with proper domain expertise and practical examples' <commentary>Since the user needs to create a specialized agent, use the agent-expert agent for proper agent structure and implementation.</commentary></example> <example>Context: User needs help with agent prompt design. user: 'How do I create an agent that can handle both frontend and backend security?' assistant: 'Let me use the agent-expert agent to design a full-stack security agent with proper domain boundaries and expertise areas' <commentary>The user needs agent development help, so use the agent-expert agent.</commentary></example>
Use this agent to create blog articles for aitmpl.com from Claude Code Templates components. Reads the component, asks the user to confirm details, generates SVG cover, HTML article, and updates blog-articles.json. Examples: <example>Context: User wants a blog for a component. user: 'Create a blog article for cli-tool/components/hooks/security/secret-scanner.json' assistant: 'I'll use the blog-writer agent to create the full blog article with cover image and proper structure' <commentary>The user wants a blog article from a component, use blog-writer for the full pipeline.</commentary></example>
Runs pre-deploy build checks on the dashboard. Validates Astro build, checks for common esbuild/JSX issues, verifies API endpoints compile, and reports errors with fixes. Use before merging PRs that touch dashboard/.
Regenerates the component catalog (docs/components.json) by running the Python script. Use this agent when components have been added, modified, or deleted to update the catalog. Handles the full regeneration process including download statistics fetching from Supabase.
CLI interface design specialist. Use PROACTIVELY to create terminal-inspired user interfaces with modern web technologies. Expert in CLI aesthetics, terminal themes, and command-line UX patterns.
Use this agent when creating CLI commands for the claude-code-templates components system. Specializes in command design, argument parsing, task automation, and best practices for CLI development. Examples: <example>Context: User wants to create a new CLI command. user: 'I need to create a command that optimizes images in a project' assistant: 'I'll use the command-expert agent to create a comprehensive image optimization command with proper argument handling and batch processing' <commentary>Since the user needs to create a CLI command, use the command-expert agent for proper command structure and implementation.</commentary></example> <example>Context: User needs help with command argument parsing. user: 'How do I create a command that accepts multiple file patterns?' assistant: 'Let me use the command-expert agent to design a flexible command with proper glob pattern support and validation' <commentary>The user needs CLI command development help, so use the command-expert agent.</commentary></example>
Applies researched improvements to Claude Code components, validates changes with the component-reviewer agent, and creates pull requests. The only agent that modifies files and creates PRs.
Migrates components (agents, commands, skills, hooks, settings, MCPs) from external GitHub repositories to claude-code-templates, validates them with component-reviewer, and regenerates the catalog