Individual skill
statechart
Draw what an app's user sees as a Mermaid statechart from a TLA+ model. States are gray if they work, red if still wrong, and green if fixed. Each bug TLC finds is a numbered path. Use for /statechart, "show the PM the bug", or to turn an agreed chart into a TLA+ skeleton.
skills/statechart/SKILL.md
Source commit 79595c97d47b5400034fb985e67f1a00389a81af
What was checked
- Matches the observed repository HEAD
- Yes
- Scanner rules are current
- No
- Repository scan complete
- No
- Skill scan complete
- No
- Observed behavior
- Not checked yet
- Last checked
- Nov 6, 2026
These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.
Install this skill
Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.
An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.
Repository context
- Repository stars (not skill ratings)
- 22
- Repository last updated
- Nov 1, 2026
- License
- MIT
Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.
- agent-skills Repository topic
- ai-agents Repository topic
- claude-code Repository topic
- codex Repository topic
- coding-agents Repository topic
- cursor Repository topic
- pstack Repository topic
- cline Repository topic
- copilot Repository topic
- gemini Repository topic
- engineering Derived category
Files and excerpt
File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.
Browse files
SKILL.mdcore · 5,442 bytesSKILL.mdcore · 5,442 bytesSKILL.mdcore · 5,442 bytesscripts/chart-to-tla.mjsruns · 9,389 bytesscripts/compare-charts.mjsruns · 4,014 bytesscripts/lib.mjsruns · 32,461 bytesscripts/model/OutputFolder.cfgasset · 154 bytesscripts/model/OutputFolder.map.mjsruns · 3,866 bytesscripts/model/OutputFolder.tlaasset · 5,852 bytesscripts/statechart.mjsruns · 44,152 bytesscripts/test/statechart.test.mjsruns · 125,038 bytesscripts/test/sync.mmdasset · 597 bytesscripts/test/upload.mmdasset · 507 bytesscripts/tlc-to-chart.mjsruns · 59,940 bytes
Read excerpt
> Portable adaptation of Lauren Tan's pstack v0.15.30. Use available host capabilities and the fallbacks in PORTABILITY.md; do not claim unavailable tools, subagents, or runtime evidence.
# Statechart
The chart shows what an app's user sees. A PM reads it to decide whether that behavior is right. Label each state with what is on the screen, such as "Paying". Label each step with what the user does or sees happen, such as "tap Pay" or "the charge goes through". Keep variable and action names out of labels. The scripts call this user the reader, as in `readerActions` and reader steps.
Run `node <skill dir>/scripts/statechart.mjs --help` for the commands and for how to read a chart. Work in a scratch folder outside the repo. The command writes its files next to its input.
## Pick the direction
Use `from-spec` when a TLA+ model exists or the code is concrete enough to model. Use `from-chart` when there is no model and the PM should agree on the behavior before anyone writes or changes the code.
If the code already has a TLA+ spec, start from a copy of that spec. Add the variables the user sees, and keep the spec's existing invariants. To audit the code against that spec, make the copy model what the code does, and pass the spec unchanged as `--against`. Check it with the config that its authors say it passes, and pass that config as `--against-config` unless it has the spec's file name. One mapping labels both models, so label states and steps only from variables that both have. In a code model or a new spec, tie every variable and action to code that a reviewer can open, and take its name from that code. Make each action one indivisible step in the code. Put the file and line of the code that checks each condition of an action in a comment on that condition, as in `\* pay.ts:120`.