AGENT SKILL

pele

Use when a request names pele or pele.run, or a project depends on the `pele` npm package: writing, rendering, or theming its diagrams, or calling its API.

License 许可
MIT
所属仓库
pascalandy/skills
最近更新
2026-11-15
Stars
★ 0
Forks
1

01 前言 Front Matter

kind
general
name
pele
description
Use when a request names pele or pele.run, or a project depends on the `pele` npm package: writing, rendering, or theming its diagrams, or calling its API.

02 资源文件 47

03 SKILL.md 正文

Pele

Pele is a new renderer, not Mermaid. It reads Mermaid syntax and draws the diagram with its own layout, in a browser or in Node, with colors from CSS variables. Mermaid habits apply to syntax only. Before you reuse a Mermaid habit, read Differences from Mermaid.

Resolve bundled paths relative to this skill directory. references/source/ holds the pele.run pages at the version that its README names. When the project uses a newer pele, read the live page at https://pele.run/<page>.md, such as https://pele.run/api.md.

To draw a diagram, follow Draw a diagram. To hand a sequence diagram to a reader, such as a client, as web pages and images, go to Pages and images. To add pele to an app, go to Pele in an app.

Draw a diagram

  1. State the reader's question and the takeaway in one sentence each. Say whether the input is measured data, an estimate, or a made-up example
  2. Choose the type in Choose by question. For an exploratory request, compare two or three types that show different facts about the same subject. For other requests, use one type
  3. List the headings of the type's examples page with rg -n '^#' <page>. Copy the closest example as the start
  4. Model the meaning before the style: units, direction, the meaning of each arrow, and any scale. Do not invent observations or turn a hypothesis into a proven cause. When the type accepts them, add the accessibility title and description, accTitle and accDescr. Done when the diagram alone shows each unit and the meaning of each arrow
  5. Run Render and verify until the script answers {"ok":true,...} and the screenshot shows the takeaway
  6. Deliver the SVG, its screenshot, the editable source, one sentence on how to read the diagram, and the pele version that the script reported

Choose by question

Reader's question Type and examples
What happens next, or under which condition? Flowchart
Who performs each step of a process? Swimlane
Who exchanges what, and in what order? Sequence
Which states exist, and what moves between them? State
What entities exist, and how do they relate? ER, Class
At what architectural level are we speaking? C4
How are services connected? Architecture
How do AI agents pass work to each other? Agentflow
How do commands, events, and views change a system over time? Event modeling
Which goals does each actor reach with the system? Use case
Which elements satisfy or verify each requirement? Requirement
When does each task happen? Gantt, Timeline
What is in progress, by status? Kanban
How satisfying is each step of a task? Journey
How did branches diverge and merge? Git graph
Where does a quantity flow? Sankey
How is a whole divided? Pie, Treemap for a hierarchy
How does a value change along an axis? XY chart
What deserves attention given two criteria? Quadrant
Which tradeoffs disappear inside an average score? Radar
What do sets share? Venn
Which causes contribute to a problem? Ishikawa
Should we apply a procedure, analyze, experiment, or stabilize? Cynefin
What should we build, buy, or let evolve? Wardley
What ideas branch from one topic? Mindmap
What does a hierarchy of files or folders hold? Tree view
What syntax does a grammar accept? Railroad
Which fields does a packet hold? Packet
Where do blocks sit in a grid I arrange? Block

A diagram computes nothing: no critical path, causal inference, or statistics. When the task is an exact quantitative comparison, use a plotting tool.

Syntax and meaning

  • Keep short, stable IDs apart from display labels. Quote each label that holds punctuation: api["API (public)"]
  • Use text as well as color for each distinction
  • In a sequence diagram, keep the label of a message from a participant to itself at two lines or fewer: pele 1.6.0 draws a third line over the next frame or message. Remove this limit when pele fixes the height calculation
  • Label made-up data as made-up. Below the diagram, say what the diagram cannot establish

Render and verify

Requires uv (uv --version), Node.js 20 or later (node --version), and pnpm (pnpm --version). To use the project's pele, run scripts/render_diagrams.py from the project's folder. When the script finds no pele, its error gives the install command.

# Check only, without files
uv run <this-skill-folder>/scripts/render_diagrams.py diagram.mmd
# Also write one SVG per diagram
uv run <this-skill-folder>/scripts/render_diagrams.py notes.md --output /tmp/pele

For the inputs, the theme option, and the answer fields, run the script with --help. Fix each error at the file:line:column that the script names. Then run the script again.

To inspect an SVG, take a screenshot of it in a Chromium browser (chromium --version), at the width and height that the answer gives. rsvg-convert and ImageMagick ignore pele's CSS variables and draw every shape black.

chromium --headless --screenshot=/tmp/pele/diagram.png --window-size=<width>,<height> file:///tmp/pele/diagram.svg

On macOS, use "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" in place of chromium. Read the screenshot. Check the labels, arrowheads, legend, contrast, and takeaway. An ok answer proves that the diagram renders with that pele version, not with Mermaid or another host's renderer.

When the screenshot is taller than about 2000 px, use ImageMagick 7 (magick --version) to cut it into slices. From the screenshot's folder (/tmp/pele in the example above), run magick diagram.png -crop x1400 +repage slice-%02d.png, then read each slice. ImageMagick only cuts the PNG that Chromium drew, so pele's colors stay intact.

Pages and images

scripts/render_pages.py turns a .mmd file that holds a sequence diagram into a light page, a dark page, and a JPEG of each page, 1920 pixels wide at twice the pixel density. It writes them beside the .mmd file. The pages are self-contained and in Canadian French. Each page draws the diagram in the reader's browser, so the labels fit the font that browser shows. The script needs the tools of Render and verify and a Chromium browser; when it finds no Chromium, its error gives the install command. Run the script with --help for the title and actor options.

uv run <this-skill-folder>/scripts/render_pages.py process.mmd --title "PROC_01 | Handle a request" --actor CLIENT
  1. Run the script until it answers {"ok":true,...}
  2. Open each JPEG. Check the title, the legend, every participant, and the last message
  3. Write the command beside the diagram, such as in its notes, so the next run after a change gives the same pages

To put a page online, use the html-publish skill.

Theme

assets/theme-dark.css sets a black canvas, white text, and Catppuccin Frappe accents as pele variables. assets/theme-light.css sets a white canvas and dark Frappe text. Each theme also holds the colors that assets/page.css gives to notes, to notes that start with ✅, to break frames, and to messages that start with 🔷. render_diagrams.py embeds the dark theme in each SVG, and render_pages.py puts one theme in each page. The embedded theme applies to every pele diagram on an HTML page. Before you put an SVG inline in a page, render it with --no-theme. In an app, add a theme to the page's CSS. Theming lists every variable and class name.

Pele in an app

  • Rendering, mounting, errors, and imports: read API
  • Diagrams from untrusted authors: before you insert their SVG or an error message, read Security
  • Fonts: pele measures labels before it draws them. Pass the page's font as Fonts describes
  • Pele compared with Mermaid.js: read the home page for the bundle size and the render time

04 同仓库更多 Skills