name: plan-todo
description: Convert TODO.md items into TDD implementation plans in PLANS.md. Use when starting work on backlog items, planning features, or organizing implementation tasks. Supports codebase exploration and MCP integration.
argument-hint: [item-selector] e.g., "bug #2", "all improvements", "the file naming issue"
allowed-tools: Read, Edit, Write, Glob, Grep, Task, mcp__gdrive__gdrive_search, mcp__gdrive__gdrive_read_file, mcp__gdrive__gdrive_list_folder, mcp__gdrive__gdrive_get_pdf, mcp__gdrive__gsheets_read, mcp__Railway__check-railway-status, mcp__Railway__get-logs, mcp__Railway__list-deployments, mcp__Railway__list-services, mcp__Railway__list-variables, mcp__gemini__gemini_analyze_pdf
disable-model-invocation: true
Convert TODO.md items into a structured TDD implementation plan in PLANS.md.
Purpose
- Convert backlog items from TODO.md into actionable TDD implementation plans
- Explore codebase to understand existing patterns and find relevant files
- Use MCPs to gather additional context (Drive files, spreadsheets, deployments)
- Generate detailed, implementable plans with full file paths
Pre-flight Check
Before doing anything, read PLANS.md and check for incomplete work:
- If PLANS.md has content but NO "Status: COMPLETE" at the end → STOP
- Tell the user: "PLANS.md has incomplete work. Please review and clear it before planning new items."
- Do not proceed.
If PLANS.md is empty or has "Status: COMPLETE" → proceed with planning.
Arguments
Default: plan the first item in TODO.md. Override with $ARGUMENTS:
| Selector |
Example |
Result |
| Item number |
bug #2, improvement #5 |
Specific item |
| Category |
all bugs, all improvements |
All items in category |
| Natural language |
the file naming issue |
Fuzzy match |
Context Gathering
IMPORTANT: Do NOT hardcode MCP names or folder paths. Always read CLAUDE.md to discover:
Available MCP servers - Look for the "MCP SERVERS" section to find:
- Google Drive MCP for file access (
gdrive_search, gdrive_read_file, gsheets_read, etc.)
- Railway MCP for deployment context (
get-logs, list-deployments, list-services, list-variables)
- Gemini MCP for prompt testing (
gemini_analyze_pdf)
Folder structure - Look for "FOLDER STRUCTURE" section to understand:
- Where documents are stored
- Naming conventions for folders
Project structure - Look for "STRUCTURE" section to understand:
- Source code organization
- Test file locations
- Where to add new files
Spreadsheet schemas - Look for "SPREADSHEETS" section or read SPREADSHEET_FORMAT.md
Workflow
- Read PLANS.md - Pre-flight check
- Read TODO.md - Identify items to plan
- Read CLAUDE.md - Understand TDD workflow, agents, project rules, available MCPs
- Explore codebase - Use Glob/Grep/Task to find relevant files and understand patterns
- Gather MCP context - If the TODO item relates to:
- Document processing → Check Drive files, spreadsheet schemas
- Deployment → Check service status, recent logs
- Extraction issues → Check current prompts, test with Gemini MCP
- Generate plan - Create TDD tasks with test-first approach
- Write PLANS.md - Overwrite with new plan
- Update TODO.md - Remove planned items
Codebase Exploration Guidelines
When to explore:
- Always explore to find existing patterns before creating new code
- Find related tests to understand testing conventions
- Locate where similar functionality already exists
How to explore:
- Use Glob for finding files by pattern:
src/**/*.ts, **/*.test.ts
- Use Grep for finding code: function names, type definitions, error messages
- Use Task with
subagent_type=Explore for broader questions about the codebase
What to discover:
- Existing functions that could be reused or extended
- Test file conventions and patterns
- Type definitions to reuse
- Similar implementations to follow as templates
PLANS.md Structure
# Implementation Plan
**Created:** YYYY-MM-DD
**Source:** [Which items from TODO.md]
## Context Gathered
### Codebase Analysis
- **Related files:** [files found through exploration]
- **Existing patterns:** [patterns to follow]
- **Test conventions:** [how tests are structured in this area]
### MCP Context (if applicable)
- **MCPs used:** [which MCPs were consulted]
- **Findings:** [relevant information discovered]
## Original Plan
### Task 1: [Name]
1. Write test in [file].test.ts for [function/scenario]
2. Run test-runner (expect fail)
3. Implement [function] in [file].ts
4. Run test-runner (expect pass)
### Task 2: [Name]
1. Write test...
2. Run test-runner...
3. Implement...
4. Run test-runner...
## Post-Implementation Checklist
1. Run `bug-hunter` agent - Review changes for bugs
2. Run `test-runner` agent - Verify all tests pass
3. Run `builder` agent - Verify zero warnings
Task Writing Guidelines
Each task must be:
- Self-contained - Full file paths, clear descriptions
- TDD-compliant - Test before implementation
- Specific - What to test, what to implement
- Ordered - Dependencies resolved by task order
- Context-aware - Reference patterns and files discovered during exploration
Good task example:
### Task 1: Add parseResumenBroker function
1. Write test in src/gemini/parser.test.ts for parseResumenBrokerResponse
- Test extracts comitente number (similar to existing parseResumenBancario tests)
- Test handles multi-currency (ARS + USD)
- Test returns error for invalid input
- Follow existing Result<T,E> pattern from parser.ts
2. Run test-runner (expect fail)
3. Implement parseResumenBrokerResponse in src/gemini/parser.ts
- Use existing ResumenBroker type from src/types/index.ts
- Follow parseResumenBancarioResponse as template
4. Run test-runner (expect pass)
Bad task example:
### Task 1: Add broker parsing
1. Add parser function
2. Test it
MCP Usage Guidelines
Google Drive MCP - Use when TODO item involves:
- Document processing or extraction
- Spreadsheet column changes
- File organization or naming
Railway MCP - Use when TODO item involves:
- Deployment configuration
- Environment variables
- Service logs for debugging context
Gemini MCP - Use when TODO item involves:
- Prompt improvements
- Extraction accuracy
- Test prompt variations before planning changes
Rules
- Refuse to proceed if PLANS.md has incomplete work
- Explore codebase before planning - Find patterns to follow
- Use MCPs when relevant - Gather context from external systems
- Every task must follow TDD (test first, then implement)
- No manual verification steps - use agents only
- Tasks must be implementable without additional context
- Always include post-implementation checklist
- Remove planned items from TODO.md after writing PLANS.md
CRITICAL: Scope Boundaries
This skill creates plans. It does NOT implement them.
- NEVER ask to "exit plan mode" - This skill doesn't use Claude Code's plan mode feature
- NEVER implement code - Your job ends when PLANS.md is written
- NEVER ask ambiguous questions like "should I proceed?" or "ready to continue?"
- NEVER start implementing after writing the plan, even if user says "yes" to something
Termination
When you finish writing PLANS.md (and updating TODO.md), output this exact message and STOP:
✓ Plan created in PLANS.md
✓ Planned items removed from TODO.md
Next step: Run `plan-implement` to execute this plan.
Do not ask follow-up questions. Do not offer to implement. Just output the message and stop.
1---2name: plan-todo3description: Convert TODO.md items into a structured TDD implementation plan in PLANS.md.4---5
6---
7name: plan-todo
8description: Convert TODO.md items into TDD implementation plans in PLANS.md. Use when starting work on backlog items, planning features, or organizing implementation tasks. Supports codebase exploration and MCP integration.
9argument-hint: [item-selector] e.g., "bug #2", "all improvements", "the file naming issue"
10allowed-tools: Read, Edit, Write, Glob, Grep, Task, mcp__gdrive__gdrive_search, mcp__gdrive__gdrive_read_file, mcp__gdrive__gdrive_list_folder, mcp__gdrive__gdrive_get_pdf, mcp__gdrive__gsheets_read, mcp__Railway__check-railway-status, mcp__Railway__get-logs, mcp__Railway__list-deployments, mcp__Railway__list-services, mcp__Railway__list-variables, mcp__gemini__gemini_analyze_pdf
11disable-model-invocation: true
12---
13
14Convert TODO.md items into a structured TDD implementation plan in PLANS.md.
15
16## Purpose
17
18- Convert backlog items from TODO.md into actionable TDD implementation plans
19- Explore codebase to understand existing patterns and find relevant files
20- Use MCPs to gather additional context (Drive files, spreadsheets, deployments)
21- Generate detailed, implementable plans with full file paths
22
23## Pre-flight Check
24
25**Before doing anything**, read PLANS.md and check for incomplete work:
26- If PLANS.md has content but NO "Status: COMPLETE" at the end → **STOP**
27- Tell the user: "PLANS.md has incomplete work. Please review and clear it before planning new items."
28- Do not proceed.
29
30If PLANS.md is empty or has "Status: COMPLETE" → proceed with planning.
31
32## Arguments
33
34Default: plan the **first item** in TODO.md. Override with $ARGUMENTS:
35
36| Selector | Example | Result |
37|----------|---------|--------|
38| Item number | `bug #2`, `improvement #5` | Specific item |
39| Category | `all bugs`, `all improvements` | All items in category |
40| Natural language | `the file naming issue` | Fuzzy match |
41
42## Context Gathering
43
44**IMPORTANT: Do NOT hardcode MCP names or folder paths.** Always read CLAUDE.md to discover:
45
461. **Available MCP servers** - Look for the "MCP SERVERS" section to find:
47 - Google Drive MCP for file access (`gdrive_search`, `gdrive_read_file`, `gsheets_read`, etc.)
48 - Railway MCP for deployment context (`get-logs`, `list-deployments`, `list-services`, `list-variables`)
49 - Gemini MCP for prompt testing (`gemini_analyze_pdf`)
50
512. **Folder structure** - Look for "FOLDER STRUCTURE" section to understand:
52 - Where documents are stored
53 - Naming conventions for folders
54
553. **Project structure** - Look for "STRUCTURE" section to understand:
56 - Source code organization
57 - Test file locations
58 - Where to add new files
59
604. **Spreadsheet schemas** - Look for "SPREADSHEETS" section or read SPREADSHEET_FORMAT.md
61
62## Workflow
63
641. **Read PLANS.md** - Pre-flight check
652. **Read TODO.md** - Identify items to plan
663. **Read CLAUDE.md** - Understand TDD workflow, agents, project rules, available MCPs
674. **Explore codebase** - Use Glob/Grep/Task to find relevant files and understand patterns
685. **Gather MCP context** - If the TODO item relates to:
69 - Document processing → Check Drive files, spreadsheet schemas
70 - Deployment → Check service status, recent logs
71 - Extraction issues → Check current prompts, test with Gemini MCP
726. **Generate plan** - Create TDD tasks with test-first approach
737. **Write PLANS.md** - Overwrite with new plan
748. **Update TODO.md** - Remove planned items
75
76## Codebase Exploration Guidelines
77
78**When to explore:**
79- Always explore to find existing patterns before creating new code
80- Find related tests to understand testing conventions
81- Locate where similar functionality already exists
82
83**How to explore:**
84- Use Glob for finding files by pattern: `src/**/*.ts`, `**/*.test.ts`
85- Use Grep for finding code: function names, type definitions, error messages
86- Use Task with `subagent_type=Explore` for broader questions about the codebase
87
88**What to discover:**
89- Existing functions that could be reused or extended
90- Test file conventions and patterns
91- Type definitions to reuse
92- Similar implementations to follow as templates
93
94## PLANS.md Structure
95
96```markdown
97# Implementation Plan
98
99**Created:** YYYY-MM-DD
100**Source:** [Which items from TODO.md]
101
102## Context Gathered
103
104### Codebase Analysis
105- **Related files:** [files found through exploration]
106- **Existing patterns:** [patterns to follow]
107- **Test conventions:** [how tests are structured in this area]
108
109### MCP Context (if applicable)
110- **MCPs used:** [which MCPs were consulted]
111- **Findings:** [relevant information discovered]
112
113## Original Plan
114
115### Task 1: [Name]
1161. Write test in [file].test.ts for [function/scenario]
1172. Run test-runner (expect fail)
1183. Implement [function] in [file].ts
1194. Run test-runner (expect pass)
120
121### Task 2: [Name]
1221. Write test...
1232. Run test-runner...
1243. Implement...
1254. Run test-runner...
126
127## Post-Implementation Checklist
1281. Run `bug-hunter` agent - Review changes for bugs
1292. Run `test-runner` agent - Verify all tests pass
1303. Run `builder` agent - Verify zero warnings
131```
132
133## Task Writing Guidelines
134
135Each task must be:
136- **Self-contained** - Full file paths, clear descriptions
137- **TDD-compliant** - Test before implementation
138- **Specific** - What to test, what to implement
139- **Ordered** - Dependencies resolved by task order
140- **Context-aware** - Reference patterns and files discovered during exploration
141
142Good task example:
143```markdown
144### Task 1: Add parseResumenBroker function
1451. Write test in src/gemini/parser.test.ts for parseResumenBrokerResponse
146 - Test extracts comitente number (similar to existing parseResumenBancario tests)
147 - Test handles multi-currency (ARS + USD)
148 - Test returns error for invalid input
149 - Follow existing Result<T,E> pattern from parser.ts
1502. Run test-runner (expect fail)
1513. Implement parseResumenBrokerResponse in src/gemini/parser.ts
152 - Use existing ResumenBroker type from src/types/index.ts
153 - Follow parseResumenBancarioResponse as template
1544. Run test-runner (expect pass)
155```
156
157Bad task example:
158```markdown
159### Task 1: Add broker parsing
1601. Add parser function
1612. Test it
162```
163
164## MCP Usage Guidelines
165
166**Google Drive MCP** - Use when TODO item involves:
167- Document processing or extraction
168- Spreadsheet column changes
169- File organization or naming
170
171**Railway MCP** - Use when TODO item involves:
172- Deployment configuration
173- Environment variables
174- Service logs for debugging context
175
176**Gemini MCP** - Use when TODO item involves:
177- Prompt improvements
178- Extraction accuracy
179- Test prompt variations before planning changes
180
181## Rules
182
183- **Refuse to proceed if PLANS.md has incomplete work**
184- **Explore codebase before planning** - Find patterns to follow
185- **Use MCPs when relevant** - Gather context from external systems
186- Every task must follow TDD (test first, then implement)
187- No manual verification steps - use agents only
188- Tasks must be implementable without additional context
189- Always include post-implementation checklist
190- Remove planned items from TODO.md after writing PLANS.md
191
192## CRITICAL: Scope Boundaries
193
194**This skill creates plans. It does NOT implement them.**
195
1961. **NEVER ask to "exit plan mode"** - This skill doesn't use Claude Code's plan mode feature
1972. **NEVER implement code** - Your job ends when PLANS.md is written
1983. **NEVER ask ambiguous questions** like "should I proceed?" or "ready to continue?"
1994. **NEVER start implementing** after writing the plan, even if user says "yes" to something
200
201## Termination
202
203When you finish writing PLANS.md (and updating TODO.md), output this exact message and STOP:
204
205```
206✓ Plan created in PLANS.md
207✓ Planned items removed from TODO.md
208
209Next step: Run `plan-implement` to execute this plan.
210```
211
212Do not ask follow-up questions. Do not offer to implement. Just output the message and stop.