agentleFS
DevN-grDevN-gr/multi-tenant-fullstack-crud-skill/.agents/skills/pretty-mermaid/SKILL.md

pretty-mermaid

Skill2 starsChanged 2 months agoMITView on GitHub

Generate and render Mermaid diagrams for architecture docs, READMEs, PRs, terminals, chats, and CI as themed SVG, PNG, or ASCII/Unicode art. Use this skill whenever the user provides Mermaid code or .mmd files; asks for a flowchart, sequence/state/class diagram, ERD, XY chart, or architecture/workflow/data-model visualization; or wants to beautify, theme, batch-convert, or make a diagram terminal-friendly. Runs locally without a browser or DOM, with 15 built-in themes and custom colors.

6 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use web-design-guidelines.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    web-design-guidelines

    Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".

    Also in 3 projects that use this

  • Other versions6 projects use a version of this.

    Word for word · 1

    1. imxv/Pretty-mermaid-skills★ 1.2k100% same

    Edited · 1

    1. ivanrvpereira/.agents★ 1999% same

    Wrote their own version · 4

    1. drafael/coding-harness★ 1same name
    2. mahik504/orchestra-workflow★ 1same name
    3. ZeroTokenClaw/agents-skills★ 1same name
    4. sueryue/Claude-Skillls★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

17 rules. 0 are common, 8 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create or render Mermaid diagrams with the bundled Node.js CLI.

    line 15
  2. Very specific:

    Treat the directory containing this file as <skill-root>.

    line 19
  3. Distinctive:

    Read only the relevant reference file when syntax, theme selection, or API behavior needs more detail.

    line 25
  4. Distinctive:

    Do not overwrite an existing source or output file unless the user asked for replacement.

    line 31
  5. Very specific:

    Read references/DIAGRAM_TYPES.md when authoring non-trivial Mermaid syntax.

    line 44
  6. Very specific:

    Run these from <skill-root>.

    line 58
  7. Very specific:

    Add --use-ascii when Unicode box-drawing characters are not acceptable.

    line 85
  8. Distinctive:

    Use batch rendering for three or more diagrams or when consistent options must be applied to a directory.

    line 109
  9. Very specific:

    Read references/THEMES.md or open docs/THEME_GALLERY.md when visual theme choice matters.

    line 119
  10. Very specific:

    Run node scripts/render.mjs --help or node scripts/batch.mjs --help for the authoritative CLI list.

    line 160
  11. Distinctive:

    Prefer short, concrete labels.

    line 164
  12. Distinctive:

    Use explicit edge labels when a branch or message is ambiguous.

    line 165
  13. Distinctive:

    Keep large diagrams readable by splitting unrelated concerns instead of shrinking text.

    line 166
  14. Very specific:

    Use LR for wide flows and TB for narrow documents.

    line 167
  15. Distinctive:

    Avoid communicating meaning through color alone.

    line 168
  16. Distinctive:

    Use a light theme for print and confirm contrast against the final background.

    line 169
  17. Very specific:

    Run both npm test and npm run validate when changing this skill, its scripts, templates, or references.

    line 182

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Pretty Mermaid

Create or render Mermaid diagrams with the bundled Node.js CLI. Use SVG for scalable documentation, PNG for sharing or raster-only consumers, and ASCII or Unicode for terminals and plain text.

Working directory

Treat the directory containing this file as <skill-root>. Run bundled scripts from that directory, or invoke them with absolute paths. Keep user source and rendered output in the user's requested location; do not copy the renderer into their project.

Workflow

  1. Determine whether the user supplied Mermaid source or needs a diagram authored from prose.
  2. Choose the diagram type and output format from the tables below.
  3. Read only the relevant reference file when syntax, theme selection, or API behavior needs more detail.
  4. Save new source as a .mmd file, preserving user terminology and relationships.
  5. Render with a named theme or explicit colors.
  6. Inspect the result. Fix syntax, clipping, crowded layout, or unclear labels and render again.
  7. Return the source and output paths, plus the selected format and theme.

Do not overwrite an existing source or output file unless the user asked for replacement.

Choose a diagram type

NeedDiagram typeStarter
Process, decision tree, architectureFlowchartflowchart LR
API calls, messages, interactionsSequencesequenceDiagram
Lifecycle or finite-state machineStatestateDiagram-v2
Classes, modules, relationshipsClassclassDiagram
Database entities and cardinalityERerDiagram
Bars, lines, trends, comparisonsXY chartxychart-beta

Read references/DIAGRAM_TYPES.md when authoring non-trivial Mermaid syntax.

Choose an output

OutputBest forNotes
SVGREADMEs, docs, slides, websitesScalable, themed, supports transparency
PNGChats, previews, raster-only toolsSet --format png; no external converter required
UnicodeModern terminals and readable text previewsDefault ASCII renderer output
Plain ASCIILogs and restricted terminalsAdd --use-ascii
ANSI-colored textInteractive terminalsSet --color-mode

Core commands

Run these from <skill-root>.

List themes

node scripts/themes.mjs

Render SVG

node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.svg \
  --theme tokyo-night

Render terminal text

node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.txt \
  --format ascii \
  --color-mode none

Add --use-ascii when Unicode box-drawing characters are not acceptable.

Render PNG

node scripts/render.mjs \
  --input diagram.mmd \
  --output diagram.png \
  --format png \
  --width 1200 \
  --theme tokyo-night

Batch render a directory

node scripts/batch.mjs \
  --input-dir ./diagrams \
  --output-dir ./rendered \
  --format svg \
  --theme github-dark \
  --workers 4

Use batch rendering for three or more diagrams or when consistent options must be applied to a directory.

Theme selection

  • General dark documentation: tokyo-night
  • GitHub dark or light surfaces: github-dark, github-light
  • Print and presentations: zinc-light
  • High-contrast color: dracula
  • Cool, restrained palette: nord, nord-light

Read references/THEMES.md or open docs/THEME_GALLERY.md when visual theme choice matters. A named theme can be refined with explicit color flags.

Useful options

Shared styling

OptionPurpose
--theme <name>Apply one of the 15 built-in themes
--bg, --fgSet required base colors
--line, --accent, --mutedRefine connectors, highlights, and secondary text
--surface, --borderRefine node fill and stroke
--font <name>Set the SVG font family

SVG

OptionPurpose
--transparentRemove the SVG background
--padding <n>Set canvas padding
--node-spacing <n>Set horizontal node spacing
--layer-spacing <n>Set vertical layer spacing
--component-spacing <n>Separate disconnected components
--interactiveEnable XY chart hover tooltips

PNG

OptionPurpose
--width <n>Set output width from 100 to 10000 pixels while preserving aspect ratio
--transparentPreserve a transparent background

Terminal output

OptionPurpose
--use-asciiReplace Unicode box drawing with plain ASCII
--padding-x, --padding-yTune diagram spacing
--box-border-paddingTune padding inside node boxes
--color-mode <mode>none, auto, ansi16, ansi256, truecolor, or html

Run node scripts/render.mjs --help or node scripts/batch.mjs --help for the authoritative CLI list.

Authoring guidance

  • Prefer short, concrete labels; preserve domain-specific terms from the user.
  • Use explicit edge labels when a branch or message is ambiguous.
  • Keep large diagrams readable by splitting unrelated concerns instead of shrinking text.
  • Use LR for wide flows and TB for narrow documents.
  • Avoid communicating meaning through color alone.
  • Use a light theme for print and confirm contrast against the final background.
  • For unfamiliar syntax, start from assets/example_diagrams/ and consult the diagram reference.

Validation

After rendering:

  1. Confirm the command exits successfully and the output file is non-empty.
  2. Confirm SVG output begins with <svg; confirm PNG output opens as a valid image; confirm text output contains visible diagram content.
  3. Inspect visual output when layout matters, especially long labels, CJK text, disconnected components, and XY charts.
  4. Confirm arrows, cardinalities, states, and labels match the source request.
  5. Report any renderer limitation instead of silently dropping unsupported syntax.

Run both npm test and npm run validate when changing this skill, its scripts, templates, or references.

Troubleshooting

  • Missing dependency: run npm install in <skill-root>; the CLI also attempts a first-run install.
  • Unknown theme: run node scripts/themes.mjs and use an exact listed name.
  • Parse error: consult references/DIAGRAM_TYPES.md, reduce to the failing statement, then restore the diagram incrementally.
  • Crowded SVG: increase --node-spacing, --layer-spacing, or --component-spacing.
  • PNG color error: use concrete hex values for custom colors; unresolved external CSS variables cannot be rasterized.
  • Terminal color escape codes in redirected output: use --color-mode none.

Reference routing

ResourceRead or use when
references/DIAGRAM_TYPES.mdAuthoring or debugging Mermaid syntax
references/THEMES.mdComparing themes or defining custom colors
references/api_reference.mdExtending scripts or calling beautiful-mermaid directly
docs/THEME_GALLERY.mdChoosing a theme visually
assets/example_diagrams/Starting from a supported diagram template
scripts/render.mjsRendering one diagram
scripts/batch.mjsRendering a directory in parallel
scripts/themes.mjsListing installed themes

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.