design-doc
Design Doc — Engineering Design Document Generator
Generate complete, publication-ready design documents with embedded Mermaid diagrams from a single prompt.
Philosophy
- One-shot output — Full document from single prompt
- Diagrams first-class — Every doc includes 2-5 Mermaid diagrams
- Opinionated defaults — Make reasonable choices, document in Decision Log
Workflow
- Parse request — Extract what, why, who, constraints, scope
- Clarify only if critical — ONE round of ≤4 questions if truly vague
- Select diagrams — Use decision matrix below
- Generate document — Use template, all sections substantive
- Save —
.output/design-doc-{topic}-{timestamp}.md
Diagram Selection Matrix
| Scenario | Diagrams |
|---|---|
| New service/microservice | C4 Context, C4 Container, Sequence, ERD |
| Feature in existing system | Component, Sequence, State (if stateful) |
| API design | C4 Context, Sequence, Class, ERD |
| Data pipeline/ETL | Flowchart, C4 Container, ERD |
| Auth/authorization | Sequence, C4 Context, State |
| Event-driven | C4 Container, Sequence, Flowchart |
| Migration/refactor | C4 Container (before+after), Flowchart |
Always include: 1 context-level diagram + 1 flow diagram
Document Template
# Design Document: {Title}
**Author:** {User}
**Date:** {YYYY-MM-DD}
**Status:** Draft
## 1. Overview
### Problem Statement
### Goals
### Non-Goals
## 2. Architecture
### System Context
```mermaid
{C4 Context}
Container View
{C4 Container}
3. Component Design
{Component/Class}
4. Data Model
{ERD}
5. Key Flows
Primary Flow
{Sequence}
6. State Management (if applicable)
{State}
7. API Contracts (if applicable)
8. Non-Functional Requirements
| Requirement | Target |
|---|---|
| Availability | 99.9% |
| Latency (p99) | <200ms |
9. Security Considerations
10. Decision Log
| # | Decision | Rationale |
|---|
11. Risks & Mitigations
12. Open Questions
---
## Diagram Styling
```mermaid
%%{init: {'theme': 'default'}}%%
flowchart TD
A[Service]:::primary --> B[(Database)]:::secondary
A --> C[External]:::accent
classDef primary fill:#2374ab,color:#fff
classDef secondary fill:#57a773,color:#fff
classDef accent fill:#ff8c42,color:#fff
Quick Commands
| User Says | Action |
|---|---|
| "Design a {system}" | Full design document |
| "Create design doc for {feature}" | Scoped to feature |
| "Architect {system}" | Architecture-focused doc |
| "How should I design {thing}?" | Doc with Decision Log |
Reference
references/mermaid-syntax.md — Full syntax for all diagram types
More from ajaywadhara/agent-skills
spring-boot-4-migration
Migrate Spring Boot applications from 3.x to 4.x with step-by-step guidance. Covers all 10 migration phases including build files, Jackson 3, Security 7, testing, and observability. Use when upgrading Spring Boot, migrating to Boot 4, or modernizing Spring applications. Supports gradual (6 tracks) or all-at-once migration strategies.
4openapi-architect
Design and generate OpenAPI 3.1 specifications following REST best practices. Creates API specs from requirements, reviews existing specs for compliance, implements RFC 7807 error handling, designs security schemes, and structures pagination/filtering. Use when designing APIs, creating OpenAPI specs, reviewing API design, or architecting REST endpoints.
4figma-to-code
Convert Figma designs into production UI code. Accepts Figma JSON exports, screenshots, or dev-mode snippets. Detects the project's existing frontend framework, design system, and component patterns — generates code that matches. Use when the user wants to build UI from Figma, convert Figma to code, implement a Figma design, or mentions "figma pack".
2commit-push-pr
Commit, push, and optionally create a PR for changes. Use when user says: commit my changes, commit and push, push my code, create a PR, commit push pr, or any variation requesting to commit/push changes to git.
2multi-module-scaffolder
Scaffold complete multi-module Gradle projects with Spring Boot 4, Java 21, and a production-grade exception handling architecture. Generates server, api-gateway, and common:exception modules with version catalog, GlobalExceptionHandler, ErrorCode enum, ErrorResponse record, and per-module exception hierarchy. Use when asked to scaffold a project, create a multi-module Gradle project, generate a new Spring Boot project, or set up a microservice skeleton.
2senior-eng-review
Mission-critical codebase audit for Senior Engineering Managers. Evaluates Reliability, Data Integrity (Payments), Architecture, and Quality against strict "Big Tech" standards (99.999% availability, Idempotency, Safety First).
1