Recipe

State machine diagram writer

Generate Mermaid.js state diagrams from structured prompts. Define states, transitions, guards, and actions — Meridian renders the graph.

Prompt format

states:
  - idle
  - loading
  - success
  - error

transitions:
  - from: idle
    to: loading
    on: FETCH
  - from: loading
    to: success
    on: RESOLVE
    guard: response.ok
  - from: loading
    to: error
    on: REJECT
  - from: error
    to: loading
    on: RETRY
    action: clearErrors()

Output

idleloadingsuccesserror

Usage

Paste your state definition into the Meridian prompt bar and append /state-machine. The model returns a Mermaid diagram rendered inline. Export as SVG or copy the Mermaid source for your docs.