Metadata
sdd-apply2.0gentleman-programmingMITWhen It’s Triggered
The orchestrator launchessdd-apply when:
- User runs
/sdd-applyor/sdd-continue - User wants to implement specific tasks from a change
- Tasks are ready and user wants code written
What It Receives
From the orchestrator:- Change name
- Specific task(s) to implement (e.g., “Phase 1, tasks 1.1-1.3”)
- Artifact store mode (
engram | openspec | none)
What It Does
Step 1: Read Context
Before writing ANY code:- Read the specs — understand WHAT the code must do
- Read the design — understand HOW to structure the code
- Read existing code in affected files — understand current patterns
- Check the project’s coding conventions from
config.yaml
Step 2: Detect Implementation Mode
Determines if the project uses TDD:TDD Workflow (RED → GREEN → REFACTOR)
When TDD is active, EVERY task follows this cycle:Standard Workflow
When TDD is not active:Step 3: Detect Test Runner
For TDD mode, detects the test runner:Step 4: Mark Tasks Complete
Updatestasks.md — changes - [ ] to - [x] for completed tasks:
Step 5: Return Summary
Returns a result envelope with implementation progress.Result Envelope Example (TDD Mode)
Result Envelope Example (Standard Mode)
Rules
- ALWAYS read specs before implementing — specs are your acceptance criteria
- ALWAYS follow the design decisions — don’t freelance a different approach
- ALWAYS match existing code patterns and conventions in the project
- In
openspecmode, mark tasks complete intasks.mdAS you go, not at the end - If you discover the design is wrong or incomplete, NOTE IT in your return summary — don’t silently deviate
- If a task is blocked by something unexpected, STOP and report back
- NEVER implement tasks that weren’t assigned to you
- Load and follow any relevant coding skills for the project stack (e.g.,
react-19,typescript,django-drf,tdd,pytest,vitest) if available in the user’s skill set - Apply any
rules.applyfromopenspec/config.yaml - If TDD mode is detected, ALWAYS follow the RED → GREEN → REFACTOR cycle — never skip RED (writing the failing test first)
- When running tests during TDD, run ONLY the relevant test file/suite, not the entire test suite (for speed)
- Return a structured envelope with:
status,executive_summary,detailed_report,artifacts,next_recommended, andrisks
Version 2.0 Features
v2.0 introduced:TDD Support
- Automatic TDD mode detection
- RED → GREEN → REFACTOR workflow
- Test runner detection and execution
- Verification that tests fail before passing
Test Execution
- Runs tests during implementation (not just verification)
- Reports test results in the progress envelope
- Detects test commands from config or project files
Skill Integration
- Loads user’s installed coding skills (e.g.,
tdd/SKILL.md,pytest/SKILL.md,vitest/SKILL.md) - Follows skill-specific patterns for writing tests
- Adapts to project-specific conventions
Enhanced Reporting
- TDD cycle status table (RED/GREEN/REFACTOR)
- Test file references
- Deviations from design explicitly called out
Related
- Task Planner — Creates the tasks that this sub-agent implements
- Verifier — Validates implementation after tasks are complete
- OpenSpec Convention