Implement Feature Skill
[!IMPORTANT]
Implement an approved feature plan with fresh-context slices, TDD, evidence, and PR-ready output.
Optional args: slug=, ticket=<id/url>, mode=interactive|autonomous|channel, channel=, auto_continue=true|false, profile=business|hybrid|technical.
Instructions
When the user asks to perform this workflow, execute the following steps:
Implement Feature Workflow
Goal: Build an approved feature through TDD slices and route completed work to verification.
Steps
- Load plan:
- Search
docs/prd/ and docs/srs/ for a matching [slug]; if absent, use the newest matching artifact.
- If multiple candidates exist, ask the user to choose or input the target slug.
- PRD or ticket
- SRS/FRS technical design if present
- Implementation plan
- Matched framework and common skills
- If stable
REQ-*, AC-*, trace, or required SRS/test lanes are missing, stop and route to plan-feature, design-solution, or implementation-readiness.
- Prepare workspace:
- Confirm clean or intentionally dirty git state.
- Create branch or worktree only when project workflow expects it.
- Provision dependencies BEFORE tests (
npm ci/pnpm i/yarn, flutter pub get, ./gradlew dependencies, or pip install -e . from the lockfile); isolated worktrees lack ignored toolchains.
- If install fails from network, auth, or time budget, report
verification_infra_failed with the exact command/error; never claim tests passed or silently skip verification.
- Initialize or update
docs/srs/srs-task-list.md with small vertical slices.
- Implement slices:
- For each slice, write or update the failing test first.
- Before the test, record its observable contract, distinct fault, smallest layer, minimal cases, and exact focused command (the Test Intent Record).
- Consume the named
REQ-* and AC-* for each slice; do not invent scope from code inspection.
- For new behavior, do not keep pre-test implementation code as a reference: observe the expected RED first.
- For legacy or bug-fix slices, characterize only when needed, then make the intended change RED while preserving unrelated existing code.
- Implement the smallest passing code.
- Refactor without expanding scope.
- Run the focused target in foreground, single-run, sequential mode; classify invalid RED, unexpected GREEN, timeout, and cleanup instead of retrying blindly.
- Keep slice evidence near the task item.
- Use sub-agents only when the runtime supports them and ownership is disjoint.
- If a fix path is unclear, stop and apply root-cause debugging before more code changes.
- Maintain context hygiene:
- Start fresh context for large independent slices when possible.
- Preserve decisions in
docs/srs/srs-task-list.md or docs/prd/prd-plan-[slug].md.
- If behavior or scope changes, update
docs/prd/prd-[slug].md and docs/srs/srs-[slug].md before closing the slice.
- Avoid carrying raw logs; summarize failures and fixes.
- Prepare handoff:
- Run fresh local automated checks before claiming success.
- Update requirement trace notes for changed AC coverage.
- Capture evidence in
docs/srs/srs-walkthrough.md.
- For autonomous/channel mode, delegate only with disjoint files, owner, AC IDs, expected artifact, and verification command.
- Route next step to
verify-work.
Runtime Contract
- Use for approved plans ready to build; failing test first, no pre-test implementation kept as reference.
- Required inputs: PRD/ticket with stable
REQ-*/AC-* trace and required SRS/test lanes.
- Return BLOCKED only when required trace, owner, or test lanes are missing.
Handoff Payload
slug, operator_profile (carried, not re-inferred), completed slices, tests run, changed contracts, delegation packets, outcome report, next workflow.
Blocking Questions
- Ask max 3 at a time with a recommended default and 2-3 options.
Output Template
# Implementation Handoff: [Name]
## Completed Slices
## Tests Run
## Changed Contracts
## Requirement Trace Updates
## Evidence
## Known Risks
## Delegation Packets
## Outcome Report
feature_status: partially_implemented | implemented | blocked
requirement_trace: BRD-OBJ-* -> REQ-* -> AC-* -> SRS-* -> evidence
completed_evidence: []; missing_evidence: []; decision_needed: []; recommended_next_workflow: verify-work | plan-feature | design-solution
## Next Workflow
verify-work
## Cost Report
Call `get_session_cost(workflow="implement-feature")` before final handoff.
1---2name: implement-feature3description: Implement an approved feature plan with fresh-context slices, TDD, evidence, and PR-ready output.4---5# Implement Feature Skill
6
7> [!IMPORTANT]
8> Implement an approved feature plan with fresh-context slices, TDD, evidence, and PR-ready output.
9
10Optional args: slug=<feature>, ticket=<id/url>, mode=interactive|autonomous|channel, channel=<id>, auto_continue=true|false, profile=business|hybrid|technical.
11
12## Instructions
13
14When the user asks to perform this workflow, execute the following steps:
15
16
17# Implement Feature Workflow
18
19Goal: Build an approved feature through TDD slices and route completed work to verification.
20
21## Steps
22
231. Load plan:
24 - Search `docs/prd/` and `docs/srs/` for a matching `[slug]`; if absent, use the newest matching artifact.
25 - If multiple candidates exist, ask the user to choose or input the target slug.
26 - PRD or ticket
27 - SRS/FRS technical design if present
28 - Implementation plan
29 - Matched framework and common skills
30 - If stable `REQ-*`, `AC-*`, trace, or required SRS/test lanes are missing, stop and route to `plan-feature`, `design-solution`, or `implementation-readiness`.
312. Prepare workspace:
32 - Confirm clean or intentionally dirty git state.
33 - Create branch or worktree only when project workflow expects it.
34 - Provision dependencies BEFORE tests (`npm ci`/`pnpm i`/`yarn`, `flutter pub get`, `./gradlew dependencies`, or `pip install -e .` from the lockfile); isolated worktrees lack ignored toolchains.
35 - If install fails from network, auth, or time budget, report `verification_infra_failed` with the exact command/error; never claim tests passed or silently skip verification.
36 - Initialize or update `docs/srs/srs-task-list.md` with small vertical slices.
373. Implement slices:
38 - For each slice, write or update the failing test first.
39 - Before the test, record its observable contract, distinct fault, smallest layer, minimal cases, and exact focused command (the Test Intent Record).
40 - Consume the named `REQ-*` and `AC-*` for each slice; do not invent scope from code inspection.
41 - For new behavior, do not keep pre-test implementation code as a reference: observe the expected RED first.
42 - For legacy or bug-fix slices, characterize only when needed, then make the intended change RED while preserving unrelated existing code.
43 - Implement the smallest passing code.
44 - Refactor without expanding scope.
45 - Run the focused target in foreground, single-run, sequential mode; classify invalid RED, unexpected GREEN, timeout, and cleanup instead of retrying blindly.
46 - Keep slice evidence near the task item.
47 - Use sub-agents only when the runtime supports them and ownership is disjoint.
48 - If a fix path is unclear, stop and apply root-cause debugging before more code changes.
494. Maintain context hygiene:
50 - Start fresh context for large independent slices when possible.
51 - Preserve decisions in `docs/srs/srs-task-list.md` or `docs/prd/prd-plan-[slug].md`.
52 - If behavior or scope changes, update `docs/prd/prd-[slug].md` and `docs/srs/srs-[slug].md` before closing the slice.
53 - Avoid carrying raw logs; summarize failures and fixes.
545. Prepare handoff:
55 - Run fresh local automated checks before claiming success.
56 - Update requirement trace notes for changed AC coverage.
57 - Capture evidence in `docs/srs/srs-walkthrough.md`.
58 - For autonomous/channel mode, delegate only with disjoint files, owner, AC IDs, expected artifact, and verification command.
59 - Route next step to `verify-work`.
60
61## Runtime Contract
62- Use for approved plans ready to build; failing test first, no pre-test implementation kept as reference.
63- Required inputs: PRD/ticket with stable `REQ-*`/`AC-*` trace and required SRS/test lanes.
64- Return BLOCKED only when required trace, owner, or test lanes are missing.
65## Handoff Payload
66- `slug`, `operator_profile` (carried, not re-inferred), completed slices, tests run, changed contracts, delegation packets, outcome report, next workflow.
67## Blocking Questions
68- Ask max 3 at a time with a recommended default and 2-3 options.
69
70## Output Template
71
72```md
73# Implementation Handoff: [Name]
74## Completed Slices
75## Tests Run
76## Changed Contracts
77## Requirement Trace Updates
78## Evidence
79## Known Risks
80## Delegation Packets
81## Outcome Report
82feature_status: partially_implemented | implemented | blocked
83requirement_trace: BRD-OBJ-* -> REQ-* -> AC-* -> SRS-* -> evidence
84completed_evidence: []; missing_evidence: []; decision_needed: []; recommended_next_workflow: verify-work | plan-feature | design-solution
85## Next Workflow
86verify-work
87## Cost Report
88Call `get_session_cost(workflow="implement-feature")` before final handoff.
89```
90