Skip to content

Add /statechart-diagram and call it after /statechart - #6

Merged
fitziboy3-source merged 2 commits into
adam/releasefrom
adam/statechart-diagram
Nov 2, 2026
Merged

fitziboy3-source merged 2 commits into
adam/releasefrom
adam/statechart-diagram

Conversation

@fitziboy3-source

Copy link
Copy Markdown
Owner

Closes #

What changed

  • New skill plugins/pstack/skills/statechart-diagram/. Draws the chart.mmd and report.md that /statechart writes as a square plate in pen and coloured pencil on paper, after Kevin Ngo's statechart-art (MIT; this is an independent re-implementation). Pele lays the chart out in a hand font, scripts/plate.mjs draws it with @napi-rs/canvas (no browser), objects from the reader's world (--near s3=stamp:APPROVED) sit beside the states they belong to, and TLC's marks become red cards, red paths and a "rule broken" stamp. The small line under the title reports what TLC checked. Node 20 or later; npm install in its scripts/ on first use. Model-invocable; /statechart stays typed only.
  • New hook. PostToolUse on Bash runs hooks/after-statechart through the existing run-hook.cmd wrapper (with a commandWindows entry like session-start). The Node script reads the tool call and, once the /statechart runner has written chart.mmd, adds one additionalContext note asking for the plate. On every other command it is silent (about 35 ms); without Node it exits 0.
  • /statechart hand-off. One added sentence asks for the plate once, so the chain also holds where hooks do not run (recorded in the UPSTREAM.md ledger as a port patch).
  • Listings and provenance. README.md, docs/reference.md, poteto-help and the verifier's features/registry.json name the skill; CHANGES.md, FORK.md (patch 8) and NOTICE.md record the addition. Version stamp 1.16.0-adam.20261102 in the three manifests and UPSTREAM.md.

Roll-out after merge: bump the date in each cloud environment's pasted cloud-setup.sh so the kit re-installs, and reinstall the plugin on the Mac lanes. The first plate in a session runs npm install in the skill's scripts/ (the skill says so when fonts are missing).

Verification

  • Static invariants pass (bun run static: JSON manifests, skill-collision invariants, sync-port test). Strict typecheck passes (bun run typecheck). Bun tests: 514 of 515 pass; the one failure, runLane > terminalizes catchable failures after reserving output paths, fails identically on untouched adam/release in this environment and is unrelated to this change. Plugin validation (claude plugin validate) was not available in the build environment.
  • The hook script was pipe-tested with real PostToolUse payloads: a /statechart run reported through its Wrote <dir> line, a run with only --out in the command, a cd dir && … form, an unrelated command, the plate command itself, a run whose folder has no chart.mmd, and malformed input; through run-hook.cmd and with Node absent from PATH.
  • The skill drew the ATLAS change-order chart straight from /statechart output, a chart with a parent state, two regions and a broken rule, and a plain Mermaid file; a fresh Claude agent given only SKILL.md produced a correct plate and left chart.mmd untouched.
  • The exact candidate is installed in every affected harness.
  • The changed behavior passes from each real user surface: run /statechart on a model in a session with this head installed and confirm the plate is drawn without being asked.
  • The live-gate status on the final head links the evidence comment (installed version, surface, action, observed result).

Mergify does not queue a pull request without live-gate on its exact head. Do not merge, tag, release, or roll out without it.


Generated by Claude Code

fitziboy3-source and others added 2 commits November 2, 2026 01:15
…r /statechart

A new fork skill, statechart-diagram, draws the chart.mmd and report.md that
/statechart writes as a square plate in pen and coloured pencil on paper,
after Kevin Ngo's statechart-art: Pele lays the chart out in a hand font,
scripts/plate.mjs draws it with @napi-rs/canvas, objects from the reader's
world sit beside the states, and TLC's marks become red cards, red paths and
a "rule broken" stamp. It runs on Node 20 or later; npm install in its
scripts/ on first use fetches Pele, the canvas and two Open Font License
fonts.

A PostToolUse hook on Bash, hooks/after-statechart through run-hook.cmd,
reads each tool call and, once the /statechart runner has written chart.mmd,
adds one note asking for the plate. It is silent otherwise and exits 0
without Node. /statechart's hand-off asks for the plate too, so the chain
holds where hooks do not run.

README, docs/reference, poteto-help and the verifier registry list the
skill. The version stamp moves to 1.16.0-adam.20261102 in the three
manifests and UPSTREAM.md; CHANGES.md, FORK.md, NOTICE.md and the UPSTREAM.md
ledger record the addition.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018K2CamEQdNUQF8dFWpj3V8
…-runtime

The coverage test walks every tracked plugin file and fails closed on one the
registry does not place. The new skill's example chart and its eval prompts
change no runtime behaviour, so they join nonRuntime beside the docs and the
test files.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018K2CamEQdNUQF8dFWpj3V8
@fitziboy3-source
fitziboy3-source marked this pull request as ready for review November 2, 2026 01:25
@fitziboy3-source
fitziboy3-source merged commit 2a0c402 into adam/release Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant