Development
Incremental Implementation
Delivers changes incrementally. Use when implementing any feature or change that touches more than one file.
Delivers changes incrementally. Use when implementing any feature or change that touches more than one file.
Build in thin vertical slices — implement one piece, test it, verify it, then expand.
┌──────────────────────────────────────┐
│ │
│ Implement ──→ Test ──→ Verify ──┐ │
│ ▲ │ │
│ └───── Commit ◄─────────────┘ │
│ │ │
│ ▼ │
│ Next slice │
│ │
└──────────────────────────────────────┘
For each slice:
Build one complete path through the stack:
Slice 1: Create a task (DB + API + basic UI)
→ Tests pass, user can create a task via the UI
Slice 2: List tasks (query + API + UI)
→ Tests pass, user can see their tasks
Slice 3: Edit a task (update + API + UI)
→ Tests pass, user can modify tasks
Slice 4: Delete a task (delete + API + UI + confirmation)
→ Tests pass, full CRUD complete
Tackle the riskiest piece first:
Slice 1: Prove the WebSocket connection works (highest risk)
Slice 2: Build real-time task updates on the proven connection
Slice 3: Add offline support and reconnection
Before writing any code, ask: "What is the simplest thing that could work?"
SIMPLICITY CHECK:
✗ Generic EventBus with middleware pipeline for one notification
✓ Simple function call
✗ Abstract factory pattern for two similar components
✓ Two straightforward components with shared utilities
✗ Config-driven form builder for three forms
✓ Three form components
Touch only what the task requires. Do NOT "clean up" adjacent code.
Each increment changes one logical thing. Don't mix concerns.
After each increment, the project must build and existing tests must pass.
const ENABLE_TASK_SHARING = process.env.FEATURE_TASK_SHARING === 'true';
if (ENABLE_TASK_SHARING) {
// New sharing UI
}
New code should default to safe, conservative behavior:
export function createTask(data: TaskInput, options?: { notify?: boolean }) {
const shouldNotify = options?.notify ?? false;
// ...
}
Each increment should be independently revertable.
After each increment:
npm test)npm run build)npx tsc --noEmit)npm run lint)After completing all increments for a task: