statechart

statechart is a skill for Claude Code from chhoumann/t3-pstack. It costs 74 tokens per session (3,802 once invoked), scanned A, original, MIT.

A diagram tool that turns a TLA+ model or an agreed behavior chart into a Mermaid statechart. TLA+ is a language for describing and checking how systems behave; Mermaid is a text format for diagrams.

In plain words
What is it for?
It helps review application behavior, show a bug to a product manager, compare code with a TLA+ model, and create a starting model from an agreed chart.
Why use it?
It gives developers and product managers a shared view of what users see, including paths where the model finds bugs and whether those states are fixed.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Part of the t3-pstack plugin — 67 skills, 4 agents, 1 hook shipped together

Good fit It helps review application behavior, show a bug to a product manager, compare code with a TLA+ model, and create a starting model from an agreed chart.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chhoumann/t3-pstack/statechart
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add chhoumann/t3-pstack --skill statechart
Clone the repo
git clone --depth 1 https://github.com/chhoumann/t3-pstack

Made for: Claude Code.

Or install t3-pstack, the plugin that ships this one along with the rest of its 67 skills, 4 agents, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for statechart

README.md
[![agentmods](https://agentmods.dev/badge/skills/chhoumann/t3-pstack/statechart/github.svg)](https://agentmods.dev/skills/chhoumann/t3-pstack/statechart)
Your own site
<a href="https://agentmods.dev/skills/chhoumann/t3-pstack/statechart"><img src="https://agentmods.dev/badge/skills/chhoumann/t3-pstack/statechart/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for statechart

Your own site · 80×15
<a href="https://agentmods.dev/skills/chhoumann/t3-pstack/statechart"><img src="https://agentmods.dev/badge/skills/chhoumann/t3-pstack/statechart.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,802 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.03802
Opus 5.5 $0.00030 $0.01521
Sonnet 5.5 $0.00015 $0.00760
Haiku 4.5 $0.00007 $0.00380

Measured today against content hash b43d453c3ce1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

statechart scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

The scan reads SKILL.md. This mod also ships 52 executable files (scripts/backends/cfg.ts, scripts/backends/mermaid.ts, scripts/backends/plain-text.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/pstack/skills/statechart/SKILL.md · 139 lines

How it starts

The opening of the file, as written. The whole thing — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Statechart

The chart shows how a TLA+ system moves between states or how a Lean 4 theorem is proved, in the words of the operator who must decide whether the behavior or proof is right.

Run

scripts/statechart.ts is TypeScript, so run it with a runtime that executes TypeScript. scripts/statechart is a POSIX shell script that picks Node 22.18 to 22.x, Node 23.6 or later, Bun 1.1.5 or later, or Deno 2.0 or later. On native Windows, run node --disable-warning=ExperimentalWarning <skill dir>/scripts/statechart.ts with Node 22.18 to 22.x, or Node 23.6 or later.

The CLI auto-dispatches on the first positional argument.

TLA+ models

Work in a scratch folder outside the repo. Write a TLA+ spec and its config. Then run:

<skill dir>/scripts/statechart SPEC.tla [--config FILE] [--view FILE] [--out DIR]

The first TLA+ run installs TLC and Java with mise and needs the network. --tactics applies only to .lean files and exits 2 on .tla inputs.

Lean 4 proofs

Run against any .lean file pinned to Lean v4.34.1 (or a standalone .lean file with no lean-toolchain):

<skill dir>/scripts/statechart FILE.lean THEOREM [--view FILE] [--tactics] [--out DIR]
  • THEOREM accepts a full declaration name or a unique dotted suffix in FILE.lean. Unsafe declarations and non-theorem definitions exit 2.
  • Pass --out to a scratch folder outside the repo so generated charts stay out of your checkout. Without --out, the output goes to <short-theorem>-proof beside FILE.lean. The folder must be new or empty.
  • --view FILE applies a plain-English view module to lemmas.mmd and proof.mmd.
  • --tactics adds raw Lean tactic lines back inside proof.mmd boxes for Lean authors. Without it, boxes show claims, new local assumptions, invoked lemmas, and proof outcomes, while report.md keeps the full hypotheses and tactic scripts.
  • --config applies only to TLA+ specs and exits 2 on .lean inputs.
  • Toolchain lookup checks LEAN_SYSROOT, then lean and lake on PATH from the package root, then a pinned mise http:lean install for v4.34.1. Every resolved binary must report v4.34.1; any other pin or binary version exits 2.
  • Interactive runs call lake setup-file in place, which writes the gitignored .lake/ folder and may create lake-manifest.json if the package has none. Tests copy packages into temporary folders so the checkout stays clean.

Read the full file on GitHub · 139 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +56 lines · +4 tokens per session b43d453c3ce1
  2. 9d ago Changed ca7b3e43b1dd
  3. 1mo ago Changed · +46 lines · -12 tokens per session 010b7b453240
  4. 1mo ago Changed · +8 tokens per session b1c544782b15
  5. 1mo ago Changed 9b2a6dccf862
  6. 1mo ago First seen · 37 lines · 74 tokens per session scan A ad01133b5578

Subscribe to this mod's changes

statechart is a skill published in the GitHub repository chhoumann/t3-pstack (347 stars, last pushed today), licensed MIT. It adds 74 tokens to every session and 3,802 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-22.

Related

statechart compared with skills from other repositories

statechart next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
statechartchhoumann/t3-pstackSkill347todayMITA74Claude Code
systematic-debuggingopen-metadata/OpenMetadataSkill16ktodayApache-2.0A37Claude Code
log-error-digestzebbern/claude-code-guideSkill4.7k4d agoMITA71Claude Code, Codex
observability-audit-sessionsIBM/mcp-context-forgeSkill4.9k2d agoApache-2.0A64Claude Code, Codex
cwv-optimizeradobe/skillsSkill339todayApache-2.0A112Claude Code
ci-fixersipyourdrink-ltd/bernsteinSkill1.2ktodayApache-2.0A15Claude Code, Codex
triaging-web-analytics-supportPostHog/posthogSkill41ktodaynoneA151Claude Code, Codex