Start Implementation Command
PRIMARY OBJECTIVE
Implement features systematically with comprehensive tracking on feature branches.
Three modes of operation:
- Start — Begin implementation from scratch
- Continue — Resume in-progress implementation
- Address CR — Apply code review feedback
Before any work, determine which mode applies by reviewing the task document status and git history.
CONSTRAINTS
- Follow existing task document in
tasks/ directory
- Git writes require explicit user permission:
- Do NOT create commits, push branches, open PRs, merge, rebase, or otherwise modify git state unless the user explicitly approves it.
WORKFLOW STEPS
STEP 1: Task Validation
Ask user: "Which task to implement? Provide task name or path." If it was not provided
- List tasks in
tasks/ if unclear
Validate document:
- Confirm the task exists (either a single
.md file OR a tasks/task-YYYY-MM-DD-slug/ directory).
- Confirm scope is unambiguous:
- Clear acceptance criteria
- Clear "done" definition (what must be true for completion)
- Confirm task status is appropriate (e.g., "Ready for Implementation" vs "Draft") and ask before proceeding if unclear.
- Confirm Linear issue exists and is referenced (ID/link).
- Confirm there is an implementation plan (even if small): impacted components + test plan.
STEP 2: Setup
Note: Skip this step when continuing implementation or addressing Code Review Results
Status Updates
- Update task status to "In Progress" with timestamp
- Create feature branch (name must follow repo convention):
feature/wyt-[ID]-[slug]
- Update task document with branch name
- Permission gate: If any git operation is required (branch creation, commit, push), ask for explicit approval first.
STEP 3: Implementation
Parallelization (optional)
If you believe part of the work can be done safely in parallel, use the parallelization skill:
.claude/skills/parallelization/SKILL.md
Sequential Mode
Before Each Step:
- Announce: "Starting Step [N]: [Description]"
- Review requirements: Acceptance criteria, tests, artifacts
During Implementation (TDD Approach):
- Follow agreed Test Plan: Implement tests based on the Test Plan approved during task creation (Gate 2)
- TDD Red-Green-Refactor Cycle: Follow strict Test-Driven Development:
- RED: Write failing tests first according to approved test plan
- GREEN: Write minimal code to make tests pass
- REFACTOR: Clean up code while keeping tests green
- Implement tests by approved categories:
- Business Logic Tests: As/if defined in approved test plan
- State Transition Tests: As/if defined in approved test plan
- Error Handling Tests: As/if defined in approved test plan
- Integration Tests: As/if defined in approved test plan
- User Interaction Tests: As/if defined in approved test plan
- Testing tools:
- Prefer silent scripts in AI-agent mode (backend):
npm run test:silent, npm run test:unit:silent, npm run test:integration:silent, npm run test:e2e:silent
- Local runs are fine with
npm run test when you need full output
npm run test:ci when the Postgres-backed integration suite is required
npm run test:db:start|migrate|stop scripts to spin up and tear down the Supabase-compatible test DB
- TDD Verification: All tests from approved plan must pass before proceeding to next step
After Each Step:
Update the task document (REQUIRED - not just chat output):
- Mark the step checkbox as complete:
- [ ] → - [x]
- Add Changelog entry describing what was done
- Update Tests field with command run + result
- If tests are defined in the Test Plan section, mark those checkboxes too
- Parallel mode note: when using parallel workers, workers should not edit shared task docs; apply/merge worker outputs first, then update the task doc once to avoid conflicts.
Example of updating a step in the task doc:
- [x] Sub-step 3.1: Update CreateSessionUseCase logic
- **Tests**: Test Suite 3 - PASS
- **Changelog**: Injected WordGroupService, added validateGroupHasSufficientWords() method
Commit changes (permission gate):
- If the user has not explicitly approved git writes: ask for permission before any
git command.
- If approved and the step is complete: use conventional commits (optionally include scope) and include an issue reference when applicable:
git add [files] && git commit -m "feat|fix|refactor: [step summary]" -m "Refs: WYT-123"
Error Recovery
- Tests fail: Fix the failing code, re-run tests. Do NOT skip or delete failing tests.
- Quality gate fails: Read the Quality Gate Report, address each failure, re-run.
- Task document incomplete: Ask user to clarify missing criteria before proceeding.
STEP 4: Completion
Final Verification
- Run quality gates via agent:
- Use Task tool with subagent_type: "automated-quality-gate"
- Provide
task_path (absolute path to tasks/task-YYYY-MM-DD-slug/) and current branch
- Agent runs format/lint/types/tests/build and writes a Quality Gate Report in the task directory
Finalize Task Document
- Update status to "Ready for Review" with timestamp
- Verify all checkboxes are accurate
- Add implementation summary
STEP 5: Prepare for Code Review
Permission gate (required):
- Creating a PR and pushing branches requires explicit user approval for git writes.
- If approval is not given, stop and ask for permission before proceeding.
Validate task documentation:
- Use Task tool with subagent_type: "task-pm-validator"
- Provide the exact task document path (e.g.,
tasks/task-2025-01-15-feature-name.md)
Create PR + sync Linear (single path):
- Use Task tool with subagent_type: "create-pr-agent"
- Provide the exact task document path (e.g.,
tasks/task-2025-01-15-feature-name.md)
- This agent handles PR creation and updates the task document with PR links. For Linear updates use the
cc-linear skill (.claude/skills/cc-linear/SKILL.md).
1---2name: si-23description: Execute structured TDD implementation following task documents. Use when starting, continuing, or resuming implementation of a task from tasks/ directory. Also handles addressing code review feedback.4---5
6# Start Implementation Command
7
8## PRIMARY OBJECTIVE
9Implement features systematically with comprehensive tracking on feature branches.
10
11Three modes of operation:
121. **Start** — Begin implementation from scratch
132. **Continue** — Resume in-progress implementation
143. **Address CR** — Apply code review feedback
15
16Before any work, determine which mode applies by reviewing the task document status and git history.
17
18## CONSTRAINTS
19- Follow existing task document in `tasks/` directory
20- Git writes require explicit user permission:
21 - Do **NOT** create commits, push branches, open PRs, merge, rebase, or otherwise modify git state unless the user explicitly approves it.
22
23## WORKFLOW STEPS
24
25### **STEP 1: Task Validation**
26
271. **Ask user**: "Which task to implement? Provide task name or path." If it was not provided
28 - List tasks in `tasks/` if unclear
29
302. **Validate document**:
31 - Confirm the task exists (either a single `.md` file OR a `tasks/task-YYYY-MM-DD-slug/` directory).
32 - Confirm scope is unambiguous:
33 - Clear acceptance criteria
34 - Clear "done" definition (what must be true for completion)
35 - Confirm task status is appropriate (e.g., "Ready for Implementation" vs "Draft") and ask before proceeding if unclear.
36 - Confirm Linear issue exists and is referenced (ID/link).
37 - Confirm there is an implementation plan (even if small): impacted components + test plan.
38
39### **STEP 2: Setup**
40Note: Skip this step when continuing implementation or addressing Code Review Results
41
42#### **Status Updates**
431. **Update task status** to "In Progress" with timestamp
442. **Create feature branch** (name must follow repo convention): `feature/wyt-[ID]-[slug]`
453. **Update task document** with branch name
464. **Permission gate**: If any git operation is required (branch creation, commit, push), ask for explicit approval first.
47
48### **STEP 3: Implementation**
49
50#### **Parallelization (optional)**
51
52If you believe part of the work can be done safely in parallel, use the `parallelization` skill:
53
54- `.claude/skills/parallelization/SKILL.md`
55
56---
57
58#### **Sequential Mode**
59
60#### **Before Each Step:**
611. **Announce**: "Starting Step [N]: [Description]"
622. **Review requirements**: Acceptance criteria, tests, artifacts
63
64#### **During Implementation (TDD Approach):**
651. **Follow agreed Test Plan**: Implement tests based on the Test Plan approved during task creation (Gate 2)
662. **TDD Red-Green-Refactor Cycle**: Follow strict Test-Driven Development:
67 - **RED**: Write failing tests first according to approved test plan
68 - **GREEN**: Write minimal code to make tests pass
69 - **REFACTOR**: Clean up code while keeping tests green
703. **Implement tests by approved categories**:
71 - **Business Logic Tests**: As/if defined in approved test plan
72 - **State Transition Tests**: As/if defined in approved test plan
73 - **Error Handling Tests**: As/if defined in approved test plan
74 - **Integration Tests**: As/if defined in approved test plan
75 - **User Interaction Tests**: As/if defined in approved test plan
764. **Testing tools**:
77 - Prefer silent scripts in AI-agent mode (backend): `npm run test:silent`, `npm run test:unit:silent`, `npm run test:integration:silent`, `npm run test:e2e:silent`
78 - Local runs are fine with `npm run test` when you need full output
79 - `npm run test:ci` when the Postgres-backed integration suite is required
80 - `npm run test:db:start|migrate|stop` scripts to spin up and tear down the Supabase-compatible test DB
815. **TDD Verification**: All tests from approved plan must pass before proceeding to next step
82
83#### **After Each Step:**
841. **Update the task document** (REQUIRED - not just chat output):
85 - Mark the step checkbox as complete: `- [ ]` → `- [x]`
86 - Add **Changelog** entry describing what was done
87 - Update **Tests** field with command run + result
88 - If tests are defined in the Test Plan section, mark those checkboxes too
89 - **Parallel mode note**: when using parallel workers, workers should not edit shared task docs; apply/merge worker outputs first, then update the task doc once to avoid conflicts.
90
91 Example of updating a step in the task doc:
92 ```markdown
93 - [x] Sub-step 3.1: Update CreateSessionUseCase logic
94 - **Tests**: Test Suite 3 - PASS
95 - **Changelog**: Injected WordGroupService, added validateGroupHasSufficientWords() method
96 ```
97
982. **Commit changes (permission gate)**:
99 - If the user has **not explicitly approved** git writes: ask for permission **before** any `git` command.
100 - If approved and the step is complete: use **conventional commits** (optionally include scope) and include an issue reference when applicable:
101 - `git add [files] && git commit -m "feat|fix|refactor: [step summary]" -m "Refs: WYT-123"`
102
103#### **Error Recovery**
104- **Tests fail**: Fix the failing code, re-run tests. Do NOT skip or delete failing tests.
105- **Quality gate fails**: Read the Quality Gate Report, address each failure, re-run.
106- **Task document incomplete**: Ask user to clarify missing criteria before proceeding.
107
108### **STEP 4: Completion**
109
110#### **Final Verification**
1111. **Run quality gates via agent**:
112 - Use Task tool with subagent_type: "automated-quality-gate"
113 - Provide `task_path` (absolute path to `tasks/task-YYYY-MM-DD-slug/`) and current `branch`
114 - Agent runs format/lint/types/tests/build and writes a Quality Gate Report in the task directory
115
116#### **Finalize Task Document**
1171. **Update status** to "Ready for Review" with timestamp
1182. **Verify all checkboxes are accurate**
1193. **Add implementation summary**
120
121### **STEP 5: Prepare for Code Review**
1221. **Permission gate (required)**:
123 - Creating a PR and pushing branches requires **explicit user approval** for git writes.
124 - If approval is not given, stop and ask for permission before proceeding.
125
1262. **Validate task documentation**:
127 - Use Task tool with subagent_type: "task-pm-validator"
128 - Provide the exact task document path (e.g., `tasks/task-2025-01-15-feature-name.md`)
129
1303. **Create PR + sync Linear (single path)**:
131 - Use Task tool with subagent_type: "create-pr-agent"
132 - Provide the exact task document path (e.g., `tasks/task-2025-01-15-feature-name.md`)
133 - This agent handles PR creation and updates the task document with PR links. For Linear updates use the `cc-linear` skill (`.claude/skills/cc-linear/SKILL.md`).