From claude-commands
Generates product specs, engineering designs, and TDD implementation plans for features, bugfixes, migrations, or refactors via multi-perspective analysis, validation, and adversarial review.
npx claudepluginhub joshuarweaver/cascade-code-general-misc-2 --plugin jleechanorg-claude-commandsThis skill uses the workspace's default tool permissions.
**Purpose**: Generate comprehensive product specification and engineering design documents to prevent implementation failures through proper planning.
Generates architecture/design documents from approved SRS docs when no prior design exists, proposing 2-3 approaches with trade-offs and securing section-by-section approval.
Provides templates and criteria for PRD, ADR, UI Specs, Design Docs, and Work Plans. Determines required docs based on feature type, file count, and changes like data flows or architecture.
Guides architecture design via Socratic questioning, generates technical docs like overview.md, domain-model.md, and ADR for new features, systems, or project structuring.
Share bugs, ideas, or general feedback.
Purpose: Generate comprehensive product specification and engineering design documents to prevent implementation failures through proper planning.
Usage: /design [feature-name] [--type=feature|bugfix|migration|refactor] — Creates product spec, eng design, and TDD implementation docs.
Default Composition: Requirements gathering → Architecture assessment → Product strategy → Engineering leadership → Critical thinking → Research → Documentation
When invoked, execute these steps immediately. This is NOT documentation — these are commands to execute right now.
Verify all of:
MANDATORY FINAL STEP: After completing design documentation, automatically trigger comprehensive adversarial analysis to challenge the proposed approach and identify simpler alternatives.
SKIP sections that don't apply — Don't force irrelevant content:
Quality over completeness — Empty sections with good reason > Forced placeholder content
| Type | Focus |
|---|---|
| Features | Full product spec + engineering design |
| Bug fixes | Technical analysis, testing strategy, minimal product spec |
| Migrations | Risk assessment, rollout plan, minimal UI requirements |
| Refactoring | Technical goals, success metrics, skip user stories |
| Infrastructure | System design, monitoring, automation hooks — skip user journeys |
The /design command generates 3 comprehensive documents with TDD integration:
[feature]_product_spec.md)# [Feature] Product Specification
## Table of Contents
1. Executive Summary
2. Goals & Objectives
3. User Stories
4. Feature Requirements
5. User Journey Maps
6. UI/UX Requirements
7. Success Criteria
8. Metrics & KPIs
## Executive Summary
- Feature overview
- User value proposition
- Success metrics
## Goals & Objectives
### Primary Goals
- Business goal 1: [Measurable outcome]
- User goal 1: [User benefit]
### Secondary Goals
- Technical debt reduction
- Performance improvements
- Developer experience
## User Stories
- As a [user type], I want [goal] so that [benefit]
- Acceptance criteria for each story
## Feature Requirements
### Functional Requirements
- Core features list
- User interactions
- Data requirements
### Non-Functional Requirements
- Performance targets
- Security requirements
- Accessibility standards
## UI/UX Requirements
### Visual Component Specifications
- Component Tree: diagram of component hierarchy
- State Diagrams: UI state changes
- User Flow Diagrams: user journeys
- Component Library: Existing vs new components
### Responsive Behavior
- Mobile breakpoints
- Accessibility considerations
- Performance targets
## Success Criteria
- Feature complete checklist
- Performance benchmarks
- User acceptance tests
## Metrics & KPIs
- Adoption rate targets
- Performance baselines
[feature]_eng_design.md)# [Feature] Engineering Design
## Table of Contents
1. Engineering Goals
2. Engineering Tenets
3. Technical Overview
4. System Design
5. Quality Assurance
6. Testing Strategy
7. Risk Assessment
8. Decision Records
9. Rollout Plan
10. Monitoring & Success Metrics
11. Automation Hooks
## Engineering Goals
### Primary Engineering Goals
- Goal 1: [Technical outcome with metrics]
- Goal 2: [Performance target with baseline]
### Secondary Engineering Goals
- Code maintainability improvements
- Developer productivity enhancements
## Engineering Tenets
1. **Reliability First**: Prefer proven solutions over cutting-edge
2. **Simplicity**: Choose the simplest solution that works
3. **Testability**: All code must be testable
4. **Observability**: Instrument everything for debugging
5. **Performance**: Measure before optimizing
## System Design
### Component Architecture
- Component hierarchy
- Data flow diagram
- State management
### API Design
- Endpoints required
- Request/response schemas
- Error handling
### Database Design
- Schema changes
- Migration strategy
## Testing Strategy
### Unit Tests
- Component testing
- API testing with mocked dependencies
- Edge case handling
### Integration Tests
- User journey tests (end-to-end)
- API integration tests
- Cross-component communication
### Acceptance Tests
- Feature parity checklist
- Performance benchmarks
- User acceptance criteria
## Risk Assessment
### Technical Risks
- **High Risk**: [Description] → [Mitigation]
- **Medium Risk**: [Description] → [Monitoring]
- **Low Risk**: [Description] → [Acceptance criteria]
## Decision Records
**Decision**: [Choice made]
**Context**: [Why needed]
**Options**: [Alternatives considered]
**Rationale**: [Why chosen]
**Consequences**: [Trade-offs accepted]
## Rollout Plan
- Feature flags
- Staged rollout
- Rollback strategy
## Monitoring & Success Metrics
- Logging strategy
- Performance monitoring
- User analytics
[feature]_implementation_plan.md)# [Feature] TDD Implementation Plan
## Table of Contents
1. Implementation Overview
2. Scope & Delta Analysis
3. Phase Breakdown
4. Sub-Milestone Planning
5. TDD Test Strategy
6. Git Commit Strategy
7. Progress Tracking
8. Success Validation
## Scope & Delta Analysis
### Lines of Code Estimation
- **New Code**: ~X lines
- **Modified Code**: ~Y lines
- **Total Delta**: ~(X+Y) lines
- **Confidence**: High/Medium/Low
## Sub-Milestone Planning
*Each sub-milestone targets ~100 delta lines*
### SM1.1: [Milestone Name] (~100 lines)
**Files**: [Specific files]
**Commit**: `[type](scope): [description]`
**TDD Approach**:
- **Red**: Write failing test for [functionality]
- **Green**: Implement minimal code to pass
- **Refactor**: Clean up implementation
### SM1.2: [Milestone Name] (~100 lines)
[Same structure]
## TDD Test Strategy
### Red-Green-Refactor Cycle
1. **Red**: Write failing test
2. **Green**: Minimal code to pass
3. **Refactor**: Improve quality
4. **Validate**: Acceptance criteria
## Git Commit Strategy
### Commit Message Format
[type](scope): [description]
TDD: [Red/Green/Refactor phase]
Test: [Validation summary]
### Branch Strategy
- Feature branch per phase
- Sub-milestone commits (~100 lines each)
## Progress Tracking
### Per Sub-Milestone Validation
1. Functionality works as designed
2. All tests pass, coverage maintained
3. Code quality standards met
4. No breaking changes to existing code
5. Changes documented
## Success Validation
Feature complete when:
- All phases completed
- End-to-end user journeys tested
- Performance benchmarks achieved
- Documentation complete
For each major design decision:
| Solution | Time | Maintenance | Risk | Suitability |
|---|---|---|---|---|
| Simple Fix | [X min] | Low/Med/High | Low/Med/High | 1-5 |
| Standard Tool | [X hours] | Low/Med/High | Low/Med/High | 1-5 |
| Custom Build | [X days] | Low/Med/High | Low/Med/High | 1-5 |
Before coding:
/design react-v3-migration
→ [feature]_product_spec.md
→ [feature]_eng_design.md
→ [feature]_implementation_plan.md
/design multiplayer-campaigns --type=feature
→ Full 3-doc suite
/design fix-login-bug --type=bugfix
→ Focused technical analysis + minimal product spec
The /design command succeeds when:
Generalized from your-project.com/.claude/commands/design.md (1140 lines, 35KB).
Original repo-specific backup preserved at ~/.claude/skills/design-doc-backup-worldarchitect.md.