Metadata
sdd-design2.0gentleman-programmingMITWhen It’s Triggered
The orchestrator launchessdd-design when:
- User runs
/sdd-new <change-name>(after specs) - User wants to create or update the technical design
- Specs are complete and ready for technical planning
What It Does
Step 1: Read the Codebase
Before designing, reads the actual code that will be affected:- Entry points and module structure
- Existing patterns and conventions
- Dependencies and interfaces
- Test infrastructure (if any)
Step 2: Write design.md
Creates a design document:Design Document Format
Example: Dark Mode Design
useTheme Hook
CSS Variables Structure
Testing Strategy
| Layer | What to Test | Approach |
|---|---|---|
| Unit | ThemeContext toggle logic | React Testing Library: render provider, toggle, assert state change |
| Unit | useTheme hook error when outside provider | Assert that hook throws when not wrapped in ThemeProvider |
| Unit | localStorage read/write | Mock localStorage, test persistence and retrieval |
| Integration | Theme changes apply to UI | Render full app, toggle theme, assert CSS variable values change |
| E2E | Theme persists across reload | Cypress: toggle theme, reload page, assert theme is still applied |
Migration / Rollout
No migration required. This is a purely additive feature with no breaking changes. Feature flag: Not needed. Theme toggle will be visible to all users immediately. If gradual rollout is desired, addFEATURE_DARK_MODE env var.
Open Questions
None — design is ready for implementation.Rules
- ALWAYS read the actual codebase before designing — never guess
- Every decision MUST have a rationale (the “why”)
- Include concrete file paths, not abstract descriptions
- Use the project’s ACTUAL patterns and conventions, not generic best practices
- If the codebase uses a pattern different from what you’d recommend, note it but FOLLOW the existing pattern unless the change specifically addresses it
- Keep ASCII diagrams simple — clarity over beauty
- Apply any
rules.designfromopenspec/config.yaml - If you have open questions that BLOCK the design, say so clearly — don’t guess
- Return a structured envelope with:
status,executive_summary,detailed_report,artifacts,next_recommended, andrisks
Common Architecture Decisions
- State management: Context vs Redux vs Zustand vs local state
- Styling approach: CSS-in-JS vs CSS Modules vs Tailwind vs plain CSS
- Data fetching: React Query vs SWR vs manual fetch
- Type safety: TypeScript interfaces vs PropTypes
- Testing: Vitest vs Jest, React Testing Library vs Enzyme
- Component patterns: Compound components vs render props vs hooks
Related
- Spec Writer — Provides specs that inform design
- Task Planner — Breaks design into implementation tasks
- OpenSpec Convention