skills/mermaid/SKILL.md
Generates Mermaid diagrams from codebases, topics, files, conversations, or specs. Supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, C4 architecture, mindmaps, Gantt charts, timelines, user journeys, gitGraphs, pie charts, quadrant charts, requirement diagrams, and beta types (xychart, sankey, block, architecture). Use when asked to create a Mermaid diagram, visualize a process or system, draw a flowchart, sequence diagram, class diagram, state machine, ERD, architecture diagram, mind map, timeline, Gantt chart, user journey, git branching graph, or any "diagram this" request.
npx skillsauth add mblode/agent-skills mermaidInstall 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.
Produce a valid, well-structured Mermaid diagram from the user's source material and intent. Pick the right diagram type, keep it readable, and emit it in a fenced mermaid code block.
| File | Read When |
|------|-----------|
| references/diagram-selection.md | Default: choosing the right diagram type; one-line samples for each |
| references/common-diagrams.md | Generating flowchart, sequence, class, state, ER, or C4 diagrams |
| references/specialized-diagrams.md | Generating mindmap, gantt, timeline, journey, gitGraph, pie, quadrant, requirement, xychart, sankey, block, or architecture diagrams |
| references/generation-guidelines.md | Any diagram: label limits, structure rules, source-type strategies, anti-patterns |
| references/styling-and-output.md | Theming, classDef styling, frontmatter config, export, rendering targets |
Copy this checklist to track progress:
Mermaid progress:
- [ ] Step 1: Pick diagram type
- [ ] Step 2: Gather source material
- [ ] Step 3: Draft structure
- [ ] Step 4: Generate Mermaid syntax
- [ ] Step 5: Validate
- [ ] Step 6: Present output
If the user named a type (e.g. "sequence diagram"), use it. Otherwise load references/diagram-selection.md and pick from its matrix. Common defaults:
| Content | Diagram |
|---------|---------|
| Process with decisions, branching logic | flowchart |
| Messages between actors/systems over time | sequenceDiagram |
| States and transitions (order lifecycle, workflow) | stateDiagram-v2 |
| Database / domain entities with relationships | erDiagram |
| System architecture by level | C4Context / C4Container / C4Component |
| Concept hierarchy, brainstorm, overview | mindmap |
Ask the user to confirm only if two types fit equally well.
For topics or specs, ask one clarifying question if scope is ambiguous (e.g., "overview or detailed breakdown?"), then commit. For codebases, files, or conversations, pull only what's needed to name the nodes and relationships — don't scan more than needed.
Sketch the diagram's bones before writing syntax:
references/generation-guidelines.md — typically 5-20 nodes for readability.Open the relevant reference file for the chosen type and write the diagram inside a fenced mermaid code block. Keep syntax minimal; add styling only when requested (see references/styling-and-output.md).
Run the common checks below, plus type-specific checks from the corresponding reference file. Revise and re-check if any fail.
Common checks:
flowchart TD, sequenceDiagram)()[]{} or stray colons inside plain text labelsOutput the diagram in a fenced mermaid code block. Note where it renders: GitHub/GitLab markdown, Mermaid Live Editor (mermaid.live), Notion, Obsidian, VS Code with a Mermaid preview extension.
If the user requests a file, write to a .md file containing the fenced block. For image export, point them to Mermaid Live Editor or @mermaid-js/mermaid-cli (see references/styling-and-output.md).
How to turn typical source material into a diagram. Pattern: identify the type first, then extract nouns (nodes) and verbs (edges / transitions).
Source: "User hits Checkout. Server validates the cart, reserves stock, and charges Stripe. On success, the order is saved and a confirmation email is queued."
sequenceDiagram
actor User
participant Server
participant Stripe
participant Email
User->>+Server: POST /checkout
Server->>Server: Validate cart
Server->>Server: Reserve stock
Server->>+Stripe: Charge
Stripe-->>-Server: Success
Server->>Server: Save order
Server->>+Email: Queue confirmation
Email-->>-Server: Queued
Server-->>-User: 200 Order confirmed
Source: "Orders start as Pending. Payment success moves to Paid; failure moves to Cancelled. Paid orders ship, then complete. Cancelled orders are terminal."
stateDiagram-v2
[*] --> Pending
Pending --> Paid : payment success
Pending --> Cancelled : payment failed
Paid --> Shipped : ship
Shipped --> Completed : deliver
Completed --> [*]
Cancelled --> [*]
Source: "Rate campaigns on reach (low/high) and engagement (low/high). A is high-reach, mid-engagement. B is low-reach, low-engagement. C is high-reach, high-engagement."
quadrantChart
title Campaign reach vs engagement
x-axis Low Reach --> High Reach
y-axis Low Engagement --> High Engagement
quadrant-1 Expand
quadrant-2 Promote
quadrant-3 Re-evaluate
quadrant-4 Improve
A: [0.8, 0.5]
B: [0.2, 0.2]
C: [0.8, 0.8]
presentation-creator for slide decks that include diagramsdefine-architecture for detailed architecture decisions beyond visual diagramsdocs-writing for embedding diagrams into technical documentationdevelopment
Reverse-engineers a UI animation from a screen recording — extracts frames, tracks motion per frame, fits easing and spring curves, annotates choreography, and emits CSS, Motion/Framer Motion, SwiftUI, React Native, or UIKit code. Use when the user shares or uploads a screen recording or video of a UI animation, or asks to "reverse engineer this animation", "recreate this animation", "match this easing", "extract the animation curve", "figure out the spring from this video", "copy this transition from a video", "how does this animation work", or "reproduce this motion".
development
Produces a read-only review report of the current local diff or branch — it lists findings and does NOT edit files. Use when asked to run `/pr-reviewer` before commit, before push, or before handing changes off for PR creation or update; also use for "review my changes", "code review", "code quality review", or when you want findings listed by severity so you can decide what to fix yourself. Also use for "thermo-nuclear review", "deep code quality audit", "structural review", "harsh maintainability review", or "code judo" — these load the structural quality rubric for an unusually strict maintainability pass. Also use for "deslop this", "clean up AI code", "remove slop", or "review for AI patterns" — these load the AI slop detection catalog. For automatic fix-in-place (no manual review step needed), use the private `simplify` skill instead.
development
Autonomous PR monitor — polls every 2 minutes for merge conflicts, CI/CD failures across GitHub Actions, Buildkite, Vercel, and Fly.io, review comments, and merge readiness. Auto-detects PR from current branch, fixes what it can, notifies on state changes. No setup questions. Also runs as one-shot for specific concerns. Use when asked to babysit a PR, watch a PR, monitor CI, keep a PR green, handle merge conflicts, poll PR status, run `/pr-babysitter`, fix CI, diagnose CI failure, why is CI red, CI is broken, loop on CI, fix CI checks, resolve merge conflicts, or fix conflicts.
development
Feature-level UX audit for React/Next.js code. Catches what Lighthouse, axe, ESLint, and Storybook miss — state coverage gaps (missing loading/empty/error), form data loss on validation, broken focus management, optimistic UI without rollback, skeleton-induced layout shift, vague microcopy, and 25+ other modern frontend UX bugs. Diff-aware (audits changed files only) and produces a 3-tier ship-readiness verdict (release-blocker / fix-this-sprint / backlog) grouped by surface, with concrete fixes using modern React 19 APIs (useActionState, useFormStatus, useOptimistic, useTransition, Suspense). Use before merging a frontend PR, before shipping a feature, or when asked "is this checkout/onboarding/dashboard ready?", "review this PR for UX bugs", "audit this component", "what would break in production?", "is this ready to ship?"