agentleFS
jpmansonjpmanson/pele-skill/skills/pele/SKILL.md

pele

Skill2 starsChanged 28 days agoMITView on GitHub

Use when rendering Mermaid to SVG. Renders Mermaid 12 source to an SVG or HTML file with Pele, without a browser. Covers 32 types: flowchart, sequence, class, state, ER, gantt, git graph, mindmap, pie, journey, timeline, quadrant, xy chart, C4, block, architecture, requirement, sankey, packet, radar, treemap, kanban, railroad grammar, Wardley map, Ishikawa/fishbone, swimlane, Venn, use case, file tree, Cynefin, event modeling, agent flow. Use for .mmd files or any request for an image of one of these. Do not use to leave a Markdown fence as-is, or for a diagram that is not Mermaid.

  • Installs packages

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. lingengyuan/my-skills★ 9same name
    2. shashidharbabu/rocketride-design-skills★ 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.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 5 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not use when:

    line 24
  2. Distinctive:

    Do not wrap this in an MCP server.

    line 30
  3. Very specific:

    If node_modules/pele is missing, the script runs npm install there.

    line 37
  4. Distinctive:

    If the request fits no type (freeform layout, a picture, a chart type not listed), say so and do not force it into a flowchart.

    line 56
  5. Distinctive:

    If the user names a specific diagram type that is not in the list, say so before offering the closest supported type.

    line 57
  6. Very specific:

    Write the Mermaid source to a .mmd file.

    line 62
  7. Very specific:

    Read the JSON receipt on stderr.

    line 69
  8. Distinctive:

    Do not switch to mermaid-cli, a headless browser, or a hand-written SVG.

    line 73
  9. Very specific:

    Use --html, or an output path ending in .html, when the user needs a file they can open in a browser.

    line 76
  10. Very specific:

    Do not pass --max-width unless the user asked for a narrow layout.

    line 128
  11. Very specific:

    If node_modules exists but Pele fails to load, delete that node_modules and run npm install in the skill root.

    line 133

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Pele

Render Mermaid source to SVG with Pele. Pele is a synchronous library: no Puppeteer, no mermaid-cli, no MCP server. This skill's interface is scripts/render.mjs.

The skill root is the directory that contains this file. Every path below is relative to that directory. That remains true after the skill is installed into Claude Code, Hermes, or OpenCode.

When to Use

  • The user wants a Mermaid diagram as an SVG, HTML, or image file.
  • A .mmd file, or a ```mermaid fence, needs to be rendered and checked.
  • The user asks for a diagram one of the 32 supported types can draw, and wants a file, not a chat fence. That includes less familiar ones: Wardley map, fishbone, Venn, swimlane, radar, treemap, sankey, railroad grammar, file tree, Cynefin, event model. See Diagram types below.

Do not use when:

  • The Mermaid fence should stay in Markdown that GitHub, Obsidian, or another viewer already renders.
  • The requested artifact is not Mermaid (hand-drawn Excalidraw JSON, a bespoke architecture page, a screenshot annotation).
  • The user needs pixel-identical mermaid.js output. Pele has its own layout.

Do not wrap this in an MCP server. One script call is the whole capability.

Prerequisites

  • Node.js 20 or newer, and npm on PATH.
  • Dependency install happens in the skill root (package.json next to this file), never in the user's project.

If node_modules/pele is missing, the script runs npm install there. You can also do it yourself:

npm install --no-fund --no-audit

Completion: node scripts/render.mjs --check exits 0 and stderr JSON has "ok": true and a pele version.

Diagram types

Know the full list before choosing. Pele renders 32 types, and a third of them need a -beta header that differs from the name a user would say.

node scripts/render.mjs --types

That prints JSON: type, exact first-line header, what it is for, and a working example path. references/diagram-types.md has the same table, the headers that fail, and how to pick a type.

  • Pick the type that shows what the reader needs, not the first one that comes to mind. Owners per step → swimlane. Causes of one problem → ishikawa. Dated tasks → gantt. Folder layout → treeView. Proportional flows → sankey.
  • If the request fits no type (freeform layout, a picture, a chart type not listed), say so and do not force it into a flowchart.
  • If the user names a specific diagram type that is not in the list, say so before offering the closest supported type. Do not approximate it silently.

Procedure

  1. Choose the type and its exact header from --types. For any -beta type, or any type whose syntax you are not sure of, read its example file first and copy its structure.
  2. Write the Mermaid source to a .mmd file. Do not pass a multi-line diagram as a shell argument.
  3. Render it:
node scripts/render.mjs INPUT.mmd OUTPUT.svg
  1. Read the JSON receipt on stderr. Completion is all of: exit code 0, "ok": true, the receipt type is the type you chose, and the output file starts with <svg.
  2. If "ok": false:
    • unsupported-diagram: the first line is not a known header. Use suggest[0].header if present, otherwise pick one from --types.
    • syntax or semantic: fix the source at line / column using snippet, compare with the type's example, then render again.
    • Do not switch to mermaid-cli, a headless browser, or a hand-written SVG.
  3. Report the absolute output path. Do not paste the SVG into the chat unless the user asked for the markup. Do not claim success on a non-zero exit.

Use --html, or an output path ending in .html, when the user needs a file they can open in a browser. The HTML inlines the SVG and sets Pele's CSS color variables.

node scripts/render.mjs --html INPUT.mmd OUTPUT.html

Receipt

Success on stderr:

{"ok":true,"type":"flowchart","width":180,"height":80,"bytes":1200,"output":"/abs/OUTPUT.svg","html":false,"pele":"1.6.0"}

Failure on stderr, exit 1 (exit 2 if Pele could not be installed):

{"ok":false,"code":"syntax","message":"...","type":"flowchart","line":2,"column":5,"snippet":"..."}

code is syntax, semantic, unsupported-diagram, limit, usage, install-failed, or render-failed. Display message as text. It can contain the diagram source.

An unsupported-diagram receipt also has hint and suggest:

{"ok":false,"code":"unsupported-diagram","hint":"Replace the first line with the header below. Many types need the -beta suffix.","suggest":[{"type":"radar","header":"radar-beta","example":"/abs/examples/types/radar.mmd"}]}

Flags

FlagUse
--checkLoad Pele, print version, do not render
--typesPrint supported types, headers, and example paths as JSON on stdout
--htmlStandalone HTML instead of raw SVG
--fixedFixed pixel size. Default for a .svg file
--responsiveSVG may shrink to its container. Default for stdout and HTML
--max-width <px>Ask Pele to adapt the layout. Can flip a wide LR flowchart vertical below 640px
--font-size <px>Base font size
--font <family>Label font
--id-prefix <str>Unique prefix when more than one SVG will share a page
--static-colorsResolve the CSS custom properties to plain colors. Required before converting to PNG or PDF

Stdout stays the SVG (or HTML). The receipt is always the last JSON line on stderr.

A surrounding ```mermaid fence is stripped. Mermaid's own frontmatter is not.

Pitfalls

  • File SVG defaults to responsive: false. Pass --responsive only when the SVG will be embedded and should shrink.
  • Pele colors shapes with CSS custom properties (fill="var(--_l)"). Browsers resolve them; rsvg-convert, ImageMagick and several PDF tools do not, and paint those fills black: edge-label boxes turn into solid black blocks. Render with --static-colors when the SVG goes to a PNG, PDF, slide or document, and look at the converted file, not only the SVG.
  • Node has no canvas measurer. Label widths can differ from a browser render. That is expected.
  • Do not pass --max-width unless the user asked for a narrow layout. It can change direction.
  • Headers are exact. radar, venn, wardley, swimlane, treeView, usecase, cynefin, railroad, agentflow all need -beta; architecture needs -beta too. There is no fishbone header; use ishikawa-beta.
  • Icon names (fa:fa-user, architecture icons other than cloud, database, disk, internet, server) render as an empty slot without an error. This script does not supply an icon callback. Drop the icon or replace it with text.
  • Source limit is 50,000 characters. Output limit is 4,000,000. Flowchart edge limit is 5,000.
  • npm install in the user's repo will not satisfy this script. The package lives in the skill root.
  • If node_modules exists but Pele fails to load, delete that node_modules and run npm install in the skill root.
  • An already-open agent session will not see a skill installed mid-session. That is a loader cache, not a bad install.

Verification

From the skill root:

npm run smoke

Completion: exit 0, and stdout JSON has "ok": true, a pele version, "types": 32, a rendered list with every catalog type, and a syntaxError with code: "syntax" and a non-zero line. The smoke also fails if scripts/catalog.mjs drifts from Pele's own type list, or if a header stops detecting as its type. examples/broken.mmd must keep failing. A smoke pass does not mean a new diagram is correct; each new diagram still needs its own receipt.

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.