---
name: mermaid
description: List Mermaid types, or draw an open catalog type and open it on the public viewer.
argument-hint: "[list | <topic or type>]"
---

# mermaid

List the catalog, or author an open catalog type and open it on the public viewer.
Done when the list is shown, or a tool `url` is shown.

## Syntax

Author Mermaid 12.1.0 built-in syntax. Drawer renders flowchart with Pele 1.7.0
and mindmap with a custom SVG pipeline, not Mermaid.js.

## Script Macros

| Macro | CLI |
|---|---|
| `$DRAWER_CTL` | `python3 scripts/drawer_control.py` |

## References

Load only what the current interface needs.

1. **list** — load [catalog](./references/catalog.md) only.
2. **route** — after an **open** type is chosen, load that one file from catalog.
3. Load [viewer](./references/viewer.md) for CLI `status` or preview kind.

## Interfaces

Two entries. Do not author during list.

1. **list** — slash `list`, or the ask is which types exist. Load catalog.
   Show the class table, including Open. Stop.
2. **route** — any draw ask. Pick exactly one catalog type. If it is not
   open, say it is not open, then stop. If it is open, load only that file.
   Author. Preview.

## Route

The catalog is the type boundary. **Open** is `flowchart` (`flowchart` /
`graph`), `mindmap`, and the Design group (`sequence`, `class`, `state`,
`er`, `requirement`, `c4`, `usecase`, `eventmodeling`, `railroad`).
`flowchart-elk` is the flowchart type.

1. A named type or alias wins.
2. Else pick the type that matches what must be visible.
3. Two fit → pick one; do not stop to ask.
4. None fit → ask one line, then stop.
5. A closed type → say it is not open, then stop. Do not author.
6. Source already in hand and the ask is preview → drawer only.

## Author

What to write, after the open type file is loaded.

1. Use one sample in that file (minimal default). Flowchart: one edge-meaning
   category. Mindmap: one root, indented branches. Design: Pele preview;
   Title and Source.
2. Replace labels; keep the sample's node and edge kinds.
3. Prefer ≤ ~12 primary elements unless the user asked for more.
4. Mint without `%% style`. On update, leave those lines unchanged.

## Mode

Pick short link or cloud.

1. If the `whoami` MCP tool is listed, use **cloud mode**. Load [cloud](../references/cloud.md).
2. If it is missing, use **short-link mode**. Do not mention MCP.
3. If `whoami` is listed but a tool call fails, use **short-link mode**.
4. If the user pastes a viewer URL in short-link mode, load [pointers](../references/pointers.md).

## Short link flow

Publish unsigned.

1. After any preview, show only the CLI stdout `url` and stop.
2. No scene to draw (and not an update): run `$DRAWER_CTL preview --kind`
   with one Open kind, no `--file`, and no stdin body.
3. Run `$DRAWER_CTL preview --kind` with the Route
   kind and stdin or `--file`. If it reports a DSL error, correct the Source
   and rerun.
4. To change, edit this session’s last Source text and preview again. That
   creates a new short url. If none yet, run step 3 first.
5. To keep, use cloud mode (`#b:`).

## Open wording

Show the CLI stdout `url` or MCP `url`. One line.

## Boundaries

1. CLI stdout contract: `$DRAWER_CTL --help`.
2. CLI success or MCP write completes the skill; do not open the URL, drive
   the viewer, or screenshot the layout unless the user explicitly requests
   visual verification.
