Implement Feature Skill
[!IMPORTANT]
Implement an approved feature plan with benefit-based placement, TDD, revision-bound 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 bounded TDD slices and route settled work to verification.
Steps
- Load plan: Find the matching PRD/ticket, SRS/FRS, implementation plan, REQ/AC trace, and skills. Carry
delivery_mode, authoritative work-item reference with source revision, owner, approval reference, and inherited snc_tier/model_tier. In brief mode the approved record's observable criteria replace formal PRD/SRS/REQ/AC IDs; never restart intake or invent IDs for a missing filename. A sensitive or scope-grown change reopens only the affected slices and restores the applicable design/approval floor. High tier adds specialist-architecture-guard and specialist-security-reviewer before verify-work. Ask only when the target remains ambiguous after reading the approved record.
- Prepare workspace: Confirm clean or intentional dirty state; create a branch/worktree only when expected. Provision lockfile dependencies before tests. Report install failures exactly; never claim skipped checks passed.
- Bound ownership: Assign each slice an owner, exact files, goal/deliverable, in/out scope, authority, criteria references (REQ/AC IDs when governed; the approved record's observable criteria otherwise), verification lane, approval reference, and verification receipt. Record the one authoritative work item and source revision once; slice rows link criteria and lanes instead of restating their definitions. Blocked slices name the blocker, its owner, and the required input while independent ready slices proceed. Prepare a standalone assignment packet; a slice must not depend on inferred plan-level authority.
- Implement slices:
- Apply the canonical placement decision in
common-subagent-driven-development §1 before editing: delegate only for a named benefit or a host requirement. Coupled sequential work under a host that permits main-loop implementation stays in one implementation context.
- Dispatch one owner per disjoint, dependency-ready slice with a recorded benefit; sequence only real dependencies. Worker bootstrap reads its packet and requests only the exact standards it names; do not repeat parent workflow discovery or global intake.
- Record observable contract, distinct fault, smallest honest layer, minimal cases, and exact focused command before testing.
- Write/update the failing test first; observe expected RED before implementation. Characterize legacy behavior only when needed. If implementation preceded tests, report original RED as
NOT RUN; never manufacture fake RED. Frozen pre-repair snapshot proof must be explicitly labeled as frozen_snapshot_red. Setup errors (compilation, syntax, missing imports, fixture defects) are invalid_red, NOT behavioral RED.
- Implement the smallest passing change; refactor without scope expansion.
- Run focused checks foreground, single-run, sequentially, with no peer mutation; classify invalid RED, unexpected GREEN, timeout, or infrastructure failure. Derive test count and suite membership directly from raw runner output; reject early zero-exit completions and no-listener runs (zero assertions executed). Micro-level slice checks do not require universal human sign-off per test.
- Keep concise revision-bound receipts across layered acceptance gates (source-ready, focused checks, consumer-smoke, independent review, human acceptance) based on approved scope applicability: changed contract, RED/GREEN evidence, behavior smoke, command/result, and limitations. Source-ready indicates complete source delivery at recorded Git SHA + dirty identity, with check statuses explicitly and independently recorded (
PASS, FAIL, NOT RUN, NOT APPLICABLE); unexecuted checks remain NOT RUN.
- Independent review: Review each slice in a separate owner/context against its ACs and evidence. Implementer self-review does not satisfy this gate, whether the implementer ran in the main loop or in a worker. Record review mode, open findings, and the settled revision.
- Recover by cause: Missing prerequisite → report
needs_context/blocked with the exact item. Defective output → one corrective assignment naming the failed AC. Observed provider exhaustion → only an eligible, already-authorized fallback, with the evidence recorded. Consequential safety/design issue → human decision. Retry count alone never authorizes premium.
- Preserve context: Carry decisions, owner, active slice, and evidence links in the task/plan artifact. Summarize logs; keep source artifacts retrievable. Archive required packets, reports, and receipts at durable references before workspace cleanup.
- Settle before shared checks: Every owner pauses edits and reports a settled revision. Run one final covering gate, including real producer→consumer smoke verifying outward side effects through real entrypoints for boundary/integration slices, foreground/sequentially with no peer mutation. Then run the whole-branch independent review; it is required regardless of placement. Later edits invalidate affected evidence only; rerun those gates on the final source revision without weakening checks or invalidating unrelated previous gates. A cancelled or timed-out run is not a pass.
- Handoff: Report final gate/smoke receipts across applicable layered acceptance gates and update the requirement trace and walkthrough evidence where that lane applies. Run the required audit only for its evidence lane: governed documents
rtk pnpm audit:trace --slug <slug> --required; required run records rtk pnpm audit:outcome --records --required --slug <slug> --workflow <workflow> --run-id <run-id>. Brief tickets acquire no document-trace gate; registry-wide discovery with no selector stays optional. Where human acceptance is required by release scope, keep it pending until an authorized human acts. Technical verification, business acceptance, and release stay separate referenced decisions; a passing check reports only technical verification. Continue only within recorded authority; route to verify-work.
Runtime Contract
- Use for approved plans ready to build; TDD, bounded ownership, revision-bound evidence, independent review.
- Required inputs: PRD/ticket with stable REQ/AC trace or an approved
brief record with observable criteria; owner; required SRS/test lanes for triggered risk.
- Choose placement per
common-subagent-driven-development §1: delegate only for a named benefit or a host requirement. Plan approval does not authorize merge, deployment, premium spend, or a different execution mode.
- Required independent review and the final whole-branch review survive either placement; missing nesting support or missing isolation stops only the affected operation.
- Return
needs_context or blocked when required trace or brief criteria, owner, test lanes, authority, required standards, or enforceable isolation are missing.
Handoff Payload
slug, carried operator_profile, delivery_mode, work-item reference plus source revision, approval reference, snc_tier, model_tier, completed slices, tests run, changed contracts, requirement trace, delegation packets, evidence-lane refs (technical/acceptance/release), risks, outcome report, next workflow.
- Carry
repository_status and activation_status separately; include authorized next action, settled revision, and evidence links. Publication approval does not grant deployment authority.
Blocking Questions
- Ask max 3 only when an answer changes the result or safety boundary; include a recommended default and 2-3 options.
Output Template
# Implementation Handoff: [Name]
## Delivery Mode And Work Item
- Mode: brief | standard | extended; work item + revision: [ref @ rev]; owner: [owner]; approval: [ref]
- Evidence lanes: technical [verify receipt ref], acceptance [not assessed], release [not assessed]
## Completed Slices
## Tests Run
## Changed Contracts
## Requirement Trace Updates
## Evidence
### Layered Acceptance
- **Source-Ready:** [Git SHA + dirty-identity; check statuses explicitly recorded: build/lint/typecheck as PASS | FAIL | NOT RUN | NOT APPLICABLE]
- **Focused Checks:** [Test runner command, raw test count/membership from runner output, RED status (expected_red | frozen_snapshot_red | not_run), GREEN result]
- **Consumer-Smoke:** [Real producer→consumer entrypoint, outward side effects verified | NOT APPLICABLE with scope reason]
- **Independent Review:** [Reviewer identity, spec compliance and code quality verdicts | NOT APPLICABLE with scope reason]
- **Human Acceptance:** [Human partner / operator sign-off status (Approved | Pending | NOT APPLICABLE with scope reason)]
## Known Risks
## Delegation Packets
## Outcome Report
{schema_version: 1, run_id: "[run-id]", slug: "[slug]", workflow: implement-feature, feature_status: implemented, started_at: "[timestamp]", completed_at: "[timestamp]", requirement_trace: {brd_objectives: [], requirements: [], acceptance_criteria: [], srs: []}, completed_evidence: [], missing_evidence: [], decision_needed: [], recommended_next_workflow: verify-work, cost: {source: unavailable}, agent: {identity: "[agent-identity]", model: "[model]"}}
## Next Workflow
verify-work
Cost Report
Call get_session_cost(workflow="implement-feature") before handoff (or with outcome="implemented", completion={role: "orchestrator", activeTasks: 0, pendingTasks: 0} when orchestrator/unassigned on local stdio with workers/checks settled and consent enabled to trigger preparation; workers never pass completion).
1---2name: implement-feature-23description: "Implement an approved feature plan with benefit-based placement, TDD, revision-bound evidence, and PR-ready output."4metadata:5 source: https://skillmd.com/skills/hoangnguyen0403/implement-feature-26 internal: true7 triggers:8 keywords:9 - implement feature10 - workflow11---1213# Implement Feature Skill1415> [!IMPORTANT]16> Implement an approved feature plan with benefit-based placement, TDD, revision-bound evidence, and PR-ready output.1718Optional args: slug=<feature>, ticket=<id/url>, mode=interactive|autonomous|channel, channel=<id>, auto_continue=true|false, profile=business|hybrid|technical.1920## Instructions2122When the user asks to perform this workflow, execute the following steps:232425# Implement Feature Workflow2627Goal: Build an approved feature through bounded TDD slices and route settled work to verification.2829## Steps30311. **Load plan**: Find the matching PRD/ticket, SRS/FRS, implementation plan, REQ/AC trace, and skills. Carry `delivery_mode`, authoritative work-item reference with source revision, owner, approval reference, and inherited `snc_tier`/`model_tier`. In `brief` mode the approved record's observable criteria replace formal PRD/SRS/REQ/AC IDs; never restart intake or invent IDs for a missing filename. A sensitive or scope-grown change reopens only the affected slices and restores the applicable design/approval floor. High tier adds `specialist-architecture-guard` and `specialist-security-reviewer` before `verify-work`. Ask only when the target remains ambiguous after reading the approved record.322. **Prepare workspace**: Confirm clean or intentional dirty state; create a branch/worktree only when expected. Provision lockfile dependencies before tests. Report install failures exactly; never claim skipped checks passed.333. **Bound ownership**: Assign each slice an owner, exact files, goal/deliverable, in/out scope, authority, criteria references (REQ/AC IDs when governed; the approved record's observable criteria otherwise), verification lane, approval reference, and verification receipt. Record the one authoritative work item and source revision once; slice rows link criteria and lanes instead of restating their definitions. Blocked slices name the blocker, its owner, and the required input while independent ready slices proceed. Prepare a standalone assignment packet; a slice must not depend on inferred plan-level authority.344. **Implement slices**:35 - Apply the canonical placement decision in `common-subagent-driven-development` §1 before editing: delegate only for a named benefit or a host requirement. Coupled sequential work under a host that permits main-loop implementation stays in one implementation context.36 - Dispatch one owner per disjoint, dependency-ready slice with a recorded benefit; sequence only real dependencies. Worker bootstrap reads its packet and requests only the exact standards it names; do not repeat parent workflow discovery or global intake.37 - Record observable contract, distinct fault, smallest honest layer, minimal cases, and exact focused command before testing.38 - Write/update the failing test first; observe expected RED before implementation. Characterize legacy behavior only when needed. If implementation preceded tests, report original RED as `NOT RUN`; never manufacture fake RED. Frozen pre-repair snapshot proof must be explicitly labeled as `frozen_snapshot_red`. Setup errors (compilation, syntax, missing imports, fixture defects) are `invalid_red`, NOT behavioral RED.39 - Implement the smallest passing change; refactor without scope expansion.40 - Run focused checks foreground, single-run, sequentially, with no peer mutation; classify invalid RED, unexpected GREEN, timeout, or infrastructure failure. Derive test count and suite membership directly from raw runner output; reject early zero-exit completions and no-listener runs (zero assertions executed). Micro-level slice checks do not require universal human sign-off per test.41 - Keep concise revision-bound receipts across layered acceptance gates (source-ready, focused checks, consumer-smoke, independent review, human acceptance) based on approved scope applicability: changed contract, RED/GREEN evidence, behavior smoke, command/result, and limitations. Source-ready indicates complete source delivery at recorded Git SHA + dirty identity, with check statuses explicitly and independently recorded (`PASS`, `FAIL`, `NOT RUN`, `NOT APPLICABLE`); unexecuted checks remain `NOT RUN`.425. **Independent review**: Review each slice in a separate owner/context against its ACs and evidence. Implementer self-review does not satisfy this gate, whether the implementer ran in the main loop or in a worker. Record review mode, open findings, and the settled revision.436. **Recover by cause**: Missing prerequisite → report `needs_context`/`blocked` with the exact item. Defective output → one corrective assignment naming the failed AC. Observed provider exhaustion → only an eligible, already-authorized fallback, with the evidence recorded. Consequential safety/design issue → human decision. Retry count alone never authorizes premium.447. **Preserve context**: Carry decisions, owner, active slice, and evidence links in the task/plan artifact. Summarize logs; keep source artifacts retrievable. Archive required packets, reports, and receipts at durable references before workspace cleanup.458. **Settle before shared checks**: Every owner pauses edits and reports a settled revision. Run one final covering gate, including real producer→consumer smoke verifying outward side effects through real entrypoints for boundary/integration slices, foreground/sequentially with no peer mutation. Then run the whole-branch independent review; it is required regardless of placement. Later edits invalidate affected evidence only; rerun those gates on the final source revision without weakening checks or invalidating unrelated previous gates. A cancelled or timed-out run is not a pass.469. **Handoff**: Report final gate/smoke receipts across applicable layered acceptance gates and update the requirement trace and walkthrough evidence where that lane applies. Run the required audit only for its evidence lane: governed documents `rtk pnpm audit:trace --slug <slug> --required`; required run records `rtk pnpm audit:outcome --records --required --slug <slug> --workflow <workflow> --run-id <run-id>`. Brief tickets acquire no document-trace gate; registry-wide discovery with no selector stays optional. Where human acceptance is required by release scope, keep it pending until an authorized human acts. Technical verification, business acceptance, and release stay separate referenced decisions; a passing check reports only technical verification. Continue only within recorded authority; route to `verify-work`.47## Runtime Contract4849- Use for approved plans ready to build; TDD, bounded ownership, revision-bound evidence, independent review.50- Required inputs: PRD/ticket with stable REQ/AC trace or an approved `brief` record with observable criteria; owner; required SRS/test lanes for triggered risk.51- Choose placement per `common-subagent-driven-development` §1: delegate only for a named benefit or a host requirement. Plan approval does not authorize merge, deployment, premium spend, or a different execution mode.52- Required independent review and the final whole-branch review survive either placement; missing nesting support or missing isolation stops only the affected operation.53- Return `needs_context` or `blocked` when required trace or brief criteria, owner, test lanes, authority, required standards, or enforceable isolation are missing.5455## Handoff Payload5657- `slug`, carried `operator_profile`, `delivery_mode`, work-item reference plus source revision, approval reference, `snc_tier`, `model_tier`, completed slices, tests run, changed contracts, requirement trace, delegation packets, evidence-lane refs (technical/acceptance/release), risks, outcome report, next workflow.58- Carry `repository_status` and `activation_status` separately; include authorized next action, settled revision, and evidence links. Publication approval does not grant deployment authority.5960## Blocking Questions6162- Ask max 3 only when an answer changes the result or safety boundary; include a recommended default and 2-3 options.6364## Output Template65```md66# Implementation Handoff: [Name]67## Delivery Mode And Work Item68- Mode: brief | standard | extended; work item + revision: [ref @ rev]; owner: [owner]; approval: [ref]69- Evidence lanes: technical [verify receipt ref], acceptance [not assessed], release [not assessed]70## Completed Slices7172## Tests Run7374## Changed Contracts7576## Requirement Trace Updates77## Evidence7879### Layered Acceptance80- **Source-Ready:** [Git SHA + dirty-identity; check statuses explicitly recorded: build/lint/typecheck as PASS | FAIL | NOT RUN | NOT APPLICABLE]81- **Focused Checks:** [Test runner command, raw test count/membership from runner output, RED status (expected_red | frozen_snapshot_red | not_run), GREEN result]82- **Consumer-Smoke:** [Real producer→consumer entrypoint, outward side effects verified | NOT APPLICABLE with scope reason]83- **Independent Review:** [Reviewer identity, spec compliance and code quality verdicts | NOT APPLICABLE with scope reason]84- **Human Acceptance:** [Human partner / operator sign-off status (Approved | Pending | NOT APPLICABLE with scope reason)]8586## Known Risks8788## Delegation Packets8990## Outcome Report9192{schema_version: 1, run_id: "[run-id]", slug: "[slug]", workflow: implement-feature, feature_status: implemented, started_at: "[timestamp]", completed_at: "[timestamp]", requirement_trace: {brd_objectives: [], requirements: [], acceptance_criteria: [], srs: []}, completed_evidence: [], missing_evidence: [], decision_needed: [], recommended_next_workflow: verify-work, cost: {source: unavailable}, agent: {identity: "[agent-identity]", model: "[model]"}}93## Next Workflow9495verify-work96```9798## Cost Report99100Call `get_session_cost(workflow="implement-feature")` before handoff (or with `outcome="implemented"`, `completion={role: "orchestrator", activeTasks: 0, pendingTasks: 0}` when orchestrator/unassigned on local stdio with workers/checks settled and consent enabled to trigger preparation; workers never pass completion).101