---
name: saf-implement
description: Implement exactly one validated SDD task as the smallest tested, merge-ready increment. Use for a single task reference or explicit task implementation request; not for planning a feature or coordinating several tasks.
compatibility: Requires Git and a compatible Agent Skills host.
---

# Implement one SDD task

## When to use

Use for one unambiguous task that is ready to implement or resume. Read [the TLC
baseline](../sdd-agentic-flow-shared/references/tlc-baseline.md), [the TDD
baseline](../sdd-agentic-flow-shared/references/tdd-baseline.md), [task
slicing](../sdd-agentic-flow-shared/references/task-slicing.md), [feature
profiles](../sdd-agentic-flow-shared/references/feature-profiles.md), [engineering
principles](../sdd-agentic-flow-shared/references/engineering-principles.md), [spec
lifecycle](../sdd-agentic-flow-shared/references/spec-lifecycle.md), and [safety
rules](../sdd-agentic-flow-shared/references/workflow-safety.md) before acting.

## When not to use

Do not use for specification authoring, several tasks, a feature-wide validation, PR review, or a
task whose identity, scope, or dependencies are ambiguous. Reject a discovery-only workspace: it is
not a spec package and must first pass through `saf-create-spec`.

## Inputs

- A single canonical task reference or explicit feature and task identifiers.
- Repository SDD artifacts, relevant code, and optional `.sdd-agentic-flow/config.yml` overrides.
- Optional task prompt or prior handoff, treated as supporting evidence only.

## Workflow

1. Read `.sdd-agentic-flow/config.yml` when present; otherwise use canonical effective defaults.
2. Read `.sdd-agentic-flow/context/project-context.md` and
   `.sdd-agentic-flow/context/domain-glossary.md` when they exist. Read the feature package's
   persisted `Feature profile` from its context when present; only use a physically present valid
   `workflow.feature_profile` as a legacy fallback, and otherwise use `medium_feature` compatibility
   rigor. Do not re-infer profile depth. Resolve exactly one package, then exactly one task from the
   configured SDD source. Load the [Task Context
   Package](../sdd-agentic-flow-shared/references/task-context-package.md) minimum context. Resolve
   bounded goal, completion criteria, constraints and applicable [decision
   gates](../sdd-agentic-flow-shared/references/decision-gates.md) before mutation per
   [bounded-execution.md](../sdd-agentic-flow-shared/references/bounded-execution.md). Load this
   skill's existing Inputs/Workflow list only; related slugs only if named or requested (one hop).
   Confirm its acceptance criteria, requirement anchors, dependencies, allowed scope, and current
   implementation state.
3. If resuming from `handoff.md`, reconcile it before using any prior evidence or progressing:
   resolve the canonical feature, task, effective configuration, current spec, task contract,
   decision gates, and implementation state; treat handoff goal, status, and proposed next action as
   supporting context only; and preserve human pauses and scope boundaries. For a v8 report
   reference, resolve the released active report, confirm report identity and scope match the
   selected task, and assess validity and freshness through the released projection. A current
   positive active successor may inform existing transition rules; a predecessor is replaced by its
   successor, and path, filename, timestamp, or narrative never selects evidence. Missing, legacy,
   ambiguous, negative, malformed, stale, or inconclusive reports cannot support a positive
   completion claim and must use the existing check, validation, repair, or human-decision route.
   Preserve prior findings and decisions; update a handoff only while work remains non-terminal
   under the [handoff standard](../sdd-agentic-flow-shared/references/handoff-standard.md).
4. Inspect callers and existing patterns before editing. Stop if the work requires a sibling task,
   unsafe environment, or unresolved authority conflict. Specifications are **living** control
   artifacts: if you find drift, first determine whether repository evidence supports an
   intent-preserving reconciliation. In autonomous mode, route that reconciliation to
   `saf-create-spec`, refresh affected prompts, and resume without asking when acceptance semantics
   and delegated scope remain unchanged. Do not silently implement a different requirement, silently
   rewrite the spec from implementation preference, or proceed when the change expands authority. A
   contract-change proposal is non-authoritative and never authorizes its own semantics.
5. Apply `../sdd-agentic-flow-shared/references/engineering-principles.md` before editing. Search
   existing patterns, prefer modifying an existing file, and keep the complexity budget. In
   autonomous mode, choose an evidence-backed technical design that preserves the effective
   contract; do not add a competing architecture, new dependency, or new convention when the
   decision would expand delegated authority.
6. Identify the required behavior from the spec, the contractual seam (field label: `Public seam`;
   prefer public/observable when practical), the sensor, and the oracle/acceptance condition from
   spec, repo contracts, or configured gates — never solely from the implementation. Stop when the
   seam is unclear. Stay inside the fix boundary; do not expand into **unchanged behavior**. For
   bugfix or refactor intent, record regression sensors. Do not complete an **investigation** as a
   fix (`Status: pass` on findings is forbidden).
7. Use one vertical slice at a time: name the behavior, place a sensor at the contractual seam,
   implement the smallest change, and record executed **current** evidence. Test-first is
   recommended when it sharpens the spec. Full RED → GREEN → REFACTOR is optional and is never
   harness proof. Do not fabricate RED. Do not weaken required behavioral coverage because the
   ritual is optional. Do not complete on self-assessment. Do not achieve green by suite weakening
   (deleting, skipping, or narrowing tests that encoded the AC). The oracle stays the spec-derived
   expected outcomes. Classify every change to a sensor that encodes an AC per
   `../sdd-agentic-flow-shared/references/evidence-standard.md#sensor-change-classes` and stop
   for a human decision before any `contract correction`.
8. Apply `../sdd-agentic-flow-shared/references/evidence-standard.md`. Record commands, results,
   limitations, and untested risks. A passing sensor is evidence, not a correctness verdict. Do not
   claim done because the conversation feels finished.
9. Report TDD evidence, changed files, checks, remaining risks, and the next SDD step. Do not
   commit, push, open a remote PR, or update external trackers unless the user separately asks.

## Safety

Preserve unrelated and pre-existing changes. Keep credentials, personal data, and local paths out of
output. Do not mutate production, remote services, tracker state, Git history, or repository
configuration by default. Do not complete on self-assessment. Do not perform suite weakening to
obtain green.

## Output

Return the resolved task, outcome (`implemented`, `partial`, `blocked`, or `no changes required`),
concise evidence, validation results, and recommended next step. Include `Status`, `Next recommended
skill`, and `Reason`. Terminal output is an **implementation candidate ready for verification**,
never its own final verification verdict. In autonomous mode, continue through another bounded
attempt when evidence shows semantic progress and the transition is admissible; return control only
for an exceptional authority or safety boundary, exhaustion, or no progress. When work pauses before
a terminal outcome — session end, an agent swap, or a blocker only a human can resolve — write or
update `handoff.md` per `../sdd-agentic-flow-shared/references/handoff-standard.md`.

### Autonomy

Supports `manual`, `supervised`, and `autonomous` autonomy levels. In `autonomous` mode, tests,
configured lint, and semantic scope remain required before a normal check transition. A recoverable
failure authorizes an owning repair or retry when semantic progress remains; an authority or safety
boundary, exhaustion, or no-progress result returns control to the human. See
`../sdd-agentic-flow-shared/references/autonomy-guardrails.md`.
