skills/mermaid-graph-writer/SKILL.md
Writes precise, well-structured Mermaid diagrams for any visualization need. Use when creating flowcharts, sequence diagrams, state machines, ER models, timelines, mindmaps, Gantt charts, or any other Mermaid-supported diagram type. Activate on "mermaid", "diagram", "flowchart", "sequence diagram", "state diagram", "ER diagram", "visualize", "draw graph". NOT for rendering/exporting Mermaid to images (use mermaid-graph-renderer), ASCII art, or GUI-based design tools.
npx skillsauth add curiositech/windags-skills mermaid-graph-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Writes precise, well-structured Mermaid diagrams by selecting the optimal diagram type, applying correct syntax, and producing diagrams that are readable by both humans and agents.
Content Type → Decision Logic:
├── Sequential interactions with timing?
│ ├── If protocol/API calls → sequenceDiagram
│ └── If user journey with emotions → journey
├── States with transitions?
│ ├── If lifecycle/status changes → stateDiagram-v2
│ └── If git branching → gitGraph
├── Branching logic or process flow?
│ ├── If <15 nodes → flowchart TD/LR
│ └── If >15 nodes → break into subgraphs or multiple diagrams
├── Data relationships?
│ ├── If tables/entities → erDiagram
│ └── If class hierarchy → classDiagram
├── Temporal progression?
│ ├── If events over time → timeline
│ └── If project tasks → gantt
├── Hierarchical concepts?
│ ├── If brainstorm/taxonomy → mindmap
│ └── If proportional hierarchy → treemap
├── System architecture?
│ ├── If cloud/infrastructure → architecture-beta
│ ├── If containers/contexts → C4Context/C4Container
│ └── If component blocks → block-beta
└── Data visualization?
├── If categories/proportions → pie
├── If 2-axis comparison → quadrantChart
├── If flow quantities → sankey-beta
└── If numerical trends → xychart-beta
Content Flow → Direction:
├── Decision tree with branching conditions?
│ └── Use TD (top-down) - questions flow down to answers
├── Sequential process steps?
│ └── Use LR (left-right) - time flows left to right
├── Dependency relationships?
│ └── Use BT (bottom-up) - dependencies point upward
└── Reverse chronology?
└── Use RL (right-left) - latest first
Node Purpose → Shape:
├── Decision/condition? → {Diamond}
├── Start/end point? → ([Stadium])
├── Process step? → [Rectangle]
├── Data store? → [(Cylinder)]
├── External system? → [[Subroutine]]
├── Event/trigger? → ((Circle))
└── Input/output? → [/Parallelogram/]
System Scope → Choice:
├── Single application context?
│ └── C4Context (shows external systems)
├── Internal containers of one system?
│ └── C4Container (shows APIs, DBs, web apps)
├── Component details within container?
│ └── C4Component (shows classes, modules)
└── Multiple cloud services/infrastructure?
└── architecture-beta (shows regions, clusters)
Flow Visualization → Decision:
├── Quantities flowing between categories?
│ ├── If proportional amounts matter → sankey-beta
│ └── If just showing connections → flowchart LR
├── >5 parallel flows?
│ └── sankey-beta (handles parallel flows better)
└── <5 flows with decision points?
└── flowchart (shows branching logic clearly)
Symptoms: Diagrams with >20 nodes, crossing edges everywhere, unreadable when rendered Detection: Count nodes - if >15 in flowchart or >10 entities in ER, you're likely here Fix: Split into overview + detail diagrams, use subgraphs for logical grouping, or change diagram type
Symptoms: Using flowchart for everything - protocols shown as flowcharts, state machines as flowcharts Detection: If you're forcing temporal sequences or state transitions into flowchart boxes, wrong type Fix: Sequence diagrams for protocols, state diagrams for lifecycles, timeline for chronological events
Symptoms: Diamond nodes with unlabeled outgoing edges - reader can't tell which condition leads where
Detection: Any {decision} --> node without edge labels like -->|Yes| or -->|condition|
Fix: Label every edge from decision diamonds with the condition that triggers that path
Symptoms: Mixing TD and LR within same flowchart, or using wrong direction for content type Detection: Arrows going multiple directions, or decision tree flowing left-to-right Fix: Pick one direction per diagram based on content flow (TD for decisions, LR for processes)
Symptoms: Mermaid code that looks correct but fails to render, missing spaces, wrong brackets Detection: Code that produces parser errors or renders as text instead of diagram Fix: Validate syntax - spaces around arrows, matching brackets, correct diagram declaration
Input: "Show how a user authenticates with OAuth2 and gets a token, then uses it to access protected resources"
Expert Analysis:
Decision Process:
Output:
sequenceDiagram
participant U as User
participant C as Client
participant A as Auth Server
participant R as Resource Server
U->>C: Click "Login"
C->>A: Redirect to /authorize
A->>U: Show login form
U->>A: Submit credentials
A->>C: Authorization code
C->>A: Exchange code for token
A-->>C: Access token + refresh token
C->>R: API request + Bearer token
R->>A: Validate token
A-->>R: Token valid
R-->>C: Protected data
C-->>U: Show data
What novice would miss: Using flowchart instead of sequence diagram, missing the timing aspect and participant interactions
Input: "We need to visualize how feature flags roll out from development through production with different user percentages and rollback scenarios"
Expert Analysis:
Decision Process:
Output:
stateDiagram-v2
[*] --> Off
Off --> Canary: Enable for 1% users
Canary --> Staged: Metrics good, expand to 25%
Canary --> Rollback: Error rate > 0.1%
Staged --> Full: 24h stable, enable 100%
Staged --> Rollback: Performance degraded
Full --> Rollback: Critical bug found
Rollback --> Off: Investigate and fix
Off --> Canary: Ready for retry
What novice would miss: Using flowchart and losing the state machine nature, not showing that you can rollback from any forward state
Input: "Show our ETL pipeline that reads from 3 databases, processes through Kafka and Spark, then outputs to data warehouse and real-time dashboard"
Expert Analysis:
Decision Process:
Output:
flowchart LR
subgraph Sources
DB1[(Customer DB)]
DB2[(Orders DB)]
DB3[(Inventory DB)]
end
subgraph Processing
K[Kafka Queue]
S[Spark Cluster]
end
subgraph Outputs
DW[(Data Warehouse)]
RT[Real-time Dashboard]
end
DB1 --> K
DB2 --> K
DB3 --> K
K --> S
S --> DW
S --> RT
Trade-off Analysis:
-->|condition|)Do NOT use this skill for:
mermaid-graph-renderer insteaddiagramming-expert insteadDelegate to other skills when:
format-converterimage-analyzer*-writer skilldata-ai
license: Apache-2.0 NOT for unrelated tasks outside this domain.
development
Use when designing caching strategies (cache-aside, write-through, write-behind), implementing distributed locks, building rate limiters, leaderboards, real-time streams (XADD/consumer groups), pub/sub, or tuning eviction policies. Triggers: thundering-herd on cache miss, dogpile on key expiry, Redlock vs SET-NX-PX choice, sliding-window rate limiter, hot-key on a single cluster slot, big-key blowup, MULTI/EXEC across slots, KEYS in production. NOT for Redis Cluster operations/admin (different domain), embedded KV (SQLite, leveldb), in-process LRU caches, or Memcached.
tools
Drawing the `'use client'` boundary correctly in React Server Components apps (Next.js App Router, RSC frameworks) — leaf-pushing, slot composition, serialization rules, and environment poisoning prevention. Grounded in react.dev and Next.js 16 docs.
development
Use when designing rate limiting for an API, choosing between token bucket / sliding window / leaky bucket / fixed window, implementing it in Redis, deciding edge (Cloudflare/Upstash) vs origin enforcement, sizing per-user vs per-IP vs per-endpoint quotas, returning the right 429 response with Retry-After, or fixing the boundary-burst bug in fixed-window limiters. Triggers: 429 too many requests, INCR + EXPIRE, ZADD + ZREMRANGEBYSCORE + ZCARD, X-RateLimit-Remaining header, Cloudflare WAF rate limiting rules, Upstash @upstash/ratelimit, leaky bucket shaping vs policing, distributed rate limiter consistency. NOT for DDoS mitigation specifically (different scale), CAPTCHA / bot management, full WAF design, or per-user quota billing.