implement
Use to implement a feature from its tasks.json with test-driven development — writes a failing test first, makes it pass, refactors, gates, and commits per task. Triggers on "implement {slug}", "build {slug}", "TDD {slug}", "code up the tasks for {slug}", "/sdd:implement {slug}", "імплементуй {slug}", "реалізуй фічу {slug}", "напиши код за задачами". Reads docs/features/{slug}/tasks.json + the upstream artifacts, detects the repo's test/lint/vet commands stack-agnostically, builds a dependency DAG, and runs one of three modes — sequential single-agent TDD, an agent team (TeamCreate), or a dynamic Workflow — chosen from settings + DAG shape with graceful fallback. Hard-refuses if tasks.json is missing.
genkovich · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add genkovich/sdd --skill implement技能说明
name: implement model: inherit effort: medium agents: [test-author, implementer, reviewer] description: > Use to implement a feature from its tasks.json with test-driven development — writes a failing test first, makes it pass, refactors, gates, and commits per task. Triggers on "implement {slug}", "build {slug}", "TDD {slug}", "code up the tasks for {slug}", "/sdd:implement {slug}", "імплементуй {slug}", "реалізуй фічу {slug}", "напиши код за задачами". Reads docs/features/{slug}/tasks.json + the upstream artifacts, detects the repo's test/lint/vet commands stack-agnostically, builds a dependency DAG, and runs one of three modes — sequential single-agent TDD, an agent team (TeamCreate), or a dynamic Workflow — chosen from settings + DAG shape with graceful fallback. Hard-refuses if tasks.json is missing.
Skill: implement
The implementation engine. It turns tasks.json into committed, tested code through a strict TDD cycle per task — SELECT → RED → GREEN → REFACTOR → GATE → COMMIT — and orchestrates that cycle in one of three modes (sequential / agent-team / dynamic-workflow) picked by an unambiguous decision tree. Everything is stack-agnostic: the test, lint, and vet commands are detected, never hard-coded.
This file is the spine. Each step delegates to a file in references/.
Owner
Tech Lead drives; the engine runs the cycle. The three subagents ship with the plugin: test-author (RED), implementer (GREEN/REFACTOR/GATE), reviewer (read-only review).
Inputs
<slug>— feature slug.- Gate (hard refuse):
docs/features/<slug>/tasks.json. Missing → «runtasks <slug>first». - Read for context (the agents read these directly, not via paraphrase):
spec.md(AC),data-model.md+ the staged migrations underdocs/features/<slug>/migrations/(alayer: migrationtask promotes these into the livemigrations/tree — see./references/inputs.md),contracts/openapi.yaml,test-plan.md,sad.md, Acceptedadr/. - Settings:
.claude/sdd.local.md— created with documented defaults by whichever of the six creating skills runs first (normallyspecifyat the backbone start;implementcreates it too if you jump straight here) per../_shared/settings-file.md; values are tuned only by../config/SKILL.md. Which keys this engine reads →./references/settings.md.
Protocol
- Preconditions. Verify
tasks.jsonexists and parses; load the upstream artifacts list. Detail →./references/inputs.md. - Ensure the settings file (first thing, after this skill's own gate). If
.claude/sdd.local.mdis absent, create it now from the canonical template — documented defaults + the self-documenting body — and patch.gitignore; if it exists, read it and never overwrite. The one procedure lives in../_shared/settings-file.md. Creating is unconditional; changing values is only ever offered byconfig. Say one line: «.claude/sdd.local.mdcreated with documented defaults —/sdd:configto tune it». Which keys this engine then reads, and how model + effort resolve at dispatch →./references/settings.md. - Detect commands. Run the stack-agnostic cascade (settings override → Makefile → package scripts → language manifests → Docker probe for the integration tier) to resolve unit / integration / lint / vet commands. Print what was detected. →
./references/command-detection.md. - Build the DAG. Parse
tasks.json, validatedepsis acyclic, topologically sort into phases (Kahn). Computetask_count,longest_chain,parallel_width. Mark serialization lanes (layer: migration; tasks with overlappingfiles_hint). - Pick the mode. Run the decision tree (below; full form →
./references/decision-tree.md). Apply the guards. - Generate the run-plan. Sequential → an ordered task list. Team → a shared TaskList with the full task text in each body. Workflow → a generated
Workflowscript (DAG → Kahn phases → fan-out pipeline). →./references/team-exec.md/./references/workflow-exec.md. - Banner. Print the active mode and the settings that drove it:
mode=<…> tdd=<…> isolation=<…> parallel=<n> integration=<…>. The user sees exactly how the engine will behave before it acts. - Execute in the chosen mode. Every task runs the TDD cycle →
./references/tdd-loop.md. Alayer: migrationtask first promotes its staged migration(s) (docs/features/<slug>/migrations/<NN>_*) into the livemigrations/tree — assigning the real sequence number / timestamp per the repo's convention, in ordinal order — then applies + reverts them; detail →./references/inputs.md. - Per-task gate + commit. After GREEN+REFACTOR: unit + (integration if available) + lint + vet must be clean, then commit task-scoped with trailers
SDD-Task: <id>andSDD-AC: <id>(one per satisfied AC). Tasks in one compile-coupled lane (shared contract file infiles_hint) pass one shared gate and one commit carrying every task's trailers — the sanctioned exception in./references/tdd-loop.md§COMMIT. Updatetracker.md→done. - Summary + hand off. Report covered AC, commits made (with
SDD-Tasktrailers), any task dropped/blocked, and the per-task gate results. Then emit the stage-handoff block per../_shared/handoff.md— What I did (covered AC, commits withSDD-Tasktrailers, gate results) + Review (the committed diff +tasks/tracker.md) + *R