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.
This skill transforms high-level ideas into concrete, code-ready blueprints and comprehensive design documentation.
Integration Note: This skill uses
prompt-engineeringfor "Structured Output" (File Trees) and "Chain-of-Thought" (Architecture decisions).
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
For each major component, document:
For each entity:
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]
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
Use when: "Draw a diagram", "Visualize the flow", "Show the architecture".
Instruction:
- Format: Use
mermaidcode blocks.- Diagram Types:
Type Use For flowchart TDLogic flows, decision trees sequenceDiagramAPI calls, service interactions erDiagramDatabase schemas, entity relationships C4ContextSystem context diagrams C4ContainerContainer-level architecture stateDiagram-v2State 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)]
Use when: "Document this decision", "Why did we choose X?", "Record the trade-off".
Delegate: Use the
documentation-standardsskill'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.
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).