/polyviz
Render Polygraph verification artifacts as deterministic diagrams (SVG, optional PNG). Renders a fixed catalog — state-machine, invariants, counterexample, compat-gate, model-card — from a viz-model JSON or straight from a Polygraph/polyvers artifacts directory. Byte-identical
$ npx -y skills add cognitive-fab/polygraph --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/polyviz
Context preview
What this command does when you run it.
Render Polygraph verification artifacts as deterministic diagrams (SVG, optional PNG). Renders a fixed catalog — state-machine, invariants, counterexample, compat-gate, model-card — from a viz-model JSON or straight from a Polygraph/polyvers artifacts directory. Byte-identical
Command definition
polyviz.mddescription: Render Polygraph verification artifacts as deterministic diagrams (SVG, optional PNG). Renders a fixed catalog — state-machine, invariants, counterexample, compat-gate, model-card — from a viz-model JSON or straight from a Polygraph/polyvers artifacts directory. Byte-identical output; no model call at render time.
argument-hint: render --in <dir|polyviz.json> --diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> --out <dir> [--format svg,png] [--theme dark|light] [--tokens f.json] [--scale 2] — or — hash --in <...> --diagram <...> — or — schema
allowed-tools: Bash, Read, Write
Run polyviz over the arguments in `$ARGUMENTS`. polyviz is the VISUALIZATION side of the method: it turns the artifacts Polygraph/polyvers already produced into a fixed catalog of clean, brand-consistent diagrams. Rendering is a pure function `artifacts → SVG` — deterministic (byte-identical on repeat), no model call, no network. It does **not** run verification; it only visualizes.
This drives `${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs`:
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs render --in <dir|polyviz.json> \
--diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> \
--out <dir> [--format svg,png] [--theme dark|light] [--tokens f.json] [--scale 2]
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs hash --in <...> --diagram <...>
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs schemaInputs:
- **A viz-model JSON** (`*.polyviz.json`, the stable contract — `polyviz schema`
prints it): pure `viz-model → SVG`, executes no user code, no optional deps for SVG.
- **A Polygraph/polyvers artifacts directory**: adapters derive the machine graph
(bounded BFS that **executes** the SAM/`next` module), read `invariants.mjs`, resolve a failing `findings.json` to its counterexample trace, and map `compat-report.json`. A `polyviz.annotations.json` in the dir supplies the narrative the raw artifacts don't carry.
Optional runtime components (mention when relevant): `state-machine`/`model-card` need `elkjs`; `--format png` needs `@resvg/resvg-js` (native/WASM). The SVG path for `invariants`/`counterexample`/`compat-gate` needs neither. Missing optional deps fail loud with the exact `npm i` to run.
Workflow:
1. Default to `--format svg` (deterministic, diffable). Add `png` only for a raster deliverable. 2. When `--in` is a run directory, warn that the machine graph is derived by executing the module, and offer a `polyviz.annotations.json` for nicer copy. 3. Use `hash` to prove determinism in CI. The reference figures under `${CLAUDE_PLUGIN_ROOT}/reference/` are the visual acceptance bar.
Read more
description: Render Polygraph verification artifacts as deterministic diagrams (SVG, optional PNG). Renders a fixed catalog — state-machine, invariants, counterexample, compat-gate, model-card — from a viz-model JSON or straight from a Polygraph/polyvers artifacts directory. Byte-identical output; no model call at render time. argument-hint: render --in <dir|polyviz.json> --diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> --out <dir> [--format svg,png] [--theme dark|light] [--tokens f.json] [--scale 2] — or — hash --in <...> --diagram <...> — or — schema allowed-tools: Bash, Read, Write
Run polyviz over the arguments in `$ARGUMENTS`. polyviz is the VISUALIZATION side of the method: it turns the artifacts Polygraph/polyvers already produced into a fixed catalog of clean, brand-consistent diagrams. Rendering is a pure function `artifacts → SVG` — deterministic (byte-identical on repeat), no model call, no network. It does **not** run verification; it only visualizes.
This drives `${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs`:
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs render --in <dir|polyviz.json> \
--diagram <all|state-machine|invariants|counterexample|compat-gate|model-card> \
--out <dir> [--format svg,png] [--theme dark|light] [--tokens f.json] [--scale 2]
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs hash --in <...> --diagram <...>
node ${CLAUDE_PLUGIN_ROOT}/bin/polyviz.mjs schemaInputs:
- **A viz-model JSON** (`*.polyviz.json`, the stable contract — `polyviz schema`
prints it): pure `viz-model → SVG`, executes no user code, no optional deps for SVG.
- **A Polygraph/polyvers artifacts directory**: adapters derive the machine graph
(bounded BFS that **executes** the SAM/`next` module), read `invariants.mjs`, resolve a failing `findings.json` to its counterexample trace, and map `compat-report.json`. A `polyviz.annotations.json` in the dir supplies the narrative the raw artifacts don't carry.
Optional runtime components (mention when relevant): `state-machine`/`model-card` need `elkjs`; `--format png` needs `@resvg/resvg-js` (native/WASM). The SVG path for `invariants`/`counterexample`/`compat-gate` needs neither. Missing optional deps fail loud with the exact `npm i` to run.
Workflow:
1. Default to `--format svg` (deterministic, diffable). Add `png` only for a raster deliverable. 2. When `--in` is a run directory, warn that the machine graph is derived by executing the module, and offer a `polyviz.annotations.json` for nicer copy. 3. Use `hash` to prove determinism in CI. The reference figures under `${CLAUDE_PLUGIN_ROOT}/reference/` are the visual acceptance bar.
Your tests check the paths you thought of. Polygraph checks the ones you didn't.
Repo: cognitive-fab/polygraph
Other commands on polygraph.
- /polygen
Run polygen — draft a contract from a feature description, author a verifiable SAM v2 strict-profile module against it (--legacy-bare-next for a bare next(state, action, data) implementation), self-repair against reachable invariant violations, and synthesize a demo/regression
Open command - /polynv
Run polynv — elicit the invariants for a state machine. Harvest candidates from the contract's vocabulary, traces, and fleet snapshots; contribute frontier-model domain priors; pre-check every candidate (HOLDS or a concrete counterexample); drive a plugin-led interview into an
Open command - /polyvers
Run polyvers — classify a state-machine version change into compatibility lanes, run the gates those lanes require against fleet snapshots (shape round-trip, vocabulary, in-flight stimuli, migration validation, seeded model check), scaffold migrations, and check parent×child
Open command - /verify
Run the Polygraph verification loop — generate N transition-function specs from a source file and replay real traces against them, reporting spec-errors vs code-findings.
Open command - /workflow
Build a feature as a workflow, not an agentic loop — design stages/signals/budgets with the user, front-load contract + invariants, author with polygen, declare effects, prove the anti-loop rules with check-effects, and stand it up under polyrun.
Open command

