CtrlK
BlogDocsLog inGet started
Tessl Logo
PluginPublic

statelyai/stately

Find implicit state machines, review state bugs, and check or visualize statecharts with Stately.

Quality

95%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

compatibility.mdreferences/

Statechart compatibility contract

Stately covers every workflow capability of the pstack statechart engine it vendors, plus native report/playback, source freshness, guarded rechecking, and separate application evidence. No installed pstack, mise, or XState migration is needed. This is a versioned feature/behavior contract, not a claim that extra artifact generation always runs faster or that a finite model proves application code.

Vendored engine version

  • Engine: Lauren Tan's MIT-licensed pstack /statechart checking engine (upstream repository). See Credits.
  • Vendored commit: the 28 runtime files in scripts/engine/ are pinned to the official source at cursor/plugins@0b46ec39, which is pstack release 0.15.46. That release includes the CRLF and native Windows changes first made in Michael Denyer's Claude port and the fixes from cursor/plugins@bf0c7cd8.
  • Parity: scripts/check-stately-engine.mjs compares file hashes against commit 0b46ec39, not against the latest pstack release. A newer pstack release is not vendored until its delta is reviewed as described below.
  • Local edits: listed with their hashes in scripts/engine/upstream.json: frontends/spec.ts and ir.ts expose loaded SANY module names, and pipeline.ts returns resolved projection labels (metadata only). Checker and verdict algorithms are unchanged.
Statechart capabilityStately coverage
Existing/new finite TLA+, any application frameworkOwned checker and modeling guide
Safety, temporal properties/fairness, deadlocks, constraints, multiple rulesSame pinned TLC flags and checking engine; complete regression corpus
Independent outcomes, shortest safety paths, lasso/stutter witnesses, rerun boundsSame verdict/path algorithms; complete JSON and native variable playback
Typed TLA values and default labelsSame typed default projection; model-value/string distinction regression
Custom state/step/group/colors/title, hierarchy, parallel regions, hidden/conditional stepsSame projection/Mermaid backends; explicit coarsening limits
500-state charts and 100000-state rerunsSame budgets; explicit summary-only native fallback
Markdown, Mermaid, numbered paths, raw/per-rule TLC outputOriginal compact report plus complete scoped report and original artifacts
Portable SVG with failure/path/loop classes and light/dark themesOwned lazy pinned Pele renderer; rendering guide
Node/Bun/Deno minimums; Linux/macOS/Windows lifecycleShell/native PowerShell launchers; installed-ZIP real TLC matrix
CRLF TLC outputNormalized message markers; real TLC CRLF regression
SPEC.tla, --config, --view, --out, equals syntax, options first, --Owned CLI; omitted output defaults to SPEC-chart; check remains optional
Refuse overwrites; signal/parent-death cleanupOwned supervisor/registered worker, including provisioning and installer-stage cleanup
Replay bugs against existing application; expose modeling uncertaintyRequired workflow; application observations recorded independently
Pair with create/maintain-formal-verification skillsOptional pairing; preserve other proof backends

Earlier statechart releases

Earlier pstack statechart releases (October 2026) had commands and flags that the current release dropped. Each maps to a Stately workflow:

Earlier statechart capabilityStately coverage
from-spec: chart from a TLA+ modelCheck invariants, native or TLA+, saved as a native view
from-chart: agreed chart to TLA+ skeleton, then diff against codeAgreed model and code model, both checked with the same rules (model-authoring.md); the agreed model is a Stately machine checked natively, so no TLA+ skeleton step is needed; diff_machines compares them
--against / --against-config: audit a code model against an existing specSame agreed-versus-code workflow; the existing spec keeps its rules and config
--fixed: proposed fix in the same chartCheck a fix and stately-check compare, rule by rule, with counterexample replay
--pngStately view link for every run; render SVG on request
--cover: shortest paths to settled states plus bug pathsstately-check view --trace selection and the native summary-only view, every verdict kept
state, step, group, cause, readerActions labelsDomain-language labels in the model and report; TLA+ runs keep the same view module
--expect-broken goal rulesNative reachable rule kind, reported as reachable, not as a bug
Settled == ~ENABLED System rulesNative eventually and eventually-always rule kinds
stories.mdcompact-report.md, report.md, and the domain-language explanation
Counts only from summary.jsonCounts only from check-report.json or report.md
No "holds" while conditions lack file and lineCitations on guards and conditions; the report lists uncited conditions, and "holds" names them as unconfirmed
One model step per indivisible code stepSame rule in model-authoring.md

The implicit state machines prompt

The prompt "find all of the implicit state machines in my app" (Steve Ruiz, October 2025) and its variants ask a model to list hidden state machines. Each part maps to a stronger Stately workflow:

Prompt outcomeStately coverage
A list of implicit machinesArea inventory and full sweep with a coverage record (implicit-machines.md); every candidate ranked, none dropped
States and transitions of each machineInventory document with a transition table citing path:line, updated in place on re-runs
Possible bugsTwelve state bug kinds, absence checks, and the evidence format with a re-trace (state-bugs.md)
DiagramsA Stately link per candidate, in rank order
Refactor suggestionsMake a machine explicit: tests first, XState v6, replaced flags deleted, the real machine checked with the same rules
Confidence that a fix worksCheck a fix and an application replay
Review of new changesReview a change for state bugs, benchmarked in the evaluation results
Fewer implicit machines laterThe repository rule in Prevent new implicit machines

Maintain the contract

scripts/engine/upstream.json records all 28 upstream runtime source hashes at the exact upstream commit, plus the three local label/module-provenance adaptations. Record every future edit under scripts/engine/ in upstream.json and in Vendored engine version. Packaging omits unused legacy launchers and the development corpus; the owned runtime needs neither.

Repository checks run the source lock before checker/workflow tests. To audit a new upstream checkout without making it a runtime dependency:

node scripts/check-stately-engine.mjs --upstream /path/to/statechart/scripts
pnpm test:skill
pnpm test:plugin

An added, missing, or changed runtime file fails the source check. Review every upstream delta, update the explicit adaptation record, and add behavior cases before changing the baseline. Source equality complements actual TLC and installed-package checks; it does not replace them. Record executed platforms and test receipts in the repository's evaluation results.

Credits

The TLA+ checking engine behind /stately is Lauren Tan's pstack /statechart skill and engine, released under the MIT License. Its TLC integration, verdict and path algorithms, projection, Mermaid output, report format, and regression corpus are her work, and Stately builds on them directly.

Thank you, Lauren, for making this engine open and for the care that went into its regression corpus.

.mcp.json

LICENSE

README.md

SKILL.md

tile.json