Writing Plans â?Enhanced
Overview
Write comprehensive implementation plans assuming the engineer has zero context for our codebase. Document everything they need to know: which files to touch, data flow, mockups, risks. Give them the whole plan as bite-sized tasks.
Announce at start: "I'm using the writing-plans skill to create the implementation plan."
Save plans to: docs/plans/YYYY-MM-DD-<feature-name>.md
Plan Document Header
Every plan MUST start with this header:
# [Feature Name] Implementation Plan
> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.
**Goal:** [One sentence describing what this builds]
**Architecture:** [2-3 sentences about approach]
**Tech Stack:** [Key technologies/libraries]
**Effort:** ~N weeks | **Surfaces touched:** N packages | **New tables:** N | **Feature flag:** name
Milestone Timeline
Ship in slices, each independently reviewable and each behind the flag. Nothing is user-visible until the last slice.
### Milestone 1: Schema & API Contract (Week 1 · MonâTue)
New tables, migrations, and API stubs. No UI. Contract reviewed before anything else lands.
- `packages/db` â?new migrations
- `packages/api` â?tRPC router stubs
### Milestone 2: Core Component (Week 1 · WedâFri)
Static component rendered from fixtures. Optimistic insert on submit, rollback on failure.
- `apps/web` â?new component
- `apps/storybook` â?fixture stories
### Milestone 3: Realtime Integration (Week 2 · MonâWed)
Subscribe to changes. Track state for sidebar digest.
### Milestone 4: Notifications & Ramp (Week 2 · ThuâFri)
Mention detection â?notification row, email digest fallback, ramp feature flag.
Data Flow
Describe the data flow from client to persistence. Use ASCII diagrams with solid = request/response, dashed = realtime/async.
### Data Flow: Optimistic Write Path
Client API Server Database
â? â? â? âââ?POST /tasks (optimistic) â? â? âââ?update local cache immediately â? â? âââ?send mutation ââââââºâ¤ â? â? âââ?validate ââââââââââºâ¤
â? â? â? â? âââ 200 OK ââââââââââââââ? âââ cache update âââââââââââ? â? â? â? â?
### Realtime Fan-Out (dashed path)
Database â â ââ?WebSocket â â ââ?Other clients
â? â? â? âââ?trigger âââºâ¤ âââ?re-render
âââ?push notification
Mockups
Not pixel-final â?just enough that the reviewer and implementer agree on layout and placement.
### A · Thread Inside an Open Task Card
ââââââââââââââââââââââââââââââââââââââââ?â? Ship onboarding empty-state rewrite â?â? BIR-1142 · Assigned to Priya · Due â?ââââââââââââââââââââââââââââââââââââââââ?â? Priya: Should we add an illustration?â?â? You: Yes, let me mock it up â?â? â?â? âââââââââââââââââââââââââââââââââââ?â?â? â?Add a comment... Post â?â?â? âââââââââââââââââââââââââââââââââââ?â?ââââââââââââââââââââââââââââââââââââââââ?
### B · Sidebar Unread Digest
ââââââââââââââââââââââââââââââââââââââââ?â?ð´ Jonah commented on BIR-1142 â?â? "Should the illustration swap..." â?â?ðµ Aiko mentioned you on BIR-1098 â?â? "@priya can you confirm..." â?ââââââââââââââââââââââââââââââââââââââââ?```
## Risk Table
| Risk | Likelihood | Impact | Mitigation |
|------|-----------|--------|------------|
| Migration locks table during deploy | Medium | High | Run with `CONCURRENTLY`; schedule off-peak |
| Realtime subscription leaks memory | Low | Medium | Add max-subscription cap; monitor heap |
| Feature flag not ramped correctly | Medium | Medium | Auto-alert if flag stuck > 3 days |
## Bite-Sized Task Granularity
**Each step is one action (2-5 minutes):**
- "Write the failing test" â?step
- "Run it to make sure it fails" â?step
- "Implement the minimal code to make the test pass" â?step
- "Run the tests and make sure they pass" â?step
- "Commit" â?step
## Task Structure
```markdown
### Task N: [Component Name]
**Files:**
- Create: `exact/path/to/file.py`
- Modify: `exact/path/to/existing.py:123-145`
- Test: `tests/exact/path/to/test.py`
**Step 1: Write the failing test**
[code block]
**Step 2: Run test to verify it fails**
Run: `pytest tests/path/test.py::test_name -v`
Expected: FAIL with "function not defined"
**Step 3: Write minimal implementation**
[code block]
**Step 4: Run test to verify it passes**
Run: `pytest tests/path/test.py::test_name -v`
Expected: PASS
**Step 5: Commit**
```bash
git add tests/path/test.py src/path/file.py
git commit -m "feat: add specific feature"
Execution Handoff
After saving the plan, offer execution choice:
"Plan complete and saved to docs/plans/<filename>.md. Two execution options:
- Subagent-Driven (this session) â?I dispatch fresh subagent per task, review between tasks
- Parallel Session (separate) â?Open new session with executing-plans, batch execution with checkpoints
Which approach?"
