Skills
Author and render diagrams with ak:mermaidjs-v11
Turn a process, system, data model, timeline, or journey into Mermaid v11 source with explicit parsing, rendering, accessibility, and security evidence.
Use ak:mermaidjs-v11 to express a process, interaction, data model, state
machine, architecture, plan, or dataset as Mermaid v11 source. The Skill provides
syntax, configuration, CLI, integration, and practical-pattern references; the
active runtime or a separately installed renderer must parse and render the
result.
Choose ak:mermaidjs-v11 for text-based diagrams
Use ak:mermaidjs-v11 when
- You want a diagram stored as reviewable text in Markdown or a
.mmdfile. - You need a flowchart, sequence, class, state, ER, Gantt, journey, Git graph, timeline, mindmap, architecture, block, quadrant, requirement, packet, pie, XY, Sankey, radar, treemap, or related Mermaid v11 diagram.
- You need SVG, PNG, or PDF output generated from an approved source diagram.
- You need Mermaid embedded in a browser, Node application, React, Vue, MDX, or another host that supports the selected syntax.
Choose another workflow when
- A short list or table communicates the information more clearly than a diagram.
- You need freehand positioning, complex illustration, or manual vector editing. Use a visual-design or diagramming tool built for that artifact.
- You only want to read existing Markdown that contains Mermaid. Use
ak:markdown-novel-viewer, while respecting its CDN and security boundary. - The target platform does not support the required v11 or beta diagram type. Choose a supported type or pre-render an image.
Prepare the diagram contract and renderer
Before you start:
- Complete Onboarding, and confirm Engineer Kit is installed for the current runtime and scope.
- Provide the diagram's purpose, intended reader, facts, node or actor names, relationships, direction, ordering, scope, and details that must not be inferred.
- Name the target host and exact output: inline fenced source,
.mmd,.svg,.png,.pdf, or application integration. Renderer support varies by host. - Choose a security level, theme, background, font, accessibility title and description, and whether interactive links or callbacks are allowed.
- Make Mermaid v11 or
@mermaid-js/mermaid-cliavailable when parse or render evidence is required. The references declare Node.js^18.19 || >=20.0for the CLI path.
| Runtime | Invocation | Availability boundary |
|---|---|---|
| Claude Code | /ak:mermaidjs-v11 ... | Native delivery can author files and run an installed CLI or browser renderer; no Mermaid executable is bundled in this Skill. |
| Cursor | /ak:mermaidjs-v11 ... | Slash invocation is user-verified; CLI, preview, and browser parity depend on the Cursor environment. |
| Codex | $ak:mermaidjs-v11 ... | Native Skill discovery is supported; parse, image rendering, and browser inspection depend on tools available to the session. |
The declared input is [diagram-type or description]. It is not a fixed parser.
State the diagram type when you know it, or provide the relationships and let
the Skill recommend one without inventing missing facts.
Request source and rendered evidence
/ak:mermaidjs-v11 "Create a left-to-right sequence diagram for the supplied checkout events. Keep service names exact, distinguish synchronous calls from asynchronous notifications, include failure and retry branches, add accTitle and accDescr, return a fenced Mermaid block and checkout-sequence.mmd, parse it with Mermaid v11, render SVG with a pinned v11 CLI if available, and report any unverified layout."/ak:mermaidjs-v11 "Create a left-to-right sequence diagram for the supplied checkout events. Keep service names exact, distinguish synchronous calls from asynchronous notifications, include failure and retry branches, add accTitle and accDescr, return a fenced Mermaid block and checkout-sequence.mmd, parse it with Mermaid v11, render SVG with a pinned v11 CLI if available, and report any unverified layout."$ak:mermaidjs-v11 "Create a left-to-right sequence diagram for the supplied checkout events. Keep service names exact, distinguish synchronous calls from asynchronous notifications, include failure and retry branches, add accTitle and accDescr, return a fenced Mermaid block and checkout-sequence.mmd, parse it with Mermaid v11, render SVG with a pinned v11 CLI if available, and report any unverified layout."For a data-driven diagram, provide the authoritative dataset and the intended encoding. A pie, XY, Sankey, radar, or treemap should not silently aggregate, normalize, reorder, or omit values. Ask the result to include a data-to-mark mapping you can reconcile with the source.
Select the smallest fitting diagram
| Information shape | Useful Mermaid type | Verification focus |
|---|---|---|
| Process and decisions | flowchart | Direction, branch labels, terminal states, and edge crossings |
| Messages over time | sequenceDiagram or zenuml | Participants, ordering, sync or async semantics, alternatives, and activation |
| Domain structure | classDiagram or erDiagram | Names, fields, visibility, relationship direction, and cardinality |
| Lifecycle | stateDiagram-v2 | Initial and terminal states, guards, unreachable states, forks, and joins |
| Schedule or experience | gantt, timeline, or journey | Dates, dependencies, status, actor, and score meaning |
| System or module layout | C4Context, architecture-beta, or block-beta | Boundary, ownership, direction, labels, beta support, and icon availability |
| Quantitative comparison | pie, xychart-beta, sankey-beta, radar-beta, or treemap-beta | Source values, axes, units, scale, ordering, and beta support |
| Planning or traceability | kanban, quadrantChart, requirementDiagram, gitGraph, or packet-beta | Exact status, coordinates, identifiers, ranges, and source-of-truth limits |
Some referenced types carry a -beta suffix. Treat them as renderer-sensitive,
test them against the exact target version, and provide a simpler fallback when
the destination cannot render them.
Observe the diagram stages
- The Skill confirms the information model. It separates supplied facts from inferred layout and asks about missing relationships that would change meaning.
- It chooses one diagram type and direction. The choice reflects the information shape and the destination's supported Mermaid version.
- It authors semantic source. Stable IDs, clear labels, meaningful edge text, comments, accessible title and description, and minimal styling keep the source reviewable.
- It applies bounded configuration. Theme, look, layout, font, deterministic IDs, size limits, and security level are explicit rather than host defaults when reproducibility matters.
- It parses before rendering.
mermaid.parse()or an equivalent v11 check distinguishes syntax errors from later browser or layout failures. - It renders in the selected target. The CLI or host produces SVG, PNG, PDF, or live HTML using a pinned version when possible.
- It inspects visual output. Clipped labels, overlaps, crossing arrows, contrast, scale, font substitution, responsive behavior, and accessible metadata are reviewed.
- It returns source and evidence. The report names versions, commands, outputs, data reconciliation, render findings, and gaps.
Render with an explicit tool boundary
The referenced CLI converts .mmd input according to the output extension:
mmdc -i checkout-sequence.mmd -o checkout-sequence.svg
mmdc -i checkout-sequence.mmd -o checkout-sequence.png -t dark -b transparent
mmdc -i checkout-sequence.mmd -o checkout-sequence.pdf --configFile mermaid-config.jsonInstallation can be global, local, through npx, or by pulling the documented
container image. Each path can use the network, write packages or image layers,
start a browser-backed renderer, and consume CPU, memory, and disk. Batch
conversion writes one artifact per input and can overwrite matching outputs;
review targets before running it.
Browser integration can load Mermaid from a CDN or an installed npm package.
Avoid the reference's @latest URL when reproducibility matters; pin a reviewed
v11 version. The Jupyter example uses mermaid.ink, the editor workflow uses
mermaid.live, and CDN icon packs can make diagram source or related metadata
leave the machine. Obtain approval before using those external services.
Keep source, links, and rendering safe
Parse success does not make a diagram safe or readable
A valid graph can still expose secrets, contain unsafe interactive links, render differently on another host, or produce unreadable SVG. Validate the source, render with the target version, and inspect the actual output.
- Prefer
securityLevel: 'strict', the documented default, for user-supplied or published diagrams.looseallows more HTML and interaction and needs a separately reviewed trust boundary. - Do not place credentials, private endpoints, customer identifiers, hidden architecture, incident details, or sensitive data in source, exported images, links, tooltips, comments, or accessibility descriptions.
- Interactive
clickhandlers and URLs can navigate or execute page callbacks. Include them only when required and reviewed for the target host. - Custom CSS, HTML labels, icon loaders, and remote fonts change security, appearance, accessibility, and reproducibility. Record each external asset.
- Generated SVG can contain links, IDs, style, and metadata. Treat it as active content when embedding and apply the destination's sanitization policy.
- Writing source or rendered files is authorized only when requested. Publishing, uploading, embedding in production, or replacing a checked-in diagram remains a separate action.
Verify outputs and evidence
A complete result should include:
- Canonical Mermaid source in the requested Markdown block or
.mmdfile, with exact IDs, labels, relationships, dates, values, and comments. accTitleand a usefulaccDescr, plus readable text alternatives when the destination cannot expose Mermaid's SVG accessibility metadata reliably.- Mermaid and CLI or host versions, security level, theme, layout, font, configuration file, custom CSS, and commands used.
- Parse result distinct from SVG, PNG, PDF, or live-host render result.
- Rendered artifact paths and dimensions, along with visual inspection for collisions, clipping, edge routing, label placement, contrast, and scale.
- Reconciliation against the supplied process, schema, timeline, or dataset, with inferred layout and unsupported target features called out.
The Skill references companion /ak:tech-graph guidance for universal SVG
layout review, but that capability is not part of this Skill directory. Use it
only when it is actually installed; otherwise perform the stated visual checks
with available tools and report the missing companion. The Skill contains no
renderer, scripts, or directly scoped tests. The pinned stable and beta releases
contain identical files.
Troubleshoot and interpret limits
| Symptom | Safe next step |
|---|---|
| The parser reports an unknown type | Check the exact declaration, target Mermaid version, and whether the type is beta or unsupported by the host; choose a stable fallback. |
| Source parses but no diagram appears | Inspect host integration, module loading, selector, startOnLoad, browser console, security policy, and render call. |
| CLI command is missing | Install a reviewed pinned @mermaid-js/mermaid-cli locally, use the approved container, or return source with rendering explicitly blocked. |
| Labels overlap or arrows cross excessively | Shorten labels without changing meaning, split the diagram, change direction or layout, group related nodes, and re-render for inspection. |
| The diagram differs between hosts | Pin Mermaid v11, configuration, theme, fonts, and layout; compare the actual destination render instead of assuming parity. |
| CDN rendering fails offline | Use an approved local Mermaid package or CLI and record the version; do not claim the CDN-backed preview passed. |
| An accessible title is present but the image is still unclear | Add a meaningful description or adjacent text alternative that communicates the relationships, not just the diagram topic. |
| The target rejects raw SVG | Render PNG or use the host's supported fenced Mermaid path after reviewing the loss of interactivity and accessibility metadata. |
| The runtime does not recognize the Skill | Confirm target and scope, restart the runtime session, then follow Runtime cannot find a Skill or Agent. |
Use ak:markdown-novel-viewer to read trusted
Markdown with live Mermaid rendering or Runtime adapters
to review renderer and tool differences.
Write conversion copy with ak:copywriting
Turn an audience, offer, proof, and format brief into reviewable copy, variants, and evidence without inventing claims or hiding external processing.
Read Markdown in a browser with ak:markdown-novel-viewer
Serve one Markdown file or a directory through a calm local reader with navigation, syntax highlighting, Mermaid rendering, and explicit network boundaries.