Mermaid diagram templates for solution architecture, service communication, C4 Context/Container, data flow, agent flow, deployment, and sequence diagrams. Use when generating architecture diagrams.
Generates consistent Mermaid architecture diagrams for solution design, service communication, data flow, and deployment views.
npx claudepluginhub navraj007in/architecture-cowork-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Guidelines and templates for generating consistent, readable architecture diagrams using Mermaid syntax. All diagrams in this plugin use Mermaid — never ASCII art.
| Diagram | When to Use | Mermaid Type |
|---|---|---|
| Solution Architecture | Show the full system topology: clients, API gateway, services, queues, databases, storage, external APIs | graph TB |
| Service Communication | Show how microservices/backend services connect to each other with protocols and patterns | graph LR |
| C4 Context | Show the system in relation to users and external systems | graph TB |
| C4 Container | Show internal containers (frontends, services, databases) | graph TB |
| Data Flow | Show how data moves through the system | graph LR |
| Agent Flow | Show AI agent orchestration and tool usage | graph TD |
| Deployment | Show where components run | graph TB |
| Sequence | Show interaction between components over time | sequenceDiagram |
Use consistent colors across all diagrams:
| Component Type | Color | Mermaid Style |
|---|---|---|
| User / Actor | Grey | style ... fill:#e8e8e8,stroke:#999 |
| Frontend | Blue | style ... fill:#4a90d9,stroke:#2c5ea0,color:#fff |
| Backend Service | Green | style ... fill:#5cb85c,stroke:#3d8b3d,color:#fff |
| Database | Orange | style ... fill:#f0ad4e,stroke:#c77c00,color:#fff |
| External Service | Purple | style ... fill:#9b59b6,stroke:#6c3483,color:#fff |
| AI Agent / LLM | Red/Pink | style ... fill:#e74c3c,stroke:#c0392b,color:#fff |
| Message Queue | Teal | style ... fill:#1abc9c,stroke:#16a085,color:#fff |
Shows the full system topology from clients to infrastructure. Always generated for every blueprint. This is the primary "big picture" diagram that non-technical stakeholders see first.
Include all layers: clients (web, mobile), ingress (API gateway, CDN, load balancer), application services (APIs, workers, agents), messaging (queues, event bus), data (databases, cache, search), storage (file/object storage), and external integrations.
graph TB
subgraph "Clients"
WebApp["🌐 Web App<br/><i>Next.js</i>"]
MobileApp["📱 Mobile App<br/><i>React Native / Expo</i>"]
AdminApp["🔧 Admin Dashboard<br/><i>React / Vite</i>"]
end
subgraph "Ingress"
CDN["🌍 CDN<br/><i>Cloudflare</i>"]
Gateway["🚪 API Gateway<br/><i>Kong / AWS ALB / Nginx</i>"]
end
subgraph "Application Services"
API["⚙️ API Server<br/><i>Node.js / Express</i>"]
AuthService["🔐 Auth Service<br/><i>Clerk / Auth0</i>"]
Worker["⏰ Background Worker<br/><i>BullMQ</i>"]
Agent["🤖 AI Agent<br/><i>Python / FastAPI</i>"]
end
subgraph "Messaging"
Queue["📬 Job Queue<br/><i>Redis / BullMQ</i>"]
EventBus["📡 Event Bus<br/><i>Redis Pub/Sub</i>"]
end
subgraph "Data Stores"
DB[("🗄️ Primary Database<br/><i>PostgreSQL</i>")]
Cache[("⚡ Cache<br/><i>Redis</i>")]
Search[("🔍 Search Index<br/><i>Typesense</i>")]
end
subgraph "Storage"
ObjectStore["📦 Object Storage<br/><i>Cloudflare R2</i>"]
end
subgraph "External Services"
Stripe["💳 Stripe"]
Resend["📧 Resend"]
Claude["🤖 Claude API"]
end
WebApp --> CDN
MobileApp --> Gateway
AdminApp --> CDN
CDN --> Gateway
Gateway -->|"REST / GraphQL"| API
Gateway -->|"Auth check"| AuthService
API -->|"Read/write"| DB
API -->|"Cache"| Cache
API -->|"Enqueue jobs"| Queue
API -->|"Publish events"| EventBus
API -->|"Search"| Search
API -->|"Upload/download"| ObjectStore
API -->|"Payments"| Stripe
Queue --> Worker
Worker -->|"Read/write"| DB
Worker -->|"Send emails"| Resend
EventBus --> Agent
Agent -->|"LLM calls"| Claude
Agent -->|"Read/write"| DB
style WebApp fill:#4a90d9,stroke:#2c5ea0,color:#fff
style MobileApp fill:#4a90d9,stroke:#2c5ea0,color:#fff
style AdminApp fill:#4a90d9,stroke:#2c5ea0,color:#fff
style CDN fill:#d4e6f1,stroke:#2c5ea0
style Gateway fill:#d4e6f1,stroke:#2c5ea0
style API fill:#5cb85c,stroke:#3d8b3d,color:#fff
style AuthService fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Worker fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Agent fill:#e74c3c,stroke:#c0392b,color:#fff
style Queue fill:#1abc9c,stroke:#16a085,color:#fff
style EventBus fill:#1abc9c,stroke:#16a085,color:#fff
style DB fill:#f0ad4e,stroke:#c77c00,color:#fff
style Cache fill:#f0ad4e,stroke:#c77c00,color:#fff
style Search fill:#f0ad4e,stroke:#c77c00,color:#fff
style ObjectStore fill:#f39c12,stroke:#d68910,color:#fff
style Stripe fill:#9b59b6,stroke:#6c3483,color:#fff
style Resend fill:#9b59b6,stroke:#6c3483,color:#fff
style Claude fill:#e74c3c,stroke:#c0392b,color:#fff
Adaptation rules:
Additional color conventions for Solution Architecture:
| Component Type | Color | Mermaid Style |
|---|---|---|
| Ingress / Gateway / CDN | Light blue | style ... fill:#d4e6f1,stroke:#2c5ea0 |
| Object / File Storage | Dark orange | style ... fill:#f39c12,stroke:#d68910,color:#fff |
Shows how backend services, workers, and agents communicate with each other. Generated when the system has 2+ backend services. Focuses on inter-service protocols, sync vs async patterns, and data ownership boundaries.
graph LR
subgraph "Sync (REST/gRPC)"
API["⚙️ API Server"]
UserSvc["👤 User Service"]
OrderSvc["📦 Order Service"]
PaymentSvc["💳 Payment Service"]
NotifSvc["🔔 Notification Service"]
end
subgraph "Async (Events/Queues)"
Queue["📬 Job Queue<br/><i>Redis / BullMQ</i>"]
EventBus["📡 Event Bus<br/><i>Redis Pub/Sub</i>"]
end
subgraph "AI Services"
Agent["🤖 AI Agent"]
end
API -->|"REST: GET /users/:id"| UserSvc
API -->|"REST: POST /orders"| OrderSvc
OrderSvc -->|"REST: POST /payments/charge"| PaymentSvc
OrderSvc -->|"Publish: order.created"| EventBus
EventBus -->|"Subscribe: order.created"| NotifSvc
EventBus -->|"Subscribe: order.created"| Agent
PaymentSvc -->|"Publish: payment.completed"| EventBus
EventBus -->|"Subscribe: payment.completed"| OrderSvc
NotifSvc -->|"Enqueue: send-email"| Queue
Queue -->|"Process"| NotifSvc
style API fill:#5cb85c,stroke:#3d8b3d,color:#fff
style UserSvc fill:#5cb85c,stroke:#3d8b3d,color:#fff
style OrderSvc fill:#5cb85c,stroke:#3d8b3d,color:#fff
style PaymentSvc fill:#5cb85c,stroke:#3d8b3d,color:#fff
style NotifSvc fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Queue fill:#1abc9c,stroke:#16a085,color:#fff
style EventBus fill:#1abc9c,stroke:#16a085,color:#fff
style Agent fill:#e74c3c,stroke:#c0392b,color:#fff
Adaptation rules:
-->|"REST (retry: 3x, timeout: 5s)"| ServiceBWhen to generate this diagram:
Shows the system as a single box, with users and external systems around it.
graph TB
User["👤 End User<br/><i>Uses the application</i>"]
Admin["👤 Admin<br/><i>Manages content and users</i>"]
System["🏢 System Name<br/><i>Brief description of what<br/>the system does</i>"]
Email["📧 Email Service<br/><i>SendGrid / Resend</i>"]
Payment["💳 Payment Provider<br/><i>Stripe</i>"]
LLM["🤖 LLM Provider<br/><i>Anthropic Claude</i>"]
User -->|"Uses"| System
Admin -->|"Manages"| System
System -->|"Sends emails via"| Email
System -->|"Processes payments via"| Payment
System -->|"Generates content via"| LLM
style System fill:#4a90d9,stroke:#2c5ea0,color:#fff
style User fill:#e8e8e8,stroke:#999
style Admin fill:#e8e8e8,stroke:#999
style Email fill:#9b59b6,stroke:#6c3483,color:#fff
style Payment fill:#9b59b6,stroke:#6c3483,color:#fff
style LLM fill:#e74c3c,stroke:#c0392b,color:#fff
Shows the internal structure: frontends, services, databases, and their connections.
graph TB
subgraph "Frontend"
WebApp["🌐 Web App<br/><i>Next.js</i>"]
end
subgraph "Backend"
API["⚙️ API Server<br/><i>Node.js / Express</i>"]
Worker["⏰ Background Worker<br/><i>BullMQ</i>"]
end
subgraph "Data"
DB[("🗄️ PostgreSQL<br/><i>Primary database</i>")]
Cache[("⚡ Redis<br/><i>Cache + queues</i>")]
end
subgraph "External"
Stripe["💳 Stripe"]
Resend["📧 Resend"]
Claude["🤖 Claude API"]
end
WebApp -->|"REST API"| API
API -->|"Reads/writes"| DB
API -->|"Cache + queue"| Cache
Worker -->|"Processes jobs from"| Cache
Worker -->|"Reads/writes"| DB
API -->|"Payments"| Stripe
Worker -->|"Sends emails"| Resend
API -->|"LLM calls"| Claude
style WebApp fill:#4a90d9,stroke:#2c5ea0,color:#fff
style API fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Worker fill:#5cb85c,stroke:#3d8b3d,color:#fff
style DB fill:#f0ad4e,stroke:#c77c00,color:#fff
style Cache fill:#f0ad4e,stroke:#c77c00,color:#fff
style Stripe fill:#9b59b6,stroke:#6c3483,color:#fff
style Resend fill:#9b59b6,stroke:#6c3483,color:#fff
style Claude fill:#e74c3c,stroke:#c0392b,color:#fff
Shows how an AI agent processes requests, uses tools, and returns results.
graph TD
Input["📥 User Message"]
Router{"🧭 Intent Router"}
Agent1["🤖 Agent: Researcher<br/><i>Gathers information</i>"]
Agent2["🤖 Agent: Writer<br/><i>Generates content</i>"]
Tool1["🔍 Web Search"]
Tool2["🗄️ Knowledge Base"]
Tool3["📝 Content Generator"]
Guardrails{"🛡️ Guardrails Check"}
Output["📤 Response"]
Input --> Router
Router -->|"Research query"| Agent1
Router -->|"Content request"| Agent2
Agent1 --> Tool1
Agent1 --> Tool2
Agent1 --> Guardrails
Agent2 --> Tool3
Agent2 --> Tool2
Agent2 --> Guardrails
Guardrails -->|"Pass"| Output
Guardrails -->|"Fail"| Agent1
style Input fill:#e8e8e8,stroke:#999
style Router fill:#f0ad4e,stroke:#c77c00,color:#fff
style Agent1 fill:#e74c3c,stroke:#c0392b,color:#fff
style Agent2 fill:#e74c3c,stroke:#c0392b,color:#fff
style Tool1 fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Tool2 fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Tool3 fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Guardrails fill:#1abc9c,stroke:#16a085,color:#fff
style Output fill:#e8e8e8,stroke:#999
Shows how data moves through the system from input to storage to output.
graph LR
User["👤 User"] -->|"Submits form"| WebApp
WebApp["🌐 Web App"] -->|"POST /api/data"| API
API["⚙️ API Server"] -->|"Validate + transform"| DB
DB[("🗄️ Database")] -->|"Change event"| Queue
Queue["📬 Message Queue"] -->|"Process"| Worker
Worker["⏰ Worker"] -->|"Generate"| LLM
LLM["🤖 LLM"] -->|"Result"| Worker
Worker -->|"Store result"| DB
Worker -->|"Notify"| Email["📧 Email"]
style User fill:#e8e8e8,stroke:#999
style WebApp fill:#4a90d9,stroke:#2c5ea0,color:#fff
style API fill:#5cb85c,stroke:#3d8b3d,color:#fff
style DB fill:#f0ad4e,stroke:#c77c00,color:#fff
style Queue fill:#1abc9c,stroke:#16a085,color:#fff
style Worker fill:#5cb85c,stroke:#3d8b3d,color:#fff
style LLM fill:#e74c3c,stroke:#c0392b,color:#fff
style Email fill:#9b59b6,stroke:#6c3483,color:#fff
Shows where each component is deployed.
graph TB
subgraph "Vercel"
Frontend["🌐 Next.js App"]
Serverless["⚡ API Routes"]
end
subgraph "Railway"
API["⚙️ API Server"]
Worker["⏰ Background Worker"]
end
subgraph "Managed Services"
Supabase[("🗄️ Supabase<br/>PostgreSQL + Auth")]
Upstash[("⚡ Upstash Redis")]
end
subgraph "Third Party"
Stripe["💳 Stripe"]
Claude["🤖 Claude API"]
Resend["📧 Resend"]
end
Frontend --> Serverless
Serverless --> API
API --> Supabase
API --> Upstash
API --> Stripe
API --> Claude
Worker --> Upstash
Worker --> Supabase
Worker --> Resend
style Frontend fill:#4a90d9,stroke:#2c5ea0,color:#fff
style Serverless fill:#4a90d9,stroke:#2c5ea0,color:#fff
style API fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Worker fill:#5cb85c,stroke:#3d8b3d,color:#fff
style Supabase fill:#f0ad4e,stroke:#c77c00,color:#fff
style Upstash fill:#f0ad4e,stroke:#c77c00,color:#fff
style Stripe fill:#9b59b6,stroke:#6c3483,color:#fff
style Claude fill:#e74c3c,stroke:#c0392b,color:#fff
style Resend fill:#9b59b6,stroke:#6c3483,color:#fff
Shows time-ordered interactions between components.
sequenceDiagram
actor User
participant Web as Web App
participant API as API Server
participant DB as Database
participant LLM as Claude API
User->>Web: Submit question
Web->>API: POST /api/chat
API->>DB: Fetch conversation history
DB-->>API: History
API->>LLM: Send prompt + history
LLM-->>API: Stream response
API-->>Web: SSE stream
Web-->>User: Display streaming response
API->>DB: Save conversation
Expert guidance for Next.js Cache Components and Partial Prerendering (PPR). **PROACTIVE ACTIVATION**: Use this skill automatically when working in Next.js projects that have `cacheComponents: true` in their next.config.ts/next.config.js. When this config is detected, proactively apply Cache Components patterns and best practices to all React Server Component implementations. **DETECTION**: At the start of a session in a Next.js project, check for `cacheComponents: true` in next.config. If enabled, this skill's patterns should guide all component authoring, data fetching, and caching decisions. **USE CASES**: Implementing 'use cache' directive, configuring cache lifetimes with cacheLife(), tagging cached data with cacheTag(), invalidating caches with updateTag()/revalidateTag(), optimizing static vs dynamic content boundaries, debugging cache issues, and reviewing Cache Component implementations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.