mcpField
M
mermaid-builder

mermaid-builder

github.com/majesticlabs-devDocuments5048 installsUpdated 7w ago
Repository

About mermaid-builder

mermaid-builder is a reference skill for creating Mermaid diagrams with attention to valid syntax and readable structure. It is suited to people documenting processes, systems, and data flows.

Key features

  1. 01Mermaid syntax guidance
  2. 02Label quoting rules
  3. 03Flowchart shapes and arrows
  4. 04Seven diagram type references
  5. 05Subgraph organization and styling
  6. 06Validation checklist

Use cases

  1. 01Drafting workflow diagrams
  2. 02Mapping component interactions
  3. 03Documenting database schemas
  4. 04Tracing data lineage

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill mermaid-builder

After installing, type/mermaid-builderin Claude Code to confirm it loaded.

Bundled filesreferences/data-lineage.mdreferences/diagram-examples.md

Details

From the project README

Mermaid Builder

Core Philosophy

  • Correctness: Follow Mermaid syntax rules strictly
  • Clarity: Diagrams communicate complex ideas simply
  • Simplicity: Avoid overloading with unnecessary detail
  • Modularity: Break complex diagrams into subgraphs

Critical: Label Quoting Rule

RULE: Wrap labels in double quotes if they contain spaces, special characters, or punctuation.

%% CORRECT - labels with spaces quoted
flowchart LR
    A["User Login"] --> B["Process Request"]
    C["Pay $100?"] --> D["Confirm (Yes/No)"]

%% WRONG - will fail to render
flowchart LR
    A[User Login] --> B[Process Request]

Must quote: Spaces, special chars ($%&), punctuation (:,;), operators (()[]) Optional: Simple alphanumeric (Login, Process, Node1)

When in doubt, use quotes. It never hurts.

Quick Reference

Flowchart Shapes
SyntaxShape
["Text"]Rectangle
("Text")Rounded
{"Text"}Diamond (decision)
[("Text")]Cylinder (database)
(("Text"))Circle
Arrow Types
SyntaxType
-->Solid arrow
---Solid line
-.->Dotted arrow
==>Thick arrow
`-->Label
Diagram Types
TypeDeclarationUse Case
Flowchartflowchart TDProcesses, workflows, decisions
SequencesequenceDiagramComponent interactions, API flows
ClassclassDiagramOOP structure, models
StatestateDiagram-v2State transitions
GanttganttTimelines, scheduling
ERerDiagramDatabase schema
PiepieProportional data

Directions: TB/TD (top-down), BT (bottom-up), LR (left-right), RL (right-left)

See references/diagram-examples.md for complete examples of each diagram type.

Minimal Examples

Flowchart
flowchart TD
    Start["Start"] --> Check{Valid?}
    Check -->|Yes| Process["Process"]
    Check -->|No| Error["Error"]
    Process --> End["End"]
Sequence
sequenceDiagram
    Client->>Server: Request
    Server-->>Client: Response
ER Diagram
erDiagram
    USER ||--o{ ORDER : "places"
    USER { int id PK string email }
    ORDER { int id PK int user_id FK }

Subgraphs for Organization

flowchart TD
    subgraph "Frontend"
        A["UI"]
    end
    subgraph "Backend"
        B["API"]
        C[("DB")]
    end
    A --> B --> C

Styling

flowchart TD
    A["Success"] --> B["Error"]

    classDef successStyle fill:#C8E6C9,stroke:#388E3C
    classDef errorStyle fill:#FFCDD2,stroke:#D32F2F

    class A successStyle
    class B errorStyle

Common Errors to Avoid

ErrorWrongCorrect
Unquoted spacesA[User Login]A["User Login"]
Invalid arrowA -> BA --> B
Unquoted specialA[Cost: $100]A["Cost: $100"]
Missing bracketA["Node --> BA["Node"] --> B

Validation Checklist

  • Labels with spaces are quoted
  • Labels with special characters quoted
  • Brackets properly matched
  • Arrow syntax correct (--> not ->)
  • Node IDs unique and meaningful
  • Comments explain complex sections
  • Previewed without errors

Data Lineage Patterns

See references/data-lineage.md for:

  • ETL pipeline patterns
  • Multi-layer data architecture
  • Cross-system data flows
  • Database schema lineage
  • Streaming data lineage
  • Column-level lineage

Resources


Remember: The quoting rule is the #1 cause of Mermaid rendering failures. When in doubt, quote it.

Comments

Markdown supported