{"data":{"slug":"discovered-2446f9b3e99901bb5c5735861047b789a31ddbf43da20211","title":"Diagram","summary":"Create a color picture from Mermaid text to visualize flow, structure, or plan in the desktop app or terminal.","url":"https:\/\/skillshunter.net\/skills\/discovered-2446f9b3e99901bb5c5735861047b789a31ddbf43da20211","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-2446f9b3e99901bb5c5735861047b789a31ddbf43da20211","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-2446f9b3e99901bb5c5735861047b789a31ddbf43da20211.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-2446f9b3e99901bb5c5735861047b789a31ddbf43da20211\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Write Mermaid text in `<name>.mmd` inside `.empstack\/diagrams\/` unless the diagram belongs in the repo's docs. Use `flowchart TB` for most diagrams, and color nodes with `class` lines using up to three colors from the specified palette.","instructions":"---\nname: diagram\ndescription: Draw a flow, structure or plan as a color picture from Mermaid text, in the desktop app or a terminal.\n---\n\n# Diagram\n\n1. Write the Mermaid text to `<name>.mmd`, in `.empstack\/diagrams\/` unless the diagram belongs in the repo's docs. Start with `flowchart TB` unless the picture is short and wide.\n2. Color nodes by kind with `class` lines, such as `class A,B teal`. The colors are gray, purple, teal, coral, pink, blue, green, amber and red. Use gray for start and end, and at most three colors. Write no `classDef` or `style` line, since those fix one color for both light and dark.\n3. Keep a picture to about 12 nodes. Split a bigger one into an overview and one picture per part. A subgraph whose nodes have edges to the outside ignores its `direction` line and runs those edges through its boxes, so put the group's name in each node's label instead.\n4. Run `node <skill dir>\/scripts\/diagram.mjs <name>.mmd --png`. It writes `<name>.svg` and `<name>.png` and prints the size.\n   - Exit 3 means Pele, the renderer, is not installed. Tell the user in one line that empstack installs `pele@1.9.0` from npm (2.3 MB, no dependencies) into `~\/.claude\/empstack\/diagram`. Run the `--install` command the script printed, then step 4 again. If the install fails, give the user the error and the command, and show the Mermaid text in a ```` ```mermaid ```` block until then.\n   - Exit 1 names the Mermaid line to fix.\n   - Wider than 1200 shrinks in a narrow pane. Turn the flow or split it.\n5. Read the PNG. Redraw while a label is cut off, an edge runs through a box or a label, or an edge seems to start at the wrong box. Without Chrome or Edge there is no PNG, so say the picture is unchecked.\n6. Show the SVG. In the desktop app, where `CLAUDE_CODE_ENTRYPOINT` is `claude-desktop`, send it with `SendUserFile`, display `render`. In a terminal, open it in the browser (`start \"\" <file>` on Windows, `open` on macOS, `xdg-open` on Linux) and give its path. Never send the `.mmd` file as the picture. The desktop app shows it as plain text.\n\nIn a Markdown doc or PR body, use a ```` ```mermaid ```` block. GitHub draws it.\n","use_cases":["Visualizing software architecture using Mermaid text","Creating flowcharts for documentation","Designing project plans with color-coded elements"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/jueyi6\/empstack\/blob\/74181e31d2f00313f8683ba157966efcabbe109e\/skills\/diagram\/SKILL.md","source_commit":"74181e31d2f00313f8683ba157966efcabbe109e","license":null,"version":null,"listing_approved_at":"2026-12-02","created_at":"2026-11-30T08:55:35.000000Z","updated_at":"2026-12-02T09:15:13.000000Z","seo_title":"Create Diagrams from Mermaid Text","seo_description":"Generate visual diagrams from Mermaid text using the Diagram skill. Create flowcharts, structures, and plans with color-coded nodes and clear formatting guidelines.","seo_keywords":["Mermaid diagram","flowchart generator","color-coded diagrams","software development visualization","diagram from text"]}}