System Design Architect
This skill transforms high-level ideas into concrete, code-ready blueprints and comprehensive design documentation.
Integration Note: This skill uses prompt-engineering for "Structured Output" (File Trees) and "Chain-of-Thought" (Architecture decisions).
1. Design Document Protocol
Use when: "Create a design doc", "Plan this feature", "Document the architecture".
Instruction:
Follow this 7-step process to create comprehensive design documentation:
Step 1: Requirements Analysis
- Identify all functional requirements
- Define non-functional requirements (performance, security, scalability)
- List constraints (technology stack, timeline, resources)
- Map integration points with existing systems
Step 2: Research & Context
- Research technology choices and alternatives
- Identify third-party integrations
- Document findings with sources and impact on design
Step 3: Define System Architecture
- Create high-level system overview
- Define component responsibilities
- Document data flow between components
- Record technology decisions with rationale
Step 4: Design Components & Interfaces
For each major component, document:
- Purpose and responsibilities
- Inputs, outputs, and dependencies
- API definitions (TypeScript interfaces or equivalent)
Step 5: Define Data Models
For each entity:
- Properties with types and validation rules
- Relationships to other entities
- Example JSON representation
Step 6: Plan Error Handling
- Categorize errors (validation, auth, external, system)
- Define response strategy (HTTP codes, messages, actions)
- Document recovery mechanisms (retries, fallbacks, circuit breakers)
Step 7: Define Testing Strategy
- Unit testing: coverage targets, focus areas, mocking strategy
- Integration testing: scope, environment, test data
- E2E testing: critical user journeys
- Performance testing: load targets, benchmarks
Output Template:
# Design Document: [Feature Name]
## Overview
[High-level summary]
## Architecture
[System architecture and component overview with diagram]
## Components and Interfaces
[Detailed component descriptions]
## Data Models
[Data structures and relationships]
## Error Handling
[Error scenarios and response strategies]
## Testing Strategy
[Testing approach and quality assurance]
2. Blueprint Protocol
Use when: "Scaffold a new feature", "Plan the file structure".
Instruction:
- Select Pattern: Choose the best-fit architecture:
- Vertical Slice: For feature-centric apps (React, Next.js)
- Clean Architecture: For API services with clear domain separation
- Hexagonal: For apps with many external integrations
- CQRS: For systems with asymmetric read/write patterns
- Generate Tree: Output a file tree using standard ASCII format.
- Mark directories with
/
- Annotate key files with
(New) or (Modified)
- Define Responsibilities: Briefly explain why each file exists.
Example Output:
src/
├── features/
│ └── user-profile/ (New)
│ ├── components/
│ │ ├── ProfileCard.tsx (New) - Displays user info
│ │ └── EditForm.tsx (New) - Handles profile edits
│ ├── hooks/
│ │ └── useProfile.ts (New) - Data fetching logic
│ ├── api/
│ │ └── profileApi.ts (New) - API client
│ └── index.ts (New) - Public exports
├── shared/
│ └── types/
│ └── user.ts (Modified) - Add profile fields
3. Diagram Protocol (Mermaid)
Use when: "Draw a diagram", "Visualize the flow", "Show the architecture".
Instruction:
- Format: Use
mermaid code blocks.
- Diagram Types:
| Type |
Use For |
flowchart TD |
Logic flows, decision trees |
sequenceDiagram |
API calls, service interactions |
erDiagram |
Database schemas, entity relationships |
C4Context |
System context diagrams |
C4Container |
Container-level architecture |
stateDiagram-v2 |
State machines, lifecycle flows |
- Style: Keep labels concise. Use subgraphs to group related components.
Example:
graph TD
A[Client] --> B[API Gateway]
B --> C[Auth Service]
B --> D[Feature Service]
D --> E[(Database)]
D --> F[(Cache)]
4. Decision Documentation (ADR)
Use when: "Document this decision", "Why did we choose X?", "Record the trade-off".
Delegate: Use the documentation-standards skill's ADR Protocol (Section 5) for creating Architecture Decision Records.
- Template:
templates/adr.md
- Full workflow for context, options, consequences, and status tracking
Architecture decisions are a critical part of the design process. Record them as ADRs to maintain a decision log that future developers can reference.
5. Tech Stack Validator
Use when: "What libraries should I use?", "Is this the right tool?".
Instruction:
- Check Context: Examine existing config files first:
- JavaScript/TypeScript:
package.json
- Python:
requirements.txt, pyproject.toml
- Go:
go.mod
- Rust:
Cargo.toml
- Avoid Redundancy: Don't recommend libraries with overlapping functionality.
- Align with Project Style: Match existing conventions (e.g., if project uses Tailwind, don't suggest CSS Modules).
Example Usage
- "Agent, create a design document for a 'User Profile' feature."
- "Agent, scaffold a 'Notifications' feature using Vertical Slice architecture."
- "Agent, draw a sequence diagram for the OAuth flow."
- "Agent, document the decision to use PostgreSQL over MongoDB."
1---2name: system-design-architect3description: Use when planning new features, creating design documents, scaffolding project file structure, or generating system diagrams (Mermaid). Covers requirements analysis, component design, data modeling, error handling, and testing strategy.4---56# System Design Architect78This skill transforms high-level ideas into concrete, code-ready blueprints and comprehensive design documentation.910> **Integration Note**: This skill uses `prompt-engineering` for "Structured Output" (File Trees) and "Chain-of-Thought" (Architecture decisions).1112---1314## 1. Design Document Protocol1516**Use when**: "Create a design doc", "Plan this feature", "Document the architecture".1718> **Instruction**:19>20> Follow this 7-step process to create comprehensive design documentation:21>22> ### Step 1: Requirements Analysis23>24> - Identify all functional requirements25> - Define non-functional requirements (performance, security, scalability)26> - List constraints (technology stack, timeline, resources)27> - Map integration points with existing systems28>29> ### Step 2: Research & Context30>31> - Research technology choices and alternatives32> - Identify third-party integrations33> - Document findings with sources and impact on design34>35> ### Step 3: Define System Architecture36>37> - Create high-level system overview38> - Define component responsibilities39> - Document data flow between components40> - Record technology decisions with rationale41>42> ### Step 4: Design Components & Interfaces43>44> For each major component, document:45>46> - Purpose and responsibilities47> - Inputs, outputs, and dependencies48> - API definitions (TypeScript interfaces or equivalent)49>50> ### Step 5: Define Data Models51>52> For each entity:53>54> - Properties with types and validation rules55> - Relationships to other entities56> - Example JSON representation57>58> ### Step 6: Plan Error Handling59>60> - Categorize errors (validation, auth, external, system)61> - Define response strategy (HTTP codes, messages, actions)62> - Document recovery mechanisms (retries, fallbacks, circuit breakers)63>64> ### Step 7: Define Testing Strategy65>66> - Unit testing: coverage targets, focus areas, mocking strategy67> - Integration testing: scope, environment, test data68> - E2E testing: critical user journeys69> - Performance testing: load targets, benchmarks7071**Output Template**:7273```markdown74# Design Document: [Feature Name]7576## Overview7778[High-level summary]7980## Architecture8182[System architecture and component overview with diagram]8384## Components and Interfaces8586[Detailed component descriptions]8788## Data Models8990[Data structures and relationships]9192## Error Handling9394[Error scenarios and response strategies]9596## Testing Strategy9798[Testing approach and quality assurance]99```100101---102103## 2. Blueprint Protocol104105**Use when**: "Scaffold a new feature", "Plan the file structure".106107> **Instruction**:108>109> 1. **Select Pattern**: Choose the best-fit architecture:110> - _Vertical Slice_: For feature-centric apps (React, Next.js)111> - _Clean Architecture_: For API services with clear domain separation112> - _Hexagonal_: For apps with many external integrations113> - _CQRS_: For systems with asymmetric read/write patterns114> 2. **Generate Tree**: Output a file tree using standard ASCII format.115> - Mark directories with `/`116> - Annotate key files with `(New)` or `(Modified)`117> 3. **Define Responsibilities**: Briefly explain _why_ each file exists.118119**Example Output**:120121```122src/123├── features/124│ └── user-profile/ (New)125│ ├── components/126│ │ ├── ProfileCard.tsx (New) - Displays user info127│ │ └── EditForm.tsx (New) - Handles profile edits128│ ├── hooks/129│ │ └── useProfile.ts (New) - Data fetching logic130│ ├── api/131│ │ └── profileApi.ts (New) - API client132│ └── index.ts (New) - Public exports133├── shared/134│ └── types/135│ └── user.ts (Modified) - Add profile fields136```137138---139140## 3. Diagram Protocol (Mermaid)141142**Use when**: "Draw a diagram", "Visualize the flow", "Show the architecture".143144> **Instruction**:145>146> 1. **Format**: Use `mermaid` code blocks.147> 2. **Diagram Types**:148> | Type | Use For |149> |------|---------|150> | `flowchart TD` | Logic flows, decision trees |151> | `sequenceDiagram` | API calls, service interactions |152> | `erDiagram` | Database schemas, entity relationships |153> | `C4Context` | System context diagrams |154> | `C4Container` | Container-level architecture |155> | `stateDiagram-v2` | State machines, lifecycle flows |156> 3. **Style**: Keep labels concise. Use subgraphs to group related components.157158**Example**:159160```mermaid161graph TD162 A[Client] --> B[API Gateway]163 B --> C[Auth Service]164 B --> D[Feature Service]165 D --> E[(Database)]166 D --> F[(Cache)]167```168169---170171## 4. Decision Documentation (ADR)172173**Use when**: "Document this decision", "Why did we choose X?", "Record the trade-off".174175> **Delegate**: Use the [`documentation-standards`](../documentation-standards/SKILL.md) skill's **ADR Protocol** (Section 5) for creating Architecture Decision Records.176>177> - Template: [`templates/adr.md`](../documentation-standards/templates/adr.md)178> - Full workflow for context, options, consequences, and status tracking179180Architecture decisions are a critical part of the design process. Record them as ADRs to maintain a decision log that future developers can reference.181182---183184## 5. Tech Stack Validator185186**Use when**: "What libraries should I use?", "Is this the right tool?".187188> **Instruction**:189>190> 1. **Check Context**: Examine existing config files first:191> - JavaScript/TypeScript: `package.json`192> - Python: `requirements.txt`, `pyproject.toml`193> - Go: `go.mod`194> - Rust: `Cargo.toml`195> 2. **Avoid Redundancy**: Don't recommend libraries with overlapping functionality.196> 3. **Align with Project Style**: Match existing conventions (e.g., if project uses Tailwind, don't suggest CSS Modules).197198---199200## Example Usage201202- "Agent, create a design document for a 'User Profile' feature."203- "Agent, scaffold a 'Notifications' feature using Vertical Slice architecture."204- "Agent, draw a sequence diagram for the OAuth flow."205- "Agent, document the decision to use PostgreSQL over MongoDB."