Analyze a project's codebase and generate an architecture overview with Mermaid diagrams in a single markdown file. Use when: the user asks for an architecture overview, architecture diagram, project structure analysis, or system design summary.
How this skill is triggered — by the user, by Claude, or both
Slash command
/architecture-overview:generateThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate a comprehensive architecture overview of the current project as a single markdown document with embedded Mermaid diagrams.
Generate a comprehensive architecture overview of the current project as a single markdown document with embedded Mermaid diagrams.
None. Mermaid diagrams render natively in GitHub, GitLab, VS Code, and most markdown viewers.
src/, Sources/, lib/, app/)package.json, Package.swift, build.gradle, etc.)Classify the codebase into layers. Common patterns include:
| Layer | Examples |
|---|---|
| Presentation / UI | Views, components, pages, screens, templates |
| Application / Services | Business logic, use cases, service classes, controllers |
| Domain / Models | Data models, entities, enums, value objects |
| Infrastructure / Persistence | Database access, API clients, file I/O, platform APIs |
| Helpers / Utilities | Shared helpers, extensions, date formatters, constants |
Adapt the layers to match what the project actually uses — don't force a pattern that isn't there.
Identify how layers depend on each other:
Produce a single markdown file containing both the diagrams and the written overview. Use this structure:
# Architecture Overview: {Project Name}
## Project Summary
{One paragraph describing what the project is and its tech stack.}
## Architecture Diagram
{Layer overview mermaid diagram — see "Layer Overview Diagram" below.}
## Layer Descriptions
### {Layer 1 Name}
- **Purpose**: ...
- **Key files/classes**: ...
- **Dependencies**: ...
### {Layer 2 Name}
...
## Subsystem Details
### {Subsystem 1 Name}
{Brief description of this subsystem's responsibility.}
{Per-subsystem class diagram — see "Per-Subsystem Class Diagrams" below.}
### {Subsystem 2 Name}
...
## Data Flow
{Brief prose overview of how data moves through the system — a paragraph or numbered list describing the typical request/action flow through the layers.}
### {Flow 1 Name}
{One-sentence description of what triggers this flow.}
{Sequence diagram — see "Key Data Flow Sequence Diagrams" below.}
### {Flow 2 Name}
...
Create a graph TD (top-down) mermaid diagram showing all subsystems/layers as nodes with dependency arrows between them.
Template:
```mermaid
graph TD
classDef ui fill:#d0ebff,stroke:#1971c2,stroke-width:2px,color:#1971c2
classDef services fill:#d3f9d8,stroke:#2b8a3e,stroke-width:2px,color:#2b8a3e
classDef models fill:#e5dbff,stroke:#5f3dc4,stroke-width:2px,color:#5f3dc4
classDef infra fill:#ffe3e3,stroke:#c92a2a,stroke-width:2px,color:#c92a2a
classDef helpers fill:#fff3bf,stroke:#e67700,stroke-width:2px,color:#e67700
UI["Presentation / UI<br/>Views, Components"]:::ui
SVC["Services<br/>Business Logic"]:::services
MDL["Models / Domain<br/>Entities, Enums"]:::models
INF["Infrastructure<br/>DB, API Clients"]:::infra
UI -->|"calls"| SVC
SVC -->|"uses"| MDL
SVC -->|"reads/writes"| INF
INF -->|"persists"| MDL
```
Rules:
["Name<br/>Short summary"] for multi-line labels.:::className using the classDef definitions above.-->|"label"| for solid arrows, -.->|"label"| for dashed arrows (cross-subsystem or weak dependencies).For each major subsystem, create a classDiagram mermaid block showing the classes/interfaces within that subsystem and their relationships. Do not include helper/utility classes.
Template:
```mermaid
classDiagram
class DrinkService {
+addDrink()
+deleteDrink()
+fetchDrinks()
}
class GoalService {
+getCurrentGoal()
+updateGoal()
}
class DrinkEntry {
+id: UUID
+amount: Double
+timestamp: Date
}
DrinkService --> DrinkEntry : manages 1:n
DrinkService --> Liquid : uses
GoalService ..> ExternalAPI : fetches from
```
Rules:
<<interface>>, <<enum>>, <<abstract>>, <<struct>>.--> solid arrow for intra-subsystem dependencies...> dashed arrow for cross-subsystem dependencies.: describes the relationship (e.g., : manages 1:n, : uses, : has, : creates, : inherits).1:n, 1:1, 0..n).style directives on individual nodes to match the layer color scheme:
style DrinkService fill:#d3f9d8,stroke:#2b8a3e
style GoalService fill:#d3f9d8,stroke:#2b8a3e
Use these colors consistently across all diagrams:
| Layer Type | fill | stroke | Used in |
|---|---|---|---|
| UI / Presentation | #d0ebff | #1971c2 | classDef ui, style |
| Services / Logic | #d3f9d8 | #2b8a3e | classDef services, style |
| Models / Domain | #e5dbff | #5f3dc4 | classDef models, style |
| Infrastructure / Persistence | #ffe3e3 | #c92a2a | classDef infra, style |
| Helpers / Utilities | #fff3bf | #e67700 | classDef helpers, style |
| Cross-subsystem reference | #f1f3f5 | #868e96 | dashed arrows (..>) |
Identify 1–3 key user interactions (e.g., creating a record, submitting a form, processing a request) and create a sequenceDiagram mermaid block for each. These show the runtime flow across layers — complementing the static class diagrams above.
Template:
```mermaid
sequenceDiagram
actor User
participant UI as QuickAddView
participant SVC as DrinkService
participant DB as SwiftData
User->>UI: taps "Add Drink"
UI->>SVC: addEntry(liquid, volume)
SVC->>DB: insert(DrinkEntry)
SVC->>DB: save()
SVC-->>UI: DrinkEntry
UI-->>User: updates summary
```
Rules:
actor for the user/external trigger. Use participant for internal components (views, services, persistence, external APIs).participant SVC as DrinkService.->> solid arrow for synchronous calls (request).-->> dashed arrow for returns/responses.--) solid arrow with open head for async/fire-and-forget (e.g., scheduling a notification).Note over or Note right of sparingly to clarify non-obvious behavior (e.g., "SwiftData @Query auto-updates UI").alt/else blocks for conditional paths only when they are essential to understanding the flow. Don't over-detail happy-path-only flows.Note.box groups when it helps distinguish layers:
box rgb(208,235,255) Presentation
participant UI as QuickAddView
end
Use the same layer color scheme (hex values from the Color Scheme table, as rgb(r,g,b)).architecture-overview.md at the project root.Re-read each mermaid code block and verify before rendering:
end, graph, subgraph, style, class, classDef, click, callback, link, linkStyle. Wrap them in quotes or use alternative IDs (e.g., EndNode["End"] instead of end).["..."] syntax." has a matching close.--> for solid, -.-> for dashed, -->|"label"| for labeled arrows in graph. --> and ..> with : label in classDiagram.classDef is only used in graph diagrams. For classDiagram, use per-node style directives instead.<br/> in graph node labels (not \n).Run the mermaid CLI to validate all diagrams parse correctly:
npx -y @mermaid-js/mermaid-cli -i architecture-overview.md -o /tmp/mermaid-validation.md -q
Fix any syntax errors and re-run until all diagrams pass (look for ✅ per diagram).
Render all diagrams to PNG at 2x scale for readability, then visually inspect each one:
npx -y @mermaid-js/mermaid-cli -i architecture-overview.md -o /tmp/mermaid-review.md -e png -s 2 -q
This produces numbered PNG files (/tmp/mermaid-review-1.png, /tmp/mermaid-review-2.png, etc.) — one per mermaid block in document order. Read each PNG image using the Read tool and check for:
If any issues are found, edit the mermaid source in architecture-overview.md to fix them (e.g., shorten long labels, split an overcrowded diagram, reorder node declarations to hint better layout), then re-render and re-check the affected diagrams.
Verify the output against the quality checklist below.
..> or -.->)Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Applies a firm's KYC/AML rules grid to parsed onboarding records: assigns risk rating, checks required documents, outputs rule outcomes with citations, and routes for escalation.
Generates daily or weekly digests of activity from connected sources (chat, email, docs, tasks, CRM), highlighting action items, decisions, mentions, and project updates.
npx claudepluginhub egamma/plugins --plugin architecture-overview