This workflow replaces "Monolithic Planning" (planning everything at once) with "Iterative Component Planning". It is designed for complex features that require breaking down into functional units.
"Plan the System, Build the Component." Don't try to write a detailed plan for the entire system upfront. Create a high-level roadmap, then zoom in to plan one component in detail before executing it.
File: .tmp/sessions/{id}/master-plan.md
Purpose: High-level architecture and dependency graph.
Content:
File: .tmp/sessions/{id}/component-{name}.md
Purpose: Detailed execution steps for the current focus.
Content:
master-plan.md.Repeat this for each component in the Master Plan:
component-{name}.md.
component-{name}.md into TodoWrite.master-plan.md to mark component as complete.master-plan.md)# Master Plan: E-Commerce Checkout
## Architecture
[Cart] -> [Order Service] -> [Payment Gateway]
-> [Inventory Service]
## Component Order
1. [ ] **Inventory Service** (Check stock)
2. [ ] **Order Service** (Create order record)
3. [ ] **Payment Integration** (Stripe)
4. [ ] **Checkout UI** (React components)
component-inventory.md)# Component: Inventory Service
## Interface
```typescript
interface InventoryManager {
checkStock(sku: string): Promise<boolean>;
reserve(sku: string, quantity: number): Promise<void>;
}
InventoryManager interface in src/types.tscheckStock logic with DB query