Skip to main content

Overview

The /sdd-apply command launches the implementer sub-agent to write code based on the generated specs, design, and tasks. It works through tasks in phases, checking off items as it completes them.
v2.0 Enhancement: Now supports Test-Driven Development (TDD) workflow when enabled.

Usage

string
Optional. The change to implement. If omitted, applies the most recent active change.

What It Does

1. Loads Planning Artifacts

Reads:
  • proposal.md - Understands intent and scope
  • specs/*.md - Gets acceptance criteria
  • design.md - Learns technical approach
  • tasks.md - Sees implementation checklist

2. Implements Tasks

For each incomplete task:
1

Read Context

  • Relevant spec scenarios (acceptance criteria)
  • Design decisions (technical approach)
  • Existing code patterns in project
2

Write Code

Standard Workflow:
  • Implement the task following specs
TDD Workflow (if enabled):
  • Write failing test first (RED)
  • Implement minimum code to pass (GREEN)
  • Refactor for quality (REFACTOR)
3

Mark Complete

Updates tasks.md: - [ ]- [x]
4

Save Progress

Persists apply-progress artifact with completed tasks

3. Batches Work

Implements tasks in logical phases:
  • Phase 1: Foundation - Core infrastructure
  • Phase 2: Implementation - Main functionality
  • Phase 3: Testing & Polish - Tests and refinements
Pauses between phases for user confirmation.

4. Reports Progress

Shows:
  • Files created/modified
  • Tasks completed
  • Next phase preview

Example Usage

Standard Implementation

Output:
✅ Satisfies spec scenario: “Theme context provides current theme and toggle function”

Task 1.2: Add CSS custom properties ✓

Modified src/styles/globals.css Added:
  • 12 CSS custom properties for colors
  • Light mode definitions (default)
  • Dark mode overrides in .dark class
✅ Satisfies spec requirement: “System SHALL support light and dark color schemes”

Task 1.3: Wrap app with ThemeProvider ✓

Modified src/components/Layout.tsx

Phase 1 Complete ✓

Progress: 3/9 tasks done Files Changed:
  • Created: src/context/ThemeContext.tsx
  • Modified: src/styles/globals.css
  • Modified: src/components/Layout.tsx
Next: Phase 2 (Implementation) - 4 tasks Continue with Phase 2?
Output:
Run test: npm test csv-serializer.test.ts ❌ FAIL - Module not found: Cannot resolve ’../csv-serializer’

GREEN: Make Test Pass

Created src/services/csv-serializer.ts
Run test: npm test csv-serializer.test.ts ✅ PASS - 1 test passed (12ms)

REFACTOR: Improve Quality

  • Added TypeScript generics for type safety
  • Extracted options to constant
  • Added JSDoc comments
Final implementation:
Run test: npm test csv-serializer.test.ts ✅ PASS - 1 test passed (11ms)
✅ Task 1.1 Complete TDD Cycle: RED → GREEN → REFACTOR ✓ Test Coverage: 100% for CsvSerializer Proceeding to Task 1.2…
boolean
default:"false"
Enable Test-Driven Development workflow
string
required
Command to run tests (e.g., npm test, pytest, go test)

Implementation Patterns

The implementer sub-agent follows these patterns:

1. Read Before Writing

Always reads existing code in the affected area:
  • Current implementation patterns
  • Naming conventions
  • Import styles
  • Error handling approaches

2. Follow Existing Conventions

Matches:
  • File structure
  • Naming patterns
  • Code organization
  • Comment style

3. Satisfy Specs

Each implementation directly addresses spec scenarios:

4. Apply Design Decisions

Follows architecture choices from design.md:
  • Component structure
  • Data flow patterns
  • State management approach
  • API contracts

Progress Tracking

As tasks complete, tasks.md updates: Before:
After:

When to Use

After Planning

All planning artifacts (proposal, specs, design, tasks) exist

Reviewed Plan

You’ve reviewed and approved the implementation plan

Ready to Code

Ready for the implementer to write actual code

Incremental Progress

Want to implement in phases with checkpoints
Don’t run /sdd-apply without reviewing tasks.md first. The implementer follows the task list exactly.

Pausing and Resuming

You can pause between phases:
Options:
  • Type “yes” or “continue” → Proceed to Phase 2
  • Type “pause” → Stop and review code
  • Type “revise task 2.1” → Modify a task before continuing
  • Run /sdd-apply again later → Resumes where it left off

Error Handling

If implementation fails:
The implementer:
  1. Detects the error
  2. Analyzes the issue
  3. Fixes the problem
  4. Retries the task

Progress Artifact

Progress is saved to apply-progress artifact:

Best Practices

Before running /sdd-apply, read through the task list. Ensure tasks are:
  • Small enough (< 4 hours each)
  • In logical order
  • Well-described
Don’t try to complete all tasks in one go. Pause between phases to:
  • Test implemented code
  • Review for quality
  • Catch issues early
Enable TDD for:
  • Business logic
  • API endpoints
  • Utility functions
  • Complex algorithms
Check which files are being modified. If the implementer touches unexpected files, pause and investigate.
  • /sdd-verify - Validate implementation after /sdd-apply
  • /sdd-continue - Alternative for phase-by-phase work
  • /sdd-ff - Generate all planning artifacts first