sdd-implementer
Scannednpx machina-cli add skill leoheart0125/sdd-skills/sdd-implementer --openclawSDD Implementer
This skill handles the "last mile" of development. It focuses on speed and consistency by using verified templates (Scaffolds) and enforcing knowledge capture on completion.
Core Responsibilities
- Scaffold Execution: Use
sdd-knowledge-basetemplates (matched by tags) to generate boilerplate code instantly. - Feedback Loop: If implementation reveals a spec issue, trigger
/sdd-spec-update. - Mandatory Knowledge Capture: After feature completion, enforce pattern/lesson extraction.
Commands
/sdd-impl-start [task-id]: Load context and scaffold code. Iftask-idis omitted, executes all pending tasks in dependency order. Iftask-idis provided, executes only the specified task./sdd-impl-finish: Mark task complete, trigger auto-verification, and enforce knowledge extraction./sdd-impl-fix: Request a fix for a failed guardrail check.
Scaffolding Logic
When /sdd-impl-start is called:
Execution Mode Resolution
- If
task-idis provided: Execute scaffolding for that single task (steps below). - If
task-idis omitted (batch mode):- Read
.sdd/plan/<feature-id>/tasks.json. - Filter tasks where
statusis NOT"done"and NOT"verified". - Sort remaining tasks by dependency order (tasks with no unresolved dependencies first).
- Execute the scaffolding flow below for each task sequentially.
- After completing each task, log progress (e.g., "Task 3/5 complete") and proceed to the next automatically.
- Read
Per-Task Scaffolding Flow
- Read Project Rules (MANDATORY FIRST STEP):
- Load
project_rules.mdfrom.sdd/context/. - Extract Coding Standards (naming conventions, function size, documentation rules).
- Extract Architecture conventions (directory structure, layer ordering, dependency direction).
- Extract Testing requirements (unit test expectations, integration test scope).
- These rules constrain ALL subsequent code generation. Every line of generated code MUST comply.
- Load
- Check Task Type (e.g., "Create Endpoint").
- Check Context: Read
.sdd/context/context.jsonto determine Language, Framework, andcurrent_feature. - Read Task: Load from
.sdd/plan/<feature-id>/tasks.jsonusing the task ID. - Read Design Spec (MANDATORY): Load all available spec artifacts from
.sdd/spec/<feature-id>/and identify elements relevant to this task. The following may exist depending on the feature's design:architecture.json— component boundaries, layer structure, data flow direction (always present).object_design.json— design unit definitions, properties, method signatures, relationships (if applicable).data_api.json— data entity schemas, field types, relationships (if feature involves persistent data).openapi.yaml— API contracts, request/response schemas, status codes (if feature involves HTTP APIs).interface_contract.json— non-HTTP interface definitions (if applicable). The generated code MUST conform to whichever specs are present:- Use the exact names defined in
object_design.json. - Implement all properties and method signatures as specified.
- Respect the layer assignments.
- Maintain the relationships (dependency, composition, implementation, etc.) as defined.
- Follow component boundaries and data flow direction from
architecture.json. - Match the contracts defined in any interface spec artifacts that are present.
- If a spec artifact does not exist for this feature, that aspect is unconstrained.
- If a task maps to no design unit in
object_design.json, proceed without constraint but log a warning in the session log.
- Validate Target Path: Ensure the task's
target_pathfollowsproject_rules.mdconventions. - Query Knowledge Base (Index-Based): Read
.sdd/knowledge/index.json, filterpatternsby tags matching the current task's domain and stack. Load ONLY the matched pattern files. Do NOT scan the fullpatterns/directory. - Output the knowledge match results before generating code:
📚 **Knowledge Loaded** (stage: impl)
| Type | ID | Matched Tags | Summary |
|------|----|-------------|---------|
| <type> | <id> | `<tag1>`, `<tag2>` | <summary> |
> No knowledge matched. (if empty)
- Generate/Scaffold:
- If a pattern exists, use it as a base, but override with the design spec (names, contracts, schemas) from Step 5.
- If not, generate idiomatic code based on the available design specs from Step 5,
project_rules.md, and the technology stack.
- Place generated code at the
target_pathspecified in the task using the write_file tool.
Session Log (MANDATORY)
After completing each task, or when the user provides feedback/corrections during implementation, append an entry to .sdd/logs/session.md (see templates/session.md for format) with:
- Timestamp and task ID
- What was done or changed
- Any user feedback or corrections applied
- Any spec drift or guardrail failures encountered
This log persists across sessions and is the primary input for knowledge extraction at /sdd-impl-finish. Without it, lessons from previous sessions are lost.
Feedback Loop (Drift Management)
If the developer (or agent) realizes any spec artifact (openapi.yaml, object_design.json, data_api.json) is missing a field or has an inconsistency during implementation:
- Do NOT just hack the code.
- Call
/sdd-spec-update(viasdd-design-engine). - Wait for Spec update.
- Record a lesson: the gap between spec and reality.
- Resume implementation.
Task Completion Behavior
After each task is implemented:
- Per-Task Build Verification (MANDATORY):
- Run the project's build / type-check / compile command (determined from
context.jsonandproject_rules.md) to catch errors immediately. If no build commands are defined inproject_rules.md, skip automated build verification and note this in the session log. - Run unit tests relevant to the current task (e.g., the spec file co-located with the generated code). If no test commands are defined, skip and note in the session log.
- If either check fails, fix the errors before marking the task as done. Log all failures and fixes in the session log.
- This ensures errors are caught early per-task rather than accumulating to the finish phase.
- Run the project's build / type-check / compile command (determined from
- Update the task's status to
doneintasks.json. - Append the session log entry as described above.
- Inform the user of progress (e.g., "Task 3/5 complete").
- In batch mode: Automatically proceed to the next pending task.
- In single-task mode: Stop after the specified task.
- Do NOT auto-trigger the finish flow. The verification, knowledge extraction, and archival steps below are ONLY executed when the user explicitly calls
/sdd-impl-finish.
Completion & Mandatory Knowledge Extraction
User-Triggered Only: This entire flow is ONLY executed when the user explicitly calls
/sdd-impl-finish. Never run it automatically after completing tasks.
When /sdd-impl-finish is called:
Step 1: Verification
- Run guardrail checks (
/sdd-guard-check code) on all implemented files. - Run the full build and all tests (unit + integration) to ensure end-to-end correctness. Use the build/test commands from
project_rules.md. Per-task verification catches local errors early; this step catches cross-task integration issues. - Verify all tasks for the feature have status
doneorverified. - If build or tests fail, fix the issues before proceeding. Log all failures and fixes in the session log.
- Only after all checks pass, set
context.json.current_stageto"impl-complete". This is the sole trigger forimpl-complete— it is NOT set automatically when tasks finish.
Step 2: Knowledge Extraction (MANDATORY)
Instead of asking "would you like to save patterns?", the agent auto-generates drafts, triages them, and presents for user confirmation:
-
Read Session Log: Load
.sdd/logs/session.mdfor the full implementation history across ALL sessions. This is the primary source of truth for what happened during implementation. -
Pattern Draft: Analyze the implemented code and session log for reusable patterns.
- Identify repeating code structures (e.g., "form with validation and error handling", "data fetching with caching", "CLI command with arg parsing").
- Generate a draft pattern with suggested tags (e.g.,
["validation", "form", "error-handling"]).
-
Lesson Draft: Review session log AND current conversation for gaps:
- Were there spec updates (
/sdd-spec-updatecalls)? - Were there guardrail failures?
- Were there user corrections during clarification?
- For each gap, generate a draft lesson.
- Were there spec updates (
-
Knowledge Triage (MANDATORY): Execute the full Knowledge Triage protocol as defined in
sdd-knowledge-base/SKILL.md(Steps 1–4: Dedup → Specificity Check → Present triage table → Execute confirmed actions). Updatecontext.json.active_patternsandcontext.json.applied_lessons.
Step 3: Feature Archival
- MOVE (not copy)
.sdd/spec/<feature-id>/and.sdd/plan/<feature-id>/into.sdd/features/<feature-id>/spec/and.sdd/features/<feature-id>/plan/. - Move feature from
current_featuretocompleted_features. - Reset
current_stageto"init"andcurrent_featuretonull.
Step 4: Clear Session Log
Delete the contents of .sdd/logs/session.md (or remove the file) to start fresh for the next feature.
During-Implementation Lessons
Lessons are not only recorded at /sdd-impl-finish. During implementation, if:
- A spec update is triggered → record as lesson
- A guardrail fails and is fixed → record as lesson
- An unexpected framework behavior is encountered → record as lesson
These are recorded immediately via /sdd-learn (which applies Knowledge Triage — dedup and specificity check — before saving). Additionally, every such event MUST be appended to .sdd/logs/session.md so it is preserved across sessions.
Integration
- Consumes:
.sdd/plan/<feature-id>/tasks.json,.sdd/spec/<feature-id>/*(object_design.json,architecture.json,data_api.json,openapi.yaml),project_rules.md,knowledge/patterns(by tags). - Invokes:
sdd-guardrails(for verification),sdd-design-engine(for spec updates),sdd-knowledge-base(for pattern/lesson saving).
Source
git clone https://github.com/leoheart0125/sdd-skills/blob/main/skills/sdd-implementer/SKILL.mdView on GitHub Overview
SDD Implementer is the last-mile execution engine that turns structured plans into runnable code using scaffold templates from the sdd-knowledge-base. It emphasizes speed and consistency, enforces mandatory knowledge capture after delivery, and triggers a feedback loop when specs conflict.
How This Skill Works
On /sdd-impl-start, it loads context, selects scaffolds by tags, and generates boilerplate code per task or for all pending tasks. If a spec issue is detected, it triggers /sdd-spec-update. After completion, it enforces knowledge extraction. In batch mode, it reads the plan, filters non-done/non-verified tasks, sorts them by dependency order, and executes them sequentially with progress logging.
When to Use It
- Need to generate boilerplate code for a feature using verified Scaffold templates.
- A design or spec issue is detected and a fix workflow must be triggered.
- Executing multiple interdependent tasks in a feature in dependency order (batch mode).
- Enforcing systematic knowledge capture (patterns, lessons) after feature completion.
- You want code generation to strictly follow project rules (coding standards, architecture, testing).
Quick Start
- Step 1: /sdd-impl-start [task-id] (or omit to process all pending tasks).
- Step 2: Let scaffold templates generate boilerplate and resolve design artifacts from .sdd/spec.
- Step 3: /sdd-impl-finish to verify, complete the task, trigger auto-verification, and enforce knowledge capture.
Best Practices
- Read project_rules.md from .sdd/context before starting to ensure standards are applied.
- Always run in the correct context (.sdd/context/context.json) to detect language/framework.
- Verify dependencies and task types before batch execution to maintain order.
- Map designs to exact artifacts in .sdd/spec/<feature-id> and conform to architecture.json.
- Use /sdd-impl-finish to trigger verification and mandatory knowledge extraction.
Example Use Cases
- Bootstrapping a REST endpoint by generating controller, service, and tests from a scaffold.
- Scaffolding a new microservice while enforcing architecture conventions and data contracts.
- Batching the implementation of several interdependent tasks in a feature with dependency-aware sequencing.
- Encountering a guardrail fail and triggering /sdd-impl-fix to request a patch and re-run.
- Completing a feature and extracting patterns/lessons to enrich the knowledge base.