Agent skill

mermaid

Generate diagrams and flowcharts from mermaid definitions using the mermaid-cli (mmdc). Supports themes, custom CSS, and various output formats including SVG, PNG, and PDF. Mermaid supports 20+ diagram types including flowcharts, sequence diagrams, class diagrams, state diagrams, entity relationship diagrams, user journeys, Gantt charts, pie charts, quadrant charts, requirement diagrams, GitGraph, C4 diagrams, mindmaps, timelines, ZenUML, Sankey diagrams, XY charts, block diagrams, packet diagrams, Kanban boards, architecture diagrams, radar charts, and treemaps. This skill is triggered when the user says things like "create a diagram", "make a flowchart", "generate a sequence diagram", "create a mermaid chart", "visualize this as a diagram", "render mermaid code", or "create an architecture diagram".

Stars 0
Forks 0

Install this agent skill to your Project

npx add-skill https://github.com/SecKatie/kmtools/tree/main/mermaid

SKILL.md

Mermaid Documentation Guide

Mermaid is a JavaScript-based diagramming and charting tool that uses text definitions to create diagrams dynamically. This skill includes the complete official documentation from the mermaid repository.

Quick Start: Read mermaid-cli/README.md for installation and usage. Always use mermaid-cli to validate code and generate diagrams. Adjust width/height for readability (default PNGs are often too small).

Documentation Structure

Quick Start

  • mermaid-README.md - Main Mermaid project README with overview, features, and quick examples

Getting Started

  • intro/getting-started.md - Quick start guide for using Mermaid
  • intro/index.md - Introduction and overview
  • intro/syntax-reference.md - General syntax reference across all diagram types
  • config/usage.md - How to use Mermaid in different environments

Installation and CLI

  • mermaid-cli/README.md - Complete mermaid-cli (mmdc) installation and usage guide
  • config/mermaidCLI.md - Additional CLI usage information from the main docs
  • config/setup/ - Setup instructions for different environments

CLI Troubleshooting

  • mermaid-cli/already-installed-chromium.md - Using already-installed Chromium instead of downloading
  • mermaid-cli/linux-sandbox-issue.md - Fixing Linux sandbox issues
  • mermaid-cli/docker-permission-denied.md - Fixing Docker permission issues
  • mermaid-cli/reviewing.md - Code review guidelines for mermaid-cli

Diagram Type Syntax

For detailed syntax, examples, and best practices for each diagram type, refer to files in the syntax/ folder:

Core Diagrams

  • syntax/flowchart.md - Process flows, decision trees, and workflows with various node shapes and arrow types
  • syntax/sequenceDiagram.md - Actor interactions over time, showing message flows and activations
  • syntax/classDiagram.md - Object-oriented structures with classes, attributes, methods, and relationships
  • syntax/stateDiagram.md - State machines showing states and transitions
  • syntax/entityRelationshipDiagram.md - Database schemas and data model relationships

Planning & Project Management

  • syntax/userJourney.md - User experience mapping with satisfaction scores
  • syntax/gantt.md - Project schedules, timelines, and task dependencies
  • syntax/kanban.md - Workflow visualization with columns and cards
  • syntax/timeline.md - Chronological events and project histories
  • syntax/requirementDiagram.md - System requirements and verification methods

Data Visualization

  • syntax/pie.md - Data proportions and percentages
  • syntax/quadrantChart.md - 2x2 prioritization and analysis matrices
  • syntax/xyChart.md - Line and bar charts for data trends
  • syntax/sankey.md - Flow quantities and data transfers between stages

Technical Diagrams

  • syntax/gitgraph.md - Git branching, merging, and workflow patterns
  • syntax/c4.md - Software architecture at multiple abstraction levels
  • syntax/block.md - System components and relationships
  • syntax/packet.md - Network packet structures and protocol headers
  • syntax/architecture.md - System design with icons and groupings

Advanced & Specialized

  • syntax/mindmap.md - Hierarchical information and brainstorming
  • syntax/zenuml.md - Alternative sequence diagram syntax with code-like format
  • syntax/radar.md - Multi-axis comparisons
  • syntax/treemap.md - Hierarchical data as nested rectangles

Configuration and Customization

  • config/configuration.md - Mermaid configuration options
  • config/theming.md - Theme customization and styling
  • config/directives.md - Using directives in diagrams
  • config/icons.md - Using icons in diagrams
  • config/layouts.md - Layout configuration options
  • config/math.md - Mathematical expressions in diagrams
  • config/accessibility.md - Accessibility features and best practices

Troubleshooting and FAQs

  • config/faq.md - Frequently asked questions
  • syntax/examples.md - Collection of example diagrams

Common Usage Patterns

When the user asks to:

  • Get an overview → Check mermaid-README.md
  • Create a flowchart → Check syntax/flowchart.md
  • Create a sequence diagram → Check syntax/sequenceDiagram.md
  • Create a class diagram → Check syntax/classDiagram.md
  • Create a Gantt chart → Check syntax/gantt.md
  • Create an ER diagram → Check syntax/entityRelationshipDiagram.md
  • Customize appearance → Check config/theming.md and config/configuration.md
  • Install or use the CLI → Check mermaid-cli/README.md
  • Use the CLI (additional info) → Check config/mermaidCLI.md
  • Troubleshoot CLI issues → Check mermaid-cli/linux-sandbox-issue.md, mermaid-cli/already-installed-chromium.md, or mermaid-cli/docker-permission-denied.md
  • Troubleshoot general issues → Check config/faq.md
  • See examples → Check syntax/examples.md
  • Learn syntax basics → Check intro/syntax-reference.md

Using Mermaid CLI

The mermaid-cli (mmdc) is the command-line tool for generating diagrams. For complete installation and usage details, see mermaid-cli/README.md.

Basic CLI Usage

bash
# Generate PNG from mermaid file
mmdc -i input.mmd -o output.png

# Generate SVG
mmdc -i input.mmd -o output.svg

# Generate PDF
mmdc -i input.mmd -o output.pdf

# Specify theme
mmdc -i input.mmd -o output.png -t dark

# Specify background color
mmdc -i input.mmd -o output.png -b transparent

# Specify width
mmdc -i input.mmd -o output.png -w 1920

# Specify height
mmdc -i input.mmd -o output.png -H 1080

Important Notes:

  • By default, PNG files might be too small. Adjust width and height to be large enough to be readable.
  • Always test diagrams with mermaid-cli to validate syntax before finalizing.
  • PNG output typically requires explicit width/height for good quality.

Quick Reference by Use Case

For Basic Diagram Creation

  1. Choose the diagram type from the syntax/ folder
  2. Read the syntax documentation for that type
  3. Create your .mmd file with the diagram definition
  4. Generate output using mmdc command

For Styling and Theming

  1. Check config/theming.md for theme options
  2. Check config/configuration.md for global settings
  3. Use directives (see config/directives.md) for inline configuration

For Integration

  1. Check config/usage.md for embedding in web pages
  2. Check mermaid-cli/README.md for command-line usage
  3. Check intro/getting-started.md for basic setup

For Troubleshooting

  1. Check config/faq.md first for general issues
  2. Check mermaid-cli/ folder for CLI-specific troubleshooting (Linux sandbox, Chromium, Docker)
  3. Validate syntax against the specific diagram type documentation
  4. Check syntax/examples.md for working examples
  5. Review config/accessibility.md for rendering issues

Common Troubleshooting Tips

Line Breaks & Multi-line Text

  • ✅ Use <br/> for line breaks: Node["Text<br/>More text"]
  • ✅ Use <br/><br/> for paragraph spacing
  • ❌ Never use plain newlines (\n) - causes "Unsupported markdown: list" errors
  • Keep bullet points concise (2-4 words), limit to 3-4 per node

Text & Canvas Size

  • Increase font size: classDef style font-size:20px
  • Vertical flowcharts: mmdc -i file.mmd -o file.png -w 2000 -H 2800
  • Horizontal flowcharts: mmdc -i file.mmd -o file.png -w 3000 -H 1400

Special Characters

  • Avoid starting labels with numbers
  • Escape quotes with \"
  • Ampersands: Avoid & (renders as &amp;) - use "and" or "+" instead
  • Use &lt; for <, &gt; for > only when necessary

General Tips

  • Start with the appropriate diagram type for your use case
  • Refer to the specific diagram documentation in syntax/ for detailed syntax
  • Test diagrams with mermaid-cli before finalizing
  • Use consistent formatting and naming conventions
  • Add comments with %% for documentation
  • Consider your audience when choosing detail level
  • Check the intro/syntax-reference.md for cross-diagram syntax patterns

File Organization

  • mermaid-README.md - Main Mermaid project README
  • mermaid-cli/ - Complete mermaid-cli documentation and troubleshooting
  • intro/ - Getting started guides and general reference
  • syntax/ - Complete syntax documentation for all diagram types
  • config/ - Configuration, theming, CLI, and troubleshooting
  • diagrams/ - Additional diagram documentation and examples
  • ecosystem/ - Information about the Mermaid ecosystem
  • community/ - Community resources and contributions

Notes

  • Some diagram types may be experimental or have evolving syntax
  • Always validate your diagrams with the mermaid-cli tool
  • The official documentation is continuously updated
  • For the latest updates, refer to https://mermaid.js.org/

Expand your agent's capabilities with these related and highly-rated skills.

SecKatie/kmtools

llm

Access and interact with Large Language Models from the command line using Simon Willison's llm CLI tool. Supports OpenAI, Anthropic, Gemini, Llama, and dozens of other models via plugins. Features include chat sessions, embeddings, structured data extraction with schemas, prompt templates, conversation logging, and tool use. This skill is triggered when the user says things like "run a prompt with llm", "use the llm command", "call an LLM from the command line", "set up llm API keys", "install llm plugins", "create embeddings", or "extract structured data from text".

0 0
Explore
SecKatie/kmtools

yt-dlp

Download audio and video from thousands of websites using yt-dlp. Feature-rich command-line tool supporting format selection, subtitle extraction, playlist handling, metadata embedding, and post-processing. This skill is triggered when the user says things like "download this video", "download from YouTube", "extract audio from video", "download this playlist", "get the mp3 from this video", "download subtitles", or "save this video locally".

0 0
Explore
SecKatie/kmtools

jira-cli

Manage Jira tickets from the command line using jira-cli. Contains essential setup instructions, non-interactive command patterns with required flags (--plain, --raw, etc.), authentication troubleshooting, and comprehensive command reference. This skill is triggered when the user says things like "create a Jira ticket", "list my Jira issues", "update Jira issue", "move Jira ticket to done", "log time in Jira", "add comment to Jira", or "search Jira issues". IMPORTANT - Read this skill before running any jira-cli commands to avoid blocking in interactive mode.

0 0
Explore
SecKatie/kmtools

jj-vcs

Jujutsu (jj) is a powerful Git-compatible version control system with innovative features like automatic rebasing, working-copy-as-a-commit, operation log with undo, and first-class conflict tracking. This skill is triggered when the user says things like "use jj", "run jj commands", "jujutsu version control", "migrate from git to jj", "jj rebase", "jj squash", "jj log", or "help with jj workflow".

0 0
Explore
SecKatie/kmtools

just

just is a handy command runner for saving and running project-specific commands. Features include recipe parameters, .env file loading, shell completion, cross-platform support, and recipes in arbitrary languages. This skill is triggered when the user says things like "create a justfile", "write a just recipe", "run just commands", "set up project automation with just", "understand justfile syntax", or "add a task to the justfile".

0 0
Explore
SecKatie/kmtools

gh

GitHub CLI (gh) for repository management, rulesets, releases, PRs, and issues. This skill is triggered when the user says things like "create a GitHub PR", "list GitHub issues", "set up branch protection", "create a ruleset", "configure GitHub rulesets", "create a GitHub release", "clone this repo", or "manage GitHub repository settings".

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results