Loading...
Loading...
Create excellent technical documentation with Mermaid diagrams. Use when documenting code architecture, API flows, database schemas, state machines, system design, or any technical concept that benefits from visual diagrams. Also use when asked to explain code, create documentation, write README files, or document how systems work.
npx skill4agent add pranavred/claude-code-documentation-skill docs-with-mermaid| Documenting... | Use This Diagram |
|---|---|
| Process flow, algorithms, decision logic | Flowchart |
| API calls, service interactions, protocols | Sequence Diagram |
| Object-oriented design, class relationships | Class Diagram |
| Lifecycle, state machines, workflows | State Diagram |
| Database schema, data models | ER Diagram |
| System architecture (high level) | C4 Context Diagram |
| Application architecture (containers) | C4 Container Diagram |
| Component internals | C4 Component Diagram |
| User experience flows | User Journey |
| Project timelines | Gantt Chart |
| Prioritization matrices | Quadrant Chart |
| Hierarchical concepts | Mindmap |
| Historical events | Timeline |
| Git workflows | Git Graph |
| Proportions/percentages | Pie Chart |
# [System/Feature Name]
## Overview
[2-3 sentences explaining what this is and why it exists]
[HIGH-LEVEL DIAGRAM - typically flowchart or C4 Context]
## Key Concepts
[Explain important terms and concepts]
## Architecture
[Detailed architecture explanation]
[ARCHITECTURE DIAGRAM - C4 Container or detailed flowchart]
## How It Works
[Step-by-step explanation of the flow]
[SEQUENCE DIAGRAM or STATE DIAGRAM showing the flow]
## Data Model
[If applicable, explain the data structure]
[ER DIAGRAM or CLASS DIAGRAM]
## API Reference
[If applicable]
## Configuration
[Configuration options and examples]
## Troubleshooting
[Common issues and solutions]flowchart LR
A[Start Simple] --> B[Get Feedback]
B --> C{Need More Detail?}
C -->|Yes| D[Add Elements]
D --> B
C -->|No| E[Done]PascalCaseUserServiceOrderAPIcamelCaseprocessOrdervalidateUserSCREAMING_SNAKEMAX_RETRIESAPI_TIMEOUTflowchart TB
subgraph Frontend
A[Web App]
B[Mobile App]
end
subgraph Backend
C[API Gateway]
D[Services]
end
A --> C
B --> C
C --> DLRTBBTsequenceDiagram
participant C as Client
participant S as Server
C->>S: Request
Note right of S: Validates JWT token
S-->>C: Responseflowchart LR
A[Input]:::input --> B{Validate}
B -->|Valid| C[Process]:::success
B -->|Invalid| D[Error]:::error
classDef input fill:#e1f5fe
classDef success fill:#c8e6c9
classDef error fill:#ffcdd2sequenceDiagram
autonumber
participant Client
participant Gateway as API Gateway
participant Auth as Auth Service
participant API as Core API
participant DB as Database
Client->>Gateway: Request
Gateway->>Auth: Validate Token
alt Valid Token
Auth-->>Gateway: User Context
Gateway->>API: Forward Request
API->>DB: Query/Mutate
DB-->>API: Result
API-->>Gateway: Response
Gateway-->>Client: Success
else Invalid Token
Auth-->>Gateway: Unauthorized
Gateway-->>Client: 401 Error
endstateDiagram-v2
[*] --> Created
Created --> Active: activate
Active --> Paused: pause
Paused --> Active: resume
Active --> Completed: finish
Paused --> Cancelled: cancel
Active --> Cancelled: cancel
Completed --> [*]
Cancelled --> [*]flowchart TB
subgraph Gateway["API Gateway"]
LB[Load Balancer]
end
subgraph Services["Microservices"]
S1[Service A]
S2[Service B]
S3[Service C]
end
subgraph Data["Data Layer"]
DB1[(Database A)]
DB2[(Database B)]
Cache[(Redis)]
MQ[Message Queue]
end
LB --> S1
LB --> S2
LB --> S3
S1 --> DB1
S1 --> Cache
S2 --> DB2
S2 --> MQ
S3 --> MQ
MQ --> S1