AgentKit
DocsKitsCLI ReferenceDesktop App
BetaYou are reading docs for the beta channel (2.15.0-beta.13). Features may change before the next stable release.Switch to stable →

Skills

Compile interactive system maps with ak:diagram

Turn typed JSON IR, Mermaid, editorial templates, or HTML into deterministic SVG, HTML, PNG, or video, with explicit Skill flags and helper boundaries.

Use ak:diagram when you need a validated interactive system map or an editorial diagram. The Skill compiles typed JSON IR for architecture, workflow, sequence, dataflow, and lifecycle maps, and still renders Mermaid, legacy editorial templates, and prepared HTML.

Choose ak:diagram by the artifact

Use ak:diagram when

  • You need an interactive architecture, sequence, workflow, dataflow, or lifecycle map from typed JSON.
  • You need SVG, self-contained HTML, PNG, or a short video from Mermaid or editorial input.
  • You need local, deterministic compilation without a CDN.

Choose another workflow when

  • You want reviewable Mermaid source without editorial framing. Use ak:mermaidjs-v11.
  • You need an editable canvas or codebase auto-map. Use ak:excalidraw.
  • You need large-graph exploration and analytics. Use ak:graphify.
  • You are deciding whether a visual explanation is useful at all. Start with ak:preview.

Invoke the Skill

Complete Onboarding, and confirm Engineer Kit is installed for your runtime and scope. Provide the input file, intended artifact, and whether browser rendering, video capture, or dependency installation is allowed.

RuntimeInvocationAvailability boundary
Claude Code/ak:diagram ...Uses the installed Engineer Skill; local file, process, browser, and image-review access depend on the session.
Cursor/ak:diagram ...Uses the user-verified slash spelling; bundled-helper and browser access depend on the Cursor session.
Codex$ak:diagram ...Uses native Skill discovery; rendering depends on filesystem, process, browser, and dependency access in the Codex environment.
/ak:diagram "Compile architecture.json to interactive HTML in ./build. Use preset classic and theme dark. Do not install dependencies."

These are Skill invocation flags:

FlagEffect
--type <slug>Selects a legacy editorial template type
--preset <preset>Selects classic, signal-flow, blueprint, or editorial for typed IR
--theme <light|dark>Selects the typed-IR color tokens without changing geometry
--format <svg|fragment|html>Selects the typed-IR compile output
--out <dir>Selects the output directory

Bundled render.py / record.py helpers still accept --input, --title, --caption, --no-png, --no-svg, --dry-run, --snapshot-profile, --duration, --fps, --gif, and --keep-frames. Those helper controls are not Skill invocation flags.

Choose an input tier

TierInputWhat happensCurrent boundary
1 — Typed JSON IR.json archetypes architecture, workflow, sequence, dataflow, lifecycleCompiles locally with Node 18, offline, without a browserInteractive HTML can search, focus, trace reach, inspect routes, and export a share card
2 — Mermaid.mmdWraps Mermaid source in an editorial frame using vendored Mermaid v11.4.1, local design tokens, and the shared browser pipelineMermaid auto-layout and font metrics can still shift outside the validated renderer profile
3 — Legacy editorial templateJSON plus --type <slug>Loads a vendored template and applies slot substitutionUse this only for non-archetype editorial types
4 — Raw HTML.htmlPasses the supplied page through for rendering or recordingThe HTML is trusted as supplied and can include its own scripts, assets, or network requests

Typed IR is the preferred path for system maps. Interactive HTML is deterministic and respects prefers-reduced-motion: reduce.

Separate static rendering from video recording

The static rendering helper always writes <basename>.html and, by default, also writes:

  • <basename>.png — a 2× screenshot with animations frozen at their final frame;
  • <basename>.svg — only when an SVG exists in the rendered page and can be extracted.

Its --no-png and --no-svg controls suppress those outputs. --dry-run writes HTML without launching the browser. HTML is the animated surface; PNG is a frozen static frame. SVG extraction serializes the first SVG found in the rendered DOM; it does not promise that every input contains an SVG or that page-level CSS, fonts, assets, or animation context remain standalone. Inspect the extracted static artifact.

Video is a separate recording step over an HTML input. MP4 is the default; the recording helper's --gif selects a palette-generated GIF. It pauses browser animations, advances currentTime frame by frame at the requested --duration and --fps, captures temporary PNG frames, and asks ffmpeg to assemble the result. Mermaid has no native animation primitives in this workflow: animated Mermaid connectors require post-processing, while prepared HTML can use the eight bundled CSS connector effects. Those effects freeze when prefers-reduced-motion: reduce is active.

Probe dependencies without installing them

Ask the Skill to run its bundled dependency probe before rendering. The probe reports readiness and never installs anything. It checks:

ProbeRole
PlaywrightDrives the browser render and frame capture
ChromiumProduces PNG and extractable SVG output and captures video frames
Vendored Mermaid assetRenders Tier 1 source without a CDN
ffmpegAssembles MP4 or GIF; required only for video
mmdcOptional fast-path availability report; the editorial renderer still uses its shared HTML pipeline

HTML-only composition can avoid the browser with the helper's --dry-run. Browser-rendered PNG or SVG needs Playwright and Chromium. Video additionally needs ffmpeg. Treat installation of any missing dependency as a separate approved action.

Understand determinism and visible effects

Pinned Mermaid, frozen animations, fixed browser settings, and frame stepping support reproducible output with a fixed Chromium, font, and ffmpeg toolchain. A snapshot comparison refuses the wrong browser or font profile rather than reporting misleading hash drift. Outside that profile, browser or ffmpeg versions, font substitution, label wrapping, and Mermaid auto-layout can change pixels, encoding, or hashes. Animated HTML remains dynamic; the PNG is one frozen state, and MP4 or GIF is an explicit frame sequence. Record the actual tool versions used.

Rendering writes files and launches local tools

A run reads your .mmd, JSON, or HTML source, writes artifacts to the selected destination, and can replace same-named outputs. Browser rendering launches headless Chromium. Video capture creates temporary frames and runs ffmpeg. Review input content and output names before proceeding.

Bundled Mermaid, templates, styles, and effects are local and require no CDN. However, user-supplied HTML can contact the network when it references remote scripts, fonts, images, or other assets. The Skill does not publish, upload, commit, or push generated artifacts unless a separate workflow is explicitly authorized.

A complete result reports the input tier, selected type and variant, exact outputs, dependencies actually used, static or video boundary, visual review, network activity, overwritten files, and any unverified renderer or font-profile condition.