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.
What this skill does
# 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
1. Identify the current feature ID from the git branch (e.g., `feature/001-mcp-integration` → `001-mcp-integration`)
2. Find the feature folder: check `backlog/plans/{feature-id}/` first, then `backlog/plans/_completed/{feature-id}/`
3. Read `{feature-path}/tasks.md` to get task list
4. Read `specs/tests/{feature-id}.md` if 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:
1. **[TEST] tasks**: Write failing tests first
- Run tests: `cargo test {module} --lib` → expect FAIL (RED)
2. **[IMPL] tasks**: Implement minimal code to pass tests
- Run tests: `cargo test {module} --lib` → expect PASS (GREEN)
3. **[SPEC] tasks**: Skip during main loop (handled at phase boundaries)
4. Mark task as completed in `tasks.md` (check the box)
5. Run `make lint` to ensure code quality
6. Commit after each logical group of tasks (2-3 tasks)
### 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:
1. Read the task description from `tasks.md`
2. Check dependencies (if task has prerequisites, verify they're completed)
3. 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
4. Mark task as completed in `tasks.md`
5. Run `make check && make lint` to verify
## TDD Rules
For Rust code, strictly follow Red-Green-Refactor:
1. **RED**: Write failing test first → run `cargo test` → see failure
2. **GREEN**: Write minimal code to pass → run `cargo test` → see pass
3. **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:
1. **Run `/progress`** to generate session log in `.ai/YYYY-MM-DD/`
2. **Run `/commit`** to commit any remaining changes
3. Close GitHub issue if specified
This step is **mandatory** - do not skip the progress log.
## Example Usage
```bash
/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
```
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.