Agent skill
implement
This skill should be used when the user asks to "implement phase N", "implement task T001", "do TDD for phase", "implement T001-T009", or wants to execute tasks following strict TDD red-green-refactor workflow.
Install this agent skill to your Project
npx add-skill https://github.com/ianphil/my-skills/tree/main/implement
SKILL.md
Implement
User Input
PHASE_OR_TASK = $ARGUMENT
Accept and use user input (ARGUMENT). Valid formats:
- A phase name (e.g., "Phase 1", "US1", "Phase 3")
- A specific task ID (e.g., "T001", "T017-T028")
- A task range (e.g., "T001-T009")
Context Loading
- Identify the current feature ID from the git branch (e.g.,
feature/001-mcp-integration→001-mcp-integration) - Find the feature folder: check
backlog/plans/{feature-id}/first, thenbacklog/plans/_completed/{feature-id}/ - Read
{feature-path}/tasks.mdto get task list - Read
specs/tests/{feature-id}.mdif it exists
Phase Execution
If the input is a phase name:
Phase Entry: Spec Tests (RED)
- Find the phase's entry spec test task (e.g., "T016 [SPEC] Run spec tests for FR-3...")
- Run the spec tests specified in that task
- Expected: ALL FAIL (requirements not yet implemented)
- If any pass unexpectedly, report and ask user to verify
Task Execution Loop
- For each task in the phase:
- [TEST] tasks: Write failing tests first
- Run tests:
cargo test {module} --lib→ expect FAIL (RED)
- Run tests:
- [IMPL] tasks: Implement minimal code to pass tests
- Run tests:
cargo test {module} --lib→ expect PASS (GREEN)
- Run tests:
- [SPEC] tasks: Skip during main loop (handled at phase boundaries)
- Mark task as completed in
tasks.md(check the box) - Run
make lintto ensure code quality - Commit after each logical group of tasks (2-3 tasks)
- [TEST] tasks: Write failing tests first
Phase Exit: Spec Tests (GREEN)
- Find the phase's exit spec test task (e.g., "T029 [SPEC] Run spec tests for FR-3...")
- Run the spec tests specified in that task
- Expected: ALL PASS (requirements satisfied)
- If any fail, identify which implementation tasks need revision
Task-Specific Execution
If the input is a task ID or range:
- Read the task description from
tasks.md - Check dependencies (if task has prerequisites, verify they're completed)
- Execute based on task type:
- [TEST]: Write tests, run them → expect FAIL
- [IMPL]: Implement code, run tests → expect PASS
- [SPEC]: Run spec tests as specified in task description
- Mark task as completed in
tasks.md - Run
make check && make lintto verify
TDD Rules
For Rust code, strictly follow Red-Green-Refactor:
- RED: Write failing test first → run
cargo test→ see failure - GREEN: Write minimal code to pass → run
cargo test→ see pass - REFACTOR: Clean up code → run
cargo test→ keep passing
For bash/scripts, implement directly without TDD.
Extensive Mocking Detection
STOP and ask the user when a [TEST] task would require:
- Mocking an entire external system (MCP server, database, HTTP server)
- Creating complex fake implementations with multiple methods/traits
- Spawning actual processes or network connections in unit tests
- More than 50 lines of mock/stub code to test a single function
Signs you're over-mocking:
- The mock is as complex as the real implementation
- Simulating protocol handshakes or connection lifecycle is required
- Tests require async runtime setup for fake services
- Mock state management becomes a testing problem itself
When detected, ask the user:
⚠️ Task {TASK_ID} requires extensive mocking to unit test.
The test would need to mock: {what needs mocking}
Options:
1. **Defer to integration test** - Implement first, test with real/echo server later
2. **Simplify test scope** - Test only pure functions, defer interaction tests
3. **Proceed with mocking** - Accept complexity, write the mock
Which approach do you prefer?
Typical resolution:
- Change [TEST] task to [INTEG] and move to integration phase
- Implement the code first, then write integration tests with real servers
- Update tasks.md to reflect the change
Verification
Before marking phase complete:
- All unit tests pass:
make test-{module} - All spec tests pass:
python specs/tests/run_tests_claude.py specs/tests/{feature-id}.md - Linting passes:
make lint - Build succeeds:
make build
Finally (REQUIRED)
After implementation is complete, follow in this order:
- Run
/progressto generate session log in.ai/YYYY-MM-DD/ - Run
/committo commit any remaining changes - Close GitHub issue if specified
This step is mandatory - do not skip the progress log.
Example Usage
/implement "Phase 1" # Implement entire Phase 1 (Setup)
/implement "US1" # Implement User Story 1 phase
/implement "T001" # Implement single task
/implement "T017-T028" # Implement task range
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
commit
This skill should be used when the user asks to "commit changes", "push my code", "commit and push", "save my work", or wants to stage all changes and push to remote.
prime-feat
This skill should be used when the user asks to "load feature context", "resume feature work", "prime feature N", "continue feature N", or wants to load all planning artifacts for a specific feature number.
implement-agents
This skill should be used when the user asks to "implement in parallel", "run phases concurrently", "parallel implement", "implement-agents phase X phase Y", or wants to orchestrate multiple agents running /implement simultaneously.
code-walkthrough
Generate structured, hallucination-proof code walkthroughs using Showboat. Use when the user asks to "walk me through this code", "explain this codebase", "create a walkthrough", "document how this works", "give me a tour of this repo", or wants a readable narrative document that explains code with real verified snippets. Also triggers on "showboat", "linear walkthrough", or "code documentation". Not for quick code questions — this produces a full markdown document.
ainotes
This skill should be used when the user asks to "consolidate notes", "summarize ainotes", "clean up notes", "ainotes", or wants to consolidate accumulated agent observations into a compact summary.
work-plan
This skill should be used when the user asks to "show work plan", "what's the plan for feature N", "show progress", "view execution plan", or wants to see phase breakdown, progress status, and next actions for a feature.
Didn't find tool you were looking for?