| name | feature-track |
| description | Tracked development loop โ first brainstorm + plan and get user approval, THEN checkout a branch, build a task checklist, and loop each item through test โ implement โ verify โ fix โ mark done โ commit (one commit per item). Use when user says "bแบฏt ฤแบงu loop", "lร m track nร y", "tracked loop", "checklist driven dev", "run the loop", "checkout branch and start track", "brainstorm rแปi lร m track", "implement with checklist and commit per task". |
| args | [TASK_DESCRIPTION] |
Tracked Development Loop
Run a multi-step task as a controlled loop: brainstorm + plan first, get approval, THEN checkout a branch, turn the plan into a task checklist, and drive each item through test โ implement โ verify โ fix โ mark done โ commit โ one commit per item.
ARGUMENTS: <task description> โ e.g., wallet savings account, add rate limiting to auth, migrate orders module to events
When to use this skill
- โ
A task that splits into several verifiable steps you want to drive as a checklist
- โ
You want a clean history โ one commit per completed step, easy to revert
- โ
You want test-first discipline on each step, on a dedicated branch
- โ One-line / obvious change โ just do it
- โ Urgent production bug โ use
/fix-bug (QUICK mode)
- โ Single full DDD feature across all layers โ use
/feature-build (NEW mode)
- โ Driving ONE unit test-first with no branch/checklist โ use
/review-code (TDD mode)
Read the project first
Detect stack via ~/.claude/architecture/_shared/stack-detection.md for:
- Test command + test file location convention
- Build + lint commands (for the VERIFY step)
- Mocking pattern for dependencies
Then see ~/.claude/architecture/_shared/read-project-first.md: the checklist and every item's implementation must match the pattern THIS project already uses (read a similar existing feature first) โ not an assumed DDD layout.
Workflow
0 BRAINSTORM & PLAN โโถ [USER APPROVES] โโถ 1 SETUP โโถ โโ 2 LOOP per item โโโโโโโโโโโโโโโโโโโโโโโ โโถ 3 REPORT
(understand, /brainstorm,(last step of (branch + โ TEST โ IMPLEMENT โ VERIFY โ FIX โ โ
plan + draft checklist) planning) checklist) โ MARK DONE โ COMMIT โ
โ โ fail โโถ FIX โโถ VERIFY (to pass) โ
โโโโโโโโโโโโ next pending item โโโโโโโโโโโ
Core rule: brainstorm and plan, the LAST planning step is user approval, THEN start the loop. Never jump straight to branch/checklist.
Phase 0: BRAINSTORM & PLAN
Goal: understand the task deeply, pick the simplest approach that fits THIS project, decompose it into a high-quality checklist, self-critique the plan, and get the user to approve before touching anything. A tracked loop is only as good as this plan โ a sloppy Phase 0 makes the whole loop sloppy, so this is where the rigor goes.
Fast-path: for a trivial/obvious task, collapse steps 3 & 5 into one quick pass โ don't turn a one-item change into ceremony. The rigor below is for real multi-item tasks.
Steps
-
Detect stack + read the project. Get test/build/lint commands (_shared/stack-detection.md), then read 1โ2 existing features closest to this task end-to-end. Write 2โ3 lines capturing the real conventions (structure, naming, where logic lives, test style, wiring) โ this proves you understood the codebase instead of guessing, and it's the pattern every item must match. See _shared/read-project-first.md.
-
Clarify if ambiguous. If scope, acceptance criteria, or edge cases are unclear, ask (AskUserQuestion) before planning. Don't assume.
-
Choose the approach โ brainstorm โฅ2 options. Invoke /brainstorm (First Principles, SCAMPER, Working Backwards, 5 Whysโฆ). Compare options on effort / risk / blast-radius and pick the simplest that fits the project's existing pattern. Note in one line why the runner-up lost.
- Unknown too big? If you can't tell which approach works without building, STOP planning and run
/research-explore (SPIKE) first, then return. Never commit a checklist around a guess.
-
Decompose into a checklist โ every item must pass this rubric:
- Vertical slice โ delivers one behavior testable on its own (not "all models" then "all handlers").
- Independently testable โ a single failing test can describe it.
- Right-sized โ one focused commit; needs two unrelated tests โ split it; can't stand alone โ merge it up.
- Ordered by dependency โ earlier items unblock later ones.
- Matches the project โ files/naming mirror the reference feature from step 1, not a textbook layer.
Any item failing the rubric โ split, merge, or reorder until it passes.
-
Self-challenge the plan โ invoke /challenge. Before showing the user, poke holes: over- or under-engineered? missing an edge case or acceptance criterion? wrong item order? any hidden DB migration / security / performance work? imposing structure this codebase doesn't use? Refine, then present.
-
Present the plan doc and WAIT for approval. The last planning step โ no branch, no code, no TaskCreate yet.
## Track Plan: {task}
### Goal + acceptance
{What "done" means for the whole track โ the observable outcome.}
### Project fit (from step 1)
{The reference feature you read + the conventions each item will follow.}
### Approach
{Chosen approach} โ picked over {runner-up} because {one line}.
### Checklist
| # | Item (vertical slice) | Test that proves it | Files (match reference) |
|---|-----------------------|---------------------|-------------------------|
| 1 | โฆ | โฆ | โฆ |
| 2 | โฆ | โฆ | โฆ |
Proposed branch: `feat/<slug>`
### Risks / rollback
{Edge cases + any DB-migration / security / perf flag to confirm before that item runs.}
Gate
Phase 1: SETUP
Goal: turn the approved plan into a branch + a live checklist. Runs only AFTER approval.
Steps
- Checkout a new branch with the approved name (
feat/<slug>) off the current base. Never run the loop on master / main.
- Create the checklist with
TaskCreate โ one task per checklist item, in order, matching the approved plan.
Gate
Phase 2: LOOP (per item)
Take the next pending item from the task list and run it through the full cycle. Repeat until no pending items remain.
- MARK IN_PROGRESS โ
TaskUpdate the item โ in_progress.
- TEST (RED) โ write a unit test describing the item's behavior. Run it and confirm it fails for the right reason (code missing / assertion fails), not a typo or import error.
- IMPLEMENT (GREEN) โ write the minimal code to make the test pass. Follow an existing reference module so it matches the codebase style.
- VERIFY โ actually run it: the item's test + build + lint (commands per stack). Never claim pass without running.
- FIX โ if anything fails, fix at the root, never swallow the error (handle exceptions explicitly โ no empty catch). Then go back to VERIFY until green.
- MARK DONE โ
TaskUpdate the item โ completed.
- COMMIT โ commit just this item with a conventional message (
feat: / fix: / test: / refactor: โฆ). Commit only โ do not push automatically.
Gate (per item, before moving on)
Phase 3: Final Report
## Track Complete: {task}
Branch: `feat/{slug}`
| # | Item | Test(s) | Commit | Status |
|---|------|---------|--------|--------|
| 1 | {item} | {test name} | {hash} `feat: โฆ` | โ
|
| 2 | {item} | {test name} | {hash} `feat: โฆ` | โ
|
### Totals
- Items: {N} done / {N}
- Commits: {N}
- Tests added: {N}, all green
### Next
- Push + open PR, or run `/review-code` (SELF mode) first
Hard Rules
- Plan + user approval FIRST โ no branch, no code until the plan is approved.
- Branch first โ never run the loop on
master / main.
- RED before GREEN โ no production code that a failing test didn't drive.
- Verify by running real commands โ never assert pass from inspection alone.
- Never swallow errors in FIX โ handle exceptions explicitly, fix the root cause.
- One commit per item โ don't squash steps together, don't push automatically.
- DB operations (migrate / seed / drop) inside any item: CONFIRM with the user before running โ every time, even if a previous item was already confirmed.
- Simple first โ don't overengineer an item.
- Match the project โ every item mirrors an existing feature's structure/naming; never impose DDD/layers the codebase doesn't already use (see
~/.claude/architecture/_shared/read-project-first.md).
Related Skills
| When | Use |
|---|
| Need idea frameworks for Phase 0 | /brainstorm |
| Self-critique the plan in Phase 0 | /challenge |
| De-risk an unknown before planning | /research-explore (SPIKE mode) |
| Drive ONE unit deeper test-first | /review-code (TDD mode) |
| Full feature across the project's own layers | /feature-build (NEW mode) |
| Self-review the branch after the loop | /review-code (SELF mode) |
| Urgent prod bug, no checklist | /fix-bug (QUICK mode) |
Recommended Agents
| Phase | Agent | Purpose |
|---|
| BRAINSTORM / PLAN | @clean-architect | Approach + decomposition |
| TEST | @test-writer | Failing test per item |
| IMPLEMENT | Stack-specific dev agent | Minimal implementation |
| VERIFY / FIX | @code-reviewer | Catch issues before commit |