| name | implement-task |
| description | Implement the current in-progress task |
Skill: implement-task
Load Context
- Scan
task-state/ for a task with state: "in_progress"
- Read that task's full fields (title, description, acceptanceCriteria, dependencies)
- Read the relevant sections of
docs/modules/<feature>/SPEC.<feature>.md
- Read
.claude/rules/coding.md and .claude/rules/architecture.md
- Use Glob/Grep to survey existing code in the affected area
Pre-checks
- If no
in_progress task exists ā abort: "No task is in progress. Run /start-feature <feature> first."
- If the current git branch is not
feat/<feature> ā warn the user and ask whether to continue.
- If a dependency task is not yet
committed ā list the unfinished dependencies and abort.
Steps
Step 1: Present implementation plan
Before writing any code, output the plan so the user can review it:
š Implementation plan: [task-NN] <title>
Files to create/modify:
- src/modules/<feature>/<file>.ts [new]
- src/modules/<feature>/<file>.ts [modify]
...
Approach:
<2ā3 sentences describing the core logic>
Raise any concerns now, otherwise implementation will begin.
Wait for user confirmation (or 3 seconds of silence), then proceed.
Step 2: Implement
If the task spans multiple layers, implement in this order:
- Type definitions / interfaces
- Repository layer (data access)
- Service layer (business logic)
- Controller / Route layer (HTTP interface)
- Tests (written alongside the implementation, not deferred)
Rules:
- Do not implement anything beyond the task's acceptance criteria
- Do not modify files owned by other tasks (unless necessary ā explain why)
- Keep each function/method under 30 lines; extract helpers if exceeded
Step 3: Run tests
Run the test command for the affected module (refer to docs/TECH_STACK.md):
On test results:
- All pass ā proceed to Step 4
- Failures:
- 1st failure: read the error, locate root cause, fix, re-run
- 2nd failure: re-analyse, try a different fix approach, re-run
- 3rd failure: stop retrying ā go to Error Handling
Step 4: Update task state
{
"state": "implemented",
"updatedAt": "<current ISO timestamp>",
"notes": "<any notable implementation decisions>"
}
Inform the user: "Implementation complete. Run /verify-task to verify."
Error Handling
| Situation | Action |
|---|
| Tests fail 3 times consecutively | Output: "Failed after 3 attempts. Root cause: ". Set state to failed, record details in notes. Suggest running /recover-task. |
| SPEC contradicts actual requirements | Pause, explain the contradiction to the user, wait for clarification before continuing |
| Task requires modifying files from another module | Ask: "This task requires modifying (owned by another module). Proceed?" |
| Required third-party package is not installed | List missing packages, output the install command, wait for the user to run it |
Done When