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 skilltools
Building resilient distributed systems with circuit breakers, retries with full-jitter exponential backoff, retry budgets (per-request 3-attempt + per-client 10% ratio per Google SRE), deadline propagation, and the cascading-failure math (4 layers × 3 retries = 64x amplification). Grounded in Resilience4j, Microsoft Cloud Patterns, AWS Architecture Blog (Marc Brooker), and Google SRE Book.
testing
Designing HTTP cache headers that work correctly across browsers, CDNs, and shared proxies — `Cache-Control` directives per RFC 9111, `stale-while-revalidate` and `stale-if-error` per RFC 5861, the Vary header for varying responses, and surrogate keys for tag-based purging. Grounded in IETF RFCs and Cloudflare/Fastly docs.
development
Use when designing or fixing a Content Security Policy on a real site, choosing between nonce-based and hash-based CSP, adding strict-dynamic, debugging "Refused to execute inline script" errors, deploying CSP in report-only mode first, configuring report-to / report-uri, or auditing an existing policy for unsafe-inline / unsafe-eval / wildcards. Triggers: "CSP blocks legitimate inline script", strict-dynamic, nonce-{RANDOM}, sha256-{HASH}, object-src none, base-uri none, frame-ancestors, Trusted Types, X-Content-Security-Policy obsolete, report-only vs enforced. NOT for general HTTP security headers (HSTS, COOP/COEP), Trusted Types deep dive, CORS configuration, or building a WAF.
tools
Choosing and operating an HTTP API versioning strategy that doesn't break clients — Stripe's date-based pinned versions, the Deprecation/Sunset header pair (RFC 9745 + RFC 8594), URI vs header vs media-type approaches, and the version-transformer pattern. Grounded in Stripe's published architecture and IETF RFCs.