mermaid-diagrams
Mermaid diagram syntax for flowcharts, sequence diagrams, ERDs, class diagrams, and more. Use when creating diagrams in markdown, generating architecture visuals, or documenting system flows. Use for mermaid, diagram, flowchart, sequence, ERD, class-diagram, gantt, pie-chart, mindmap.
What this skill does
# Mermaid Diagrams ## Overview Mermaid is a JavaScript-based diagramming tool that renders Markdown-inspired text definitions into SVG diagrams. It supports flowcharts, sequence diagrams, ER diagrams, class diagrams, state diagrams, Gantt charts, pie charts, mindmaps, and git graphs directly inside Markdown files. **When to use:** Documenting system architecture, visualizing data models, illustrating request flows, creating project timelines, embedding diagrams in GitHub/GitLab READMEs or docs sites. **When NOT to use:** Pixel-perfect design mockups, interactive dashboards, diagrams requiring custom artwork or complex spatial layouts beyond hierarchical/relational structures. ## Quick Reference | Diagram | Declaration | Key Points | | -------------- | -------------------- | ---------------------------------------------------- | | Flowchart | `flowchart TD` | Directions: TB, TD, BT, RL, LR. Supports subgraphs | | Sequence | `sequenceDiagram` | Participants, messages, loops, alt/opt/par blocks | | ER Diagram | `erDiagram` | Crow's foot notation, PK/FK/UK attributes | | Class Diagram | `classDiagram` | UML relationships, visibility modifiers, annotations | | State Diagram | `stateDiagram-v2` | Transitions, composite states, forks/joins, choice | | Gantt Chart | `gantt` | Sections, tasks with dates/durations, milestones | | Pie Chart | `pie` | Labels with numeric values, optional title | | Mindmap | `mindmap` | Indentation-based hierarchy, multiple node shapes | | Git Graph | `gitGraph` | Commits, branches, merges, cherry-picks, tags | | Architecture | `architecture-beta` | Services in groups, directional edges (T/B/L/R) | | Block Diagram | `block-beta` | Column layout, block arrows, nested blocks | | Timeline | `timeline` | Time periods with events, sections for grouping | | Sankey | `sankey-beta` | Flow quantities between nodes, CSV-like data format | | XY Chart | `xychart-beta` | Bar and line charts with x/y axes | | Quadrant Chart | `quadrantChart` | Four-quadrant plot with labeled axes and data points | | Kanban | `kanban` | Columns with task cards, assignees, priorities | | Packet | `packet-beta` | Network packet structure with bit-range fields | | Requirement | `requirementDiagram` | Requirements, elements, and verification links | | C4 Diagram | `C4Context` | C4 model: Context, Container, Component, Deployment | ## Common Mistakes | Mistake | Correct Pattern | | ----------------------------------------- | ---------------------------------------------------------- | | Using `graph` instead of `flowchart` | Use `flowchart` for subgraph edges and newer features | | Missing space after arrow in sequences | `Alice->>Bob: msg` not `Alice->>Bob:msg` | | Wrong cardinality order in ER diagrams | Left cardinality, then line, then right cardinality | | Forgetting `end` after subgraph/loop/alt | Every block keyword requires a matching `end` | | Using reserved words as node IDs | Wrap reserved words in quotes or use aliases | | Bare code blocks without language tag | Always use ` ```mermaid ` as the language specifier | | Mixing v1 and v2 state diagram syntax | Use `stateDiagram-v2` consistently for current features | | Unquoted labels with special characters | Wrap labels containing special characters in double quotes | | Missing `dateFormat` in Gantt charts | Always declare `dateFormat` before task definitions | | Using tabs instead of spaces for mindmaps | Mindmap indentation requires spaces, not tabs | ## Delegation - **Diagram discovery and exploration**: Use `Explore` agent to find existing diagrams in the codebase - **Diagram review**: Use `Task` agent to verify diagram accuracy against code - **Architecture documentation**: Use `code-reviewer` agent for doc quality checks ## References - [Flowcharts: nodes, edges, subgraphs, directions, and styling](references/flowcharts.md) - [Sequence diagrams: participants, messages, activations, and control flow](references/sequence-diagrams.md) - [Entity-relationship diagrams: entities, attributes, and cardinality](references/entity-relationship.md) - [Class diagrams: classes, methods, relationships, and annotations](references/class-diagrams.md) - [Other diagrams: Gantt, pie, mindmap, state, and git graph](references/other-diagrams.md) - [Architecture, block, timeline, Sankey, XY chart, quadrant, kanban, packet, requirement, and C4 diagrams](references/extended-diagrams.md)
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.