pstack-statechart

pstack-statechart is a skill for Claude Code from dmae97/omk. It costs 87 tokens per session (1,779 once invoked), scanned A, a copy of statechart, MIT.

A diagramming tool that turns a TLA+ model—a formal description of how a system can behave—into a Mermaid statechart. It shows states, transitions, and numbered paths to states where a rule fails.

In plain words
What is it for?
Use it to map product flows, protocols, or services; trace a bug through its sequence of states; or turn an agreed design into a chart.
Why use it?
It makes system behavior and model-checking bugs easier to inspect than raw model output. A product manager, engineer, or reviewer can read the chart using familiar states and events.

Skill for Claude Code

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

Good fit Use it to map product flows, protocols, or services; trace a bug through its sequence of states; or turn an agreed design into a chart.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dmae97/omk/statechart
View source ↗ dmae97/omk
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 dmae97/omk --skill statechart
Clone the repo
git clone --depth 1 https://github.com/dmae97/omk

Made for: Claude Code.

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 pstack-statechart

README.md
[![agentmods](https://agentmods.dev/badge/skills/dmae97/omk/statechart/github.svg)](https://agentmods.dev/skills/dmae97/omk/statechart)
Your own site
<a href="https://agentmods.dev/skills/dmae97/omk/statechart"><img src="https://agentmods.dev/badge/skills/dmae97/omk/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 pstack-statechart

Your own site · 80×15
<a href="https://agentmods.dev/skills/dmae97/omk/statechart"><img src="https://agentmods.dev/badge/skills/dmae97/omk/statechart.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,779 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 94% copy Near-identical to another mod 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.00087 $0.01779
Opus 5.5 $0.00035 $0.00712
Sonnet 5.5 $0.00017 $0.00356
Haiku 4.5 $0.00009 $0.00178

Measured 15d ago against content hash 58921ea91ed5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pstack-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 15d ago.

The scan reads SKILL.md. This mod also ships 22 executable files (scripts/bug-states.mjs, scripts/chart-edges.mjs, scripts/chart-parts.mjs, …), 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.

Origin

This is a copy

94% identical to statechart — 85 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

packages/coding-agent/resources/pstack/skills/statechart/SKILL.md · 37 lines

How it starts

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

Statechart

The chart shows how a system moves between states, in the words of the person who reads it. The scripts call that person the reader, as in readerActions and reader steps. The reader decides whether the behavior is right. The reader can be a PM who reads a product flow, an engineer who reads a protocol or a service, or a reviewer who reads a design. Label each state with what the reader can observe or cares about, such as "Paying" in an app or "Lease held, write pending" in a lock service. Label each step with the event that moves the system, such as "tap Pay" in an app, "the request reads the count" in a service, or "the lease expires" in a lock service. Keep variable and action names out of labels.

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. The first run installs TLC and Java with mise, which downloads about 305 MB and needs the network. The help's TLC section tells how to use a TLC and Java that you have.

Pick the direction

Use from-spec when a TLA+ model exists, or when the code or design is concrete enough to model. Use from-chart when there is no model, and the people who own the behavior should agree on it before anyone builds or changes it.

If the code already has a TLA+ spec, start from a copy of that spec. Add the variables that the labels and rules need, 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 from variables that both have. A label that reads a variable that only the copy has must test "name" in v first, and label the spec's states another way. When a model describes code, 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.

Read the full file on GitHub · 37 lines

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. 15d ago First seen · 37 lines · 87 tokens per session scan A 58921ea91ed5

Subscribe to this mod's changes

pstack-statechart is a skill published in the GitHub repository dmae97/omk (152 stars, last pushed today), licensed MIT. It adds 87 tokens to every session and 1,779 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to statechart, differing in 85 lines, and is treated as a copy.

Related

pstack-statechart compared with skills from other repositories

pstack-statechart next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pstack-statechartdmae97/omkSkill152todayMITA87Claude Code
ci-triagecoo1white/cool-workflowSkill23d agoBSD-2-ClauseA66Claude Code, Codex
pr-reviewcoo1white/cool-workflowSkill23d agoBSD-2-ClauseA58Claude Code, Codex
codegraphQwenLM/qwen-codeSkill29ktodayApache-2.0A0Claude Code, Codex
stuckQwenLM/qwen-codeSkill29ktodayApache-2.0A57Claude Code
structured-debuggingQwenLM/qwen-codeSkill29ktodayApache-2.0A85Claude Code, Codex
memory-leak-debugQwenLM/qwen-codeSkill29ktodayApache-2.0A42Claude Code, Codex