/hunch:statechartfrom hunch
Models flows, protocols, retry loops, and state machines in TLA+, checks rules with the everystate model checker, and charts the shortest path to each broken rule.
Ships in hunch. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The chart shows how a system moves between states, in the words of its reader: the person who decides whether the behavior is right.
Pick the promise whose break harms users most and that tests rarely reach: the strongest one in the code, never the easiest to model. Read the code for it; ask the user only what the code cannot show.
Name the question before the tool:
| The question | The tool |
|---|---|
| Can events happen in a bad order? | A model checker: this skill |
| Does the code hold for every input? | A verifier that runs on the code; with none for its language, generated inputs on the real code |
| Does it hold at every size, past any bound? | A proof |
A question that is not about order → say which kind it is and stop; sound:find picks the tool.
Write SPEC.tla and SPEC.cfg in a scratch folder, or beside the code they cover when the project keeps them.
\* path:line comment. What the code does in one indivisible step is one action; two steps are two.\* covers: and \* synced:, so a later change to them shows the model may be stale.Next is a disjunction of named actions, Pay \/ Decline, so each step has a name.Done == phase \in {"paid", "failed"} /\ UNCHANGED vars.A module that exports:
state(vars): the reader's words for a state, such as "Paying" or "Lease held, write pending", never a variable name. A set arrives as an array; a sequence, record or function as an object keyed by its domain, so v.pc[1] is pc[1].step(action, from, to): the step as the reader sees it happen, such as "you press pay", or null to hide it. A step that happens only in some conditions ends with them in brackets, in the reader's words: you press play [while the file loads]. Two actions that end the same share a label, and so an arrow.title.Aim for about 20 arrows. First give one label to states that act the same; never one label to states that break different rules. Then hide steps the reader does not need, such as a reset every state has. Hiding keeps every state reachable from a start, one arrow out of each state that has a step out, and all of an arrow or none.
bun ${CLAUDE_SKILL_DIR}/scripts/statechart.ts SPEC.tla --view view.ts --out <folder>
It runs everystate, a TLC-compatible model checker, through bunx, so it needs only bun.
It checks each rule in its own run, so one break hides no other rule's verdict, and gives the shortest path to each rule that breaks. It refuses a spec or config everystate cannot read, and a view that would make the chart claim what the model does not do; the message says what to change. Above 500 states it draws only the paths to broken rules. It exits 0 when every rule holds, 1 when one breaks, 2 when it refuses.
Before trusting a pass, break the promise in the real code on a scratch change, such as a removed guard or two steps swapped. Update the model as the code now reads and rerun: a rule must break. Drop the change and rerun: the verdicts are back where they started. A check never seen failing proves nothing.
Diff the covered files from the sync commit, and read each commit message. Sort each change:
Rerun, then give each check one outcome: in sync, updated, bug, or blocked and why. Move the sync commit only once the model describes the code at the new commit.
Show chart.mmd where Mermaid draws: a Pad, a doc, a pull request. Then one line per bug: the rule, the reader's sentence for it, and its path as report.md numbers it. Say what the model leaves out and which steps the chart hides, and give the command that makes the files again.
When the model describes code, replay each bug path against the real code, one step per action, as a test or a live repro. A path that does not replay means the model is wrong until shown otherwise.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tla-plus, model-checking, state-machines, formal-verification
npx claudepluginhub saadshahd/moo.md --plugin hunch7 skills in this plugin
/complainSurfaces what the agent would change and kept to itself — a decision it would make differently, effort it saw wasted, a better route to the goal, a fact the user lacks, friction in the tools, permissions, setup or docs the work ran on, the cheap always-on signal that would have shown at first look a cause the work dug deep for. Use when you hold one of these and have not said it./cross-checkHave the agents behind rival answers to one question check each other's answers, then pick on the evidence. Use when independent answers to one question disagree, or would, and no test, file or run can settle which is right, or when one attempt at an artifact would lock in its shape./dreamCheck this project's memory notes against the repo, fix the ones that went false, and tidy the index, as one git commit you can revert. Checks only notes that are new or name a changed file; pass `all` to check every note. Costs one Sonnet call per 15 notes, plus one./flyFly one thought to its destination across concurrent agents, on whatever the project and harness already have. Lands only when the user has accounted for every detail, never on an agent's say-so./harvestReport where a session missed moo's standard — the agent asks only while stating intent and shape, then works on its own — as issues a builder can act on. Pass a session id to report on a past session instead of this one./smoothCount what slowed the agents down in this project, from their transcripts, the commits the person reverted and their review comments, over the last day, week or month (default day), and leave one fix for the friction that recurred most, on a smooth/<date> branch you keep or drop. Run it nightly from a scheduled task. Costs one Sonnet call on a day with a fix, none otherwise.Other plugins' skills for the same job