| name | incremental-implementation |
| description | Build in thin vertical slices โ implement one piece, test it, commit, then expand. Use when any change touches more than one file, when a task feels too large to land in one step, or when you are tempted to write more than 100 lines before running tests. |
Incremental Implementation
Overview
Build one complete slice at a time. Each slice is implemented, tested, verified, and committed before the next begins. This keeps the system in a working state at every step, makes bugs easy to localize, and ensures you never lose more than one increment of work.
When to Use
- Implementing any multi-file change
- Building a new feature from a task breakdown
- Refactoring existing code across files
- Any time you are about to write more than ~100 lines before testing
Skip when: the change is a single function in a single file with obvious scope.
The Increment Cycle
Implement โ Test โ Verify โ Commit โ Next slice
โฒ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
For each slice:
- Implement the smallest complete piece of functionality
- Test โ run the test suite or write a test if none exists
- Verify โ confirm it works (tests pass, build succeeds, visual check)
- Commit โ save progress with a descriptive message
- Continue to the next slice
Soft slice auto-commit rhythm
์ด ๋จ๊ณ๋ ํ๋ ๋ธ๋ก์ด ์๋๋ผ ๊ธฐ๋ณธ ๋ฆฌ๋ฌ์ด๋ค. slice๊ฐ ์๋ฃ๋๊ณ ๊ฐ์ฅ ๊ฐ๊น์ด ๊ฒ์ฆ์ด ํต๊ณผํ๋ฉด, ๋ค์ slice๋ก ๋์ด๊ฐ๊ธฐ ์ ์ ํ์ฌ slice diff๋ฅผ ์ปค๋ฐ ํ๋ณด๋ก ๋ค๋ฃฌ๋ค.
GIT_OPTIONAL_LOCKS=0 git status --short --branch์ git diff --stat์ผ๋ก ํ์ฌ slice ๋ณ๊ฒฝ๋ง ์๋์ง ํ์ธํ๋ค.
work_context action=commit_plan์ผ๋ก currentSlice scope ๊ธฐ๋ฐ auto_commit JSON plan์ ๋ง๋ ๋ค.
- plan์
message, paths, push ๋์์ ์ฝ์ด ๊ด๋ จ ์๋ ํ์ผ์ด ์์ด์ง ์์๋์ง ํ์ธํ๋ค.
- ํ commit entry์ primary path๊ฐ 3๊ฐ ์ด์์ด๋ฉด
auto_commit diff-aware logical atom gate๊ฐ diff ์, layer mix, cluster/surface fan-out์ ํ๊ฐํ๋ค. warning allow๊ฐ ์๋ block์ด๋ฉด source/test/generated/schema companion ๊ด๊ณ๊ฐ ๋ซํ๋ ๋ ์์ commit์ผ๋ก ์ชผ๊ฐ ๋ค.
- ์ ์ ํ๋ฉด
auto_commit action=apply planPath=<planPath>๋ฅผ ํธ์ถํ๋ค. plan์ push๊ฐ ์์ผ๋ฉด commit+push๊น์ง ์๋ฃ๋๋ค.
auto_commit ๊ฒฐ๊ณผ๊ฐ push: skipped์ด๊ณ ์ฌ์ฉ์๊ฐ push ๋ณด๋ฅ๋ฅผ ์ง์ํ์ง ์์๋ค๋ฉด, ์ฆ์ git push๊น์ง ๋๋ธ ๋ค ๋ณด๊ณ ํ๋ค.
- ์์ง slice๊ฐ ๋ถ์์ ํ๊ฑฐ๋ ๊ฒ์ฆ ์ ์ด๋ฉด ์ปค๋ฐ์ ๋ฏธ๋ฃจ๋,
work_context action=checkpoint์ ์ด์ ๋ฅผ ๋จ๊ธด๋ค.
์ฌ์ฉ์๊ฐ ๋ช
์์ ์ผ๋ก โ์ปค๋ฐํ์ง ๋งโ๋ผ๊ณ ํ๊ฑฐ๋, ํ์ฌ slice๊ฐ ์์ง ๊ฒ์ฆ๋์ง ์์๊ฑฐ๋, ๊ด๋ จ ํ์ผ์ ๋ถ๋ฆฌํ๋ฉด ๋น๋๊ฐ ๊นจ์ง๋ ๊ฒฝ์ฐ์๋ ์ปค๋ฐ์ ๋ณด๋ฅํ ์ ์๋ค. ํ์ง๋ง ๋ง์ง๋ง์ โ๊ตฌํ์ ๋๋ฌ๋๋ฐ ์ปค๋ฐ ์ ๋จโ์ผ๋ก ๋๋ผ๊ฒ ํ์ง ์๋๋ค.
Long-running checkpoint rhythm
๊ธด ์์
์ ๊ตฌํ ์์ฒด๋ณด๋ค ๋ณด๊ณ stop-line์ด ๋ฌด๋์ง ๋ ์ฌ์ฉ์-visible ์คํจ๊ฐ ๋๋ค. ๋ค์ checkpoint๋ฅผ ๊ธฐ๋ณธ ๋ฆฌ๋ฌ์ผ๋ก ๋๋ค.
- 30๋ถ ๊ฒฝ๊ณผ: ํ์ฌ phase, ์๋ฃํ ๊ฒ, ๋จ์ ๊ฒ, ์ฐจ๋จ ๊ฐ๋ฅ์ฑ์ ์งง๊ฒ ๋ณด๊ณ ํ๋ค.
- 60๋ถ ๊ฒฝ๊ณผ: ๊ณ์ ์งํํ ์ง, ๋ถ๋ถ ์ปค๋ฐ/๋ถ๋ถ handoff๋ก ๋์์ง ํ์ธํ๋ค.
- ๊ฐ์ ๊ฒ์ฆ ๊ณ์ด 2ํ ์คํจ: lint/test/type-check/codegen ๋ฃจํ๋ฅผ ๊ณ์ ๋๊ธฐ ์ ์ ์์ธ, ์์ ํ ๊ฒ, ๋จ์ ์ ํ์ง๋ฅผ ๋ณด๊ณ ํ๋ค.
- phase ์ ํ: ๊ตฌ์กฐ ํ์
โ ๊ตฌํ โ ๊ธฐ๊ณ ๊ฒ์ฆ โ ์ปค๋ฐ โ UI/์๋ ๊ฒ์ฆ โ PR/push๋ก ๋์ด๊ฐ ๋ ์ต์ ํ ์ค checkpoint๋ฅผ ๋จ๊ธด๋ค.
- ํ๊ฒฝ ๊ฒ์ฆ ์ฐจ๋จ: ๋ก์ปฌ ์๋ฒ, ๋ก๊ทธ์ธ, ๊ถํ, ๋ฐ์ดํฐ ์ธํ
๋ฌธ์ ๋ 5~10๋ถ ์ด์ main flow๋ฅผ ๋ถ์ก์ง ๋ง๊ณ
BLOCKED ๋๋ ์ ํ์ง๋ก ๋ณด๊ณ ํ๋ค.
continue/compaction ์ดํ์๋ current context card์ current slice๋ฅผ ์ฐ์ ์ ๋ขฐํ๋ค. ์ด๋ฏธ discovery/frame์ด ์์ผ๋ฉด broad rediscovery๋ก ์๊ฐ์ ์ฐ์ง ๋ง๊ณ , ํ์ฌ claim/evidence๋ฅผ ๋ซ๋ ํ์ผ๋ง ์ข๊ฒ ํ์ธํ๋ค.
Context hoarding๋ณด๋ค slice closure
ํฐ transcript๋ฅผ ์ค๋ ๋ค๊ณ ๊ฐ๋ ๊ฒ๋ณด๋ค, ํ์ฌ slice๋ฅผ ์๊ฒ ๋ซ๋ ๊ฒ์ด ์ฐ์ ์ด๋ค.
๊ฐ slice๋ ๋ค์์ ๊ฐ์ ธ์ผ ํ๋ค.
- Claim: ๋ฌด์์ด true์ฌ์ผ ํ๋๊ฐ
- Scope: ์ด๋ค ํ์ผ/๊ฒฝ๋ก๋ง ๊ฑด๋๋ฆฌ๋๊ฐ
- Evidence: ์ด๋ค ๋ช
๋ น/์บก์ฒ/๋ก๊ทธ/artifact๋ก ๋ซ๋๊ฐ
- Gap: ์ง๊ธ ๋ซ์ง ๋ชปํ ๊ฒ์ ๋ฌด์์ธ๊ฐ
์ด ๋ค ๊ฐ์ง๊ฐ ์์ผ๋ฉด ๋ค์ slice๋ก ๋์ด๊ฐ์ง ์๋๋ค. ์ค๋๋ ๋งฅ๋ฝ์ ์ฐธ๊ณ ์๋ฃ์ผ ๋ฟ์ด๊ณ , ํ์ฌ slice์ claim/evidence๊ฐ ํ์ฌ truth๋ค.
Slicing Strategies
Vertical Slices (Preferred)
Build one complete path through the stack at a time:
Slice 1: Create task (schema + API + minimal UI) โ tests pass, user can create
Slice 2: List tasks (query + API + UI) โ tests pass, user can see tasks
Slice 3: Edit task (update + API + UI) โ tests pass, user can modify
Slice 4: Delete task (delete + API + confirmation) โ tests pass, full CRUD done
Each slice delivers working end-to-end functionality.
Contract-First Slicing
When backend and frontend develop in parallel:
Slice 0: Define the API contract (types, interfaces)
Slice 1a: Backend implements against the contract + API tests
Slice 1b: Frontend implements against mock data matching the contract
Slice 2: Integrate and test end-to-end
Risk-First Slicing
Tackle the most uncertain piece first:
Slice 1: Prove the WebSocket connection works (highest risk)
Slice 2: Build real-time updates on the proven connection
Slice 3: Add offline support and reconnection
If slice 1 fails, you discover it before investing in slices 2 and 3.
Rules
Workflow Weight Calibration
์์
์ ์ฐจ๋ ๊ตฌํ์ฒ๋ผ ์์ ๋จ์์ฌ์ผ ํ๋ค. ๋จ์ผ copy/hotfix/๋ฆฌ๋ทฐ ๋ฐ์์ฒ๋ผ ์ํฅ ์ถ์ด ์ข์ ์์
์ full TFT cycle, ๋ํ worker fan-out, capture-heavy report๋ฅผ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์น์ง ์๋๋ค.
๋จผ์ ์์
๋ฌด๊ฒ๋ฅผ ์ ํ๋ค.
| ๋ฌด๊ฒ | ์ ํธ | ์ ์ฐจ |
|---|
| light | ํ์ผ 1~2๊ฐ, route/role/data 1๊ฐ, side effect ์์ | GIT_OPTIONAL_LOCKS=0 git status โ focused ์์ โ ๊ฐ์ฅ ๊ฐ๊น์ด ๊ฒ์ฆ 1๊ฐ โ ์ปค๋ฐ โ push. PR/branch ํ์ธ์ ์ฌ์ฉ์๊ฐ ๋ช
์ํ๊ฑฐ๋ push ์คํจยทrejected ๋๋ง |
| standard | UI/BE/event ์ค 2~5๊ฐ ์ถ | frame/verify ๋๋ verify-report๋ฅผ ์ถ ์๋งํผ ์ฌ์ฉ |
| full | ๋ค์ค role/viewport/before-after/DB/์ ์ฑ
ํ๋จ | TFT + worker fan-out + report๋ฅผ ๋ช
์ ๊ณํ ๋ค์ ์ฌ์ฉ |
ํฐ ์ ์ฐจ๋ฅผ ์ฐ๋ ์ด์ ๋ฅผ ํ ๋ฌธ์ฅ์ผ๋ก ์ค๋ช
ํ ์ ์์ผ๋ฉด ์ ์ฐจ๋ฅผ ์ค์ธ๋ค. ๋ฐ๋๋ก light๋ก ์์ํ๋๋ฐ ๊ฒ์ฆ ์ถ์ด ๋์ด๋๋ฉด ๊ทธ๋ standard/full๋ก ์น๊ฒฉํ๋ค. ๋จ์ผ ๋ฌธ๊ตฌ/CTA/์์ ๋ฆฌ๋ทฐ ๋ฐ์์์๋ self-healing, stress-interview, subagent fan-out, capture-heavy verify-report๋ฅผ ๊ธฐ๋ณธ ์คํํ์ง ์๋๋ค.
Tool result ์ดํ์ ํ๋จ ์๊ฐ๋ ๋ฌด๊ฒ์ ๋ง์ถ๋ค. none/light ํ๋ณยท์ด์ triage๋ 30์ด ์์ ๋ค์ ์ข์ tool call, ์ค๊ฐ ๊ฒฐ๋ก , scope-gate ์ง๋ฌธ, ์ต์ข
๋ณด๊ณ ์ค ํ๋๋ก ์ ํํ๋ค. standard๋ 60์ด, full์ 120์ด๋ฅผ ๊ธฐ๋ณธ ์์ฐ์ผ๋ก ์ผ๊ณ , ๊ทธ ์ด์ ์กฐ์ฉํ ๊ณ ๋ฏผํด์ผ ํ๋ฉด ํ์ฌ ๊ฒฐ๋ก ๊ณผ ๋จ์ gap์ ๋จผ์ ๋ณด๊ณ ํ๋ค.
Simplicity First
Before writing code, ask: "What is the simplest thing that could work?"
Not this: generic EventBus with middleware for one notification
This: a direct function call
Not this: abstract factory for two similar components
This: two straightforward components with shared utilities
Not this: config-driven form builder for three forms
This: three form components
Three similar lines of code are better than a premature abstraction. Implement the naive, correct version first. Generalize only when the third use case demands it.
Scope Discipline
Touch only what the task requires.
Do not:
- clean up adjacent code
- refactor imports in files you are not modifying
- add features not in the spec
- modernize syntax in files you are only reading
If you notice something worth improving outside scope, note it but do not fix it:
NOTICED (not touching):
- src/utils/format.ts has an unused import (unrelated to this task)
- The auth middleware could use better error messages (separate task)
One Thing at a Time
Each increment changes one logical thing. Do not combine a new component, a refactor of an existing one, and a build config update in one commit.
Keep It Compilable
After each increment, the project must build and all existing tests must pass. Never leave the codebase broken between slices.
Feature Flags for Incomplete Work
If a feature is not ready for users but you need to merge increments to the default branch:
if (flags.taskSharing) {
// new sharing UI
}
This lets you merge small increments without exposing incomplete functionality.
Rollback-Friendly
Each increment should be independently revertable:
- Additive changes (new files, new functions) are easy to revert
- Modifications to existing code should be minimal and focused
- Database migrations should have corresponding rollbacks
Common Rationalizations
| Rationalization | Reality |
|---|
| "I will test everything at the end" | Bugs compound. A bug in slice 1 makes slices 2 through 5 wrong. Test each slice. |
| "It is faster to do it all at once" | It feels faster until something breaks and you cannot find which of 500 lines caused it. |
| "These changes are too small to commit separately" | Small commits are free. Large commits hide bugs and make rollbacks painful. |
| "I will add the feature flag later" | If the feature is not complete, it should not be visible. Add the flag now. |
| "This refactor is small enough to include" | Refactors mixed with features make both harder to review and debug. Separate them. |
Red Flags
- More than 100 lines written without running tests
- Multiple unrelated changes in a single increment
- Scope expansion ("let me just quickly add this too")
- Skipping test/verify to move faster
- Build or tests broken between increments
- Large uncommitted changes accumulating
- Building abstractions before the third use case
- Touching files outside the task scope
Verification
After completing all increments for a task: