Protocol for creating implementation plans before coding. Provides templates for full detailed plans (major changes) and quick plans (simple fixes). Use when starting new features, projects, refactors, or even quick bug fixes. Triggers: planning, implementation plan, feature spec, how to approach, before coding, design document.
Never jump into complex changes without a plan. This skill provides templates and triggers for two planning levels:
Triggers:
Triggers:
Use this structure for major work. Write in conversation, not to a file.
# Implementation Plan: [Feature/Project Name]
## Overview
[2-3 sentences on what we're building and why]
## Data Models & Relationships
### Entities
- **[Entity1]**: [description]
- Properties: [list key properties]
- Relationships: [how it relates to other entities]
- **[Entity2]**: [description]
- Properties: [list]
- Relationships: [list]
### Schema Changes
- [Table/collection changes if applicable]
- [Migration requirements]
## API Contracts & Interfaces
### New Functions/Methods
```[language]
// Function signatures with types
func doSomething(param: Type) -> ReturnType
// API request/response structures
struct Request {
let field: Type
}
protocol SomeProtocol {
func requiredMethod()
}
| Edge Case | Handling |
|---|---|
| [Empty input] | [Return empty result / show placeholder] |
| [Network failure] | [Retry with backoff / show error state] |
| [Invalid data] | [Validate and reject / sanitize] |
| [Concurrent access] | [Lock / queue / actor isolation] |
| [User cancellation] | [Clean up resources / restore state] |
| File | Action | Changes |
|---|---|---|
path/to/file1.swift | Modify | Add [X], update [Y] |
path/to/file2.swift | Create | New [component/service] |
path/to/file3.swift | Delete | No longer needed because [reason] |
| Risk | Mitigation |
|---|---|
| [Performance concern] | [Caching / lazy loading / pagination] |
| [Breaking change] | [Feature flag / gradual rollout] |
| [External dependency] | [Fallback / timeout handling] |
**After presenting the plan:** Wait for user acknowledgment before implementing.
---
## Quick Plan Template
For simple tasks, state briefly in your response (or in thinking for very simple fixes):
Approach: [1-2 sentences on what you'll do]
Risks/Assumptions:
### Examples
**Bug fix:**
Approach: Fix null check in handleSubmit() by adding early return when user is undefined.
Risks: None significant — existing tests cover this path.
**Config change:**
Approach: Update API base URL in config.ts from staging to production endpoint.
Risks: Assuming production endpoint is ready. Will verify with health check after change.
**Debug session:**
Approach: Add logging to isolate where the state becomes undefined. Check component lifecycle order.
Risks: Logs may be verbose — will remove after debugging.
---
## Planning Workflow
### For Full Plans
1. **Identify scope** — What's being built/changed?
2. **Research** — Spawn research agents for unfamiliar APIs (see `research-agent-protocol`)
3. **Draft plan** — Fill out the full template above
4. **Present to user** — Share the complete plan
5. **Wait for acknowledgment** — Don't proceed until user confirms
6. **Implement** — Follow the plan, using sub-agents as needed
7. **Verify** — Run tests, check results against plan
### For Quick Plans
1. **State approach + risks** — Brief statement
2. **Proceed** — Implement the fix
3. **Verify** — Run relevant tests
4. **Report** — What changed and why
---
## Common Mistakes to Avoid
1. **Skipping edge cases** — Always enumerate them, even if handling is "throw error"
2. **Vague file changes** — Be specific about what changes in each file
3. **Missing data flow** — For algorithms, trace how data moves
4. **Assuming API shapes** — Research first, then plan
5. **No implementation order** — Dependencies matter, sequence your steps
6. **Forgetting tests** — Include test strategy in the plan
---
## Integration with Other Protocols
- **Research Protocol**: Complete research before finalizing plan
- **Orchestration Guide**: Plan which sub-agents to use for implementation
- **Testing Protocol**: Include test strategy in the plan
- **Task Tracking**: Create tasks from the implementation order
---
## Asking for Clarification
If the plan requires decisions you can't make:
Before finalizing the plan, I need input on:
Which approach would you prefer?
Use AskUserQuestion tool for structured choices.