Use when spec exists and is validated - generates implementation plan FROM spec, executes with TDD, and verifies spec compliance throughout
Implements features from validated specifications using Test-Driven Development. Triggers when you have a validated spec and are ready to write code, executing the full TDD cycle for each requirement while continuously verifying spec compliance.
/plugin marketplace add rhuss/cc-superpowers-sdd/plugin install sdd@sdd-plugin-developmentThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Implement features from validated specifications using Test-Driven Development, with continuous spec compliance checking throughout.
This is the core SDD implementation workflow: Spec → Plan → TDD → Verify.
Critical Rule: Implementation MUST match spec. Any deviation triggers spec evolution workflow.
Use this skill when:
Don't use this skill when:
sdd:spec or sdd:brainstorm firstsdd:evolvesystematic-debuggingEnsure spec-kit is initialized:
{Skill: spec-kit}
If spec-kit prompts for restart, pause this workflow and resume after restart.
Before starting implementation:
specs/features/[feature-name].mdsdd:review-spec)If prerequisites not met: Stop and address them first.
Load the spec:
cat specs/features/[feature-name].md
Extract key information:
Validate understanding:
Use sdd:writing-plans skill to create plan.
The plan MUST:
Plan structure:
# Implementation Plan: [Feature Name]
**Source Spec:** specs/features/[feature-name].md
**Date:** YYYY-MM-DD
## Requirements Coverage
### Functional Requirement 1: [From spec]
**Implementation approach:**
- [ ] Task 1
- [ ] Task 2
...
[Repeat for all functional requirements]
## Error Handling Implementation
[For each error case in spec]
- **Error:** [From spec]
- **Implementation:** [How to handle]
## Test Strategy
[How we'll verify each requirement]
## Files to Create/Modify
[List with file paths]
## Verification Steps
- [ ] All tests pass
- [ ] Spec compliance check passes
- [ ] Code review against spec
Save plan: docs/plans/[date]-[feature]-implementation.md
Use using-git-worktrees (optional but recommended):
git worktree add ../feature-[name] -b feature/[name]
cd ../feature-[name]
Or work in current branch:
Use test-driven-development skill.
For each requirement in spec:
Write test first (based on spec requirement)
Watch it fail
Write minimal code to pass
Refactor
Verify spec compliance
Track progress with TodoWrite:
During implementation, regularly check:
# Compare implementation to spec
# For each functional requirement:
# - ✓ Implemented as specified
# - ✗ Deviation detected → document reason
If deviation needed:
sdd:evolve during reviewUse sdd:review-code skill.
Review checks:
Output:
Use sdd:verification-before-completion skill.
Verification steps:
If verification fails: Fix issues before claiming completion.
Use TodoWrite to track:
User: Let's implement the user profile API from the spec
You: I'm using sdd:implement to build this feature from the spec.
Reading spec: specs/features/user-profile-api.md
The spec defines:
- PUT /api/users/:id/profile endpoint
- Fields: name (2-50 chars), bio (max 500), avatar_url
- Auth: JWT required
- Errors: 401, 403, 404, 422
- Success criteria: authenticated users can update profiles
Generating implementation plan from spec...
[Uses sdd:writing-plans]
Plan created: docs/plans/2025-11-10-user-profile-api-implementation.md
Plan includes:
1. Create route handler (src/api/users/profile.ts)
2. Add validation middleware (src/middleware/validate-profile.ts)
3. Update service layer (src/services/user.ts)
4. Add tests (tests/api/users/profile.test.ts)
Ready to implement with TDD. Starting...
[Uses test-driven-development]
Test 1: Should reject unauthenticated requests (Spec: Error Handling)
Writing test...
```typescript
test('PUT /api/users/:id/profile returns 401 without JWT', async () => {
const response = await request(app)
.put('/api/users/123/profile')
.send({ name: 'Test' });
expect(response.status).toBe(401);
expect(response.body.error).toBe('Authentication required');
});
Running test... ❌ FAIL (expected - no auth implemented yet)
Implementing auth middleware... [Adds JWT validation]
Running test... ✅ PASS
Spec compliance check: ✓ Matches spec requirement: "User must be authenticated with valid JWT" ✓ Error message matches spec: "Authentication required"
Test 2: Should validate name length (Spec: Functional Requirements #2)
Writing test...
test('PUT /api/users/:id/profile validates name length', async () => {
const token = generateTestJWT({ sub: '123' });
// Too short
let response = await request(app)
.put('/api/users/123/profile')
.set('Authorization', `Bearer ${token}`)
.send({ name: 'A' });
expect(response.status).toBe(422);
// Too long
response = await request(app)
.put('/api/users/123/profile')
.set('Authorization', `Bearer ${token}`)
.send({ name: 'A'.repeat(51) });
expect(response.status).toBe(422);
// Valid
response = await request(app)
.put('/api/users/123/profile')
.set('Authorization', `Bearer ${token}`)
.send({ name: 'Valid Name' });
expect(response.status).toBe(200);
});
Running test... ❌ FAIL
Implementing validation... [Adds name length validation]
Running test... ✅ PASS
Spec compliance check: ✓ Matches spec: "name: string, 2-50 characters"
[Continues through all requirements...]
All requirements implemented ✓
Requesting code review against spec... [Uses sdd:review-code]
Code Review Results: ✓ All functional requirements implemented (6/6) ✓ All error cases handled (4/4) ✓ All edge cases covered (3/3) ✓ Tests validate spec requirements
Spec Compliance: 100%
Deviations detected: 1
updated_at field to response (not in spec)
Reason: Standard practice for update endpoints
Recommendation: Update spec (minor addition)Running verification... [Uses sdd:verification-before-completion]
✅ All tests passing (24/24) ✅ Spec compliance validated ⚠️ Minor deviation: updated_at field
Recommendation: Use sdd:evolve to update spec with updated_at field
You: Should I update the spec to include the updated_at field?
## Handling Deviations
**When code deviates from spec:**
1. **Document the deviation** during implementation
2. **Note the reason** (technical constraint, better approach, etc.)
3. **Continue implementation** (don't block on it)
4. **Trigger evolution** during review
5. **Use `sdd:evolve`** to reconcile
**Never:**
- Silently deviate without documentation
- Force-fit code to incorrect spec
- Skip spec compliance checks
## Integration with Superpowers Skills
**This skill orchestrates:**
- `sdd:writing-plans` - Generate plan from spec
- `test-driven-development` - TDD implementation
- `sdd:review-code` - Spec compliance review
- `sdd:verification-before-completion` - Tests + spec validation
- `sdd:evolve` - If deviations need reconciliation
**Also compatible with:**
- `using-git-worktrees` - Isolated workspace
- `systematic-debugging` - If bugs found during implementation
## Success Criteria
**Implementation is complete when:**
- [ ] All spec requirements implemented
- [ ] All tests passing
- [ ] Spec compliance 100% (or deviations reconciled)
- [ ] Code review passed
- [ ] Verification passed
- [ ] All success criteria from spec met
## Common Pitfalls
**Avoid:**
- Implementing features not in spec
- Skipping TDD (spec doesn't mean no tests!)
- Ignoring error cases from spec
- Deviating without documentation
- Claiming completion before verification
**Instead:**
- Implement only what's in spec (YAGNI)
- TDD for every requirement
- Test all error cases from spec
- Document all deviations
- Verify before completing
## Remember
**The spec is your contract.**
- Don't add features not in spec
- Don't skip requirements from spec
- Don't ignore error cases in spec
- Don't deviate silently
**If spec is wrong or incomplete:**
- Document the issue
- Continue implementation
- Use `sdd:evolve` to fix spec
**Quality gates exist for a reason:**
- TDD ensures testability
- Code review ensures compliance
- Verification ensures correctness
**Follow the process. Ship quality code that matches the spec.**
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.