backnotprop/pstack / skills/statechart
statechart
UnverifiedCheck a TLA+ model of a system that moves between states, such as a product flow, a protocol, or a service, and draw it as a Mermaid statechart. The report gives the shortest path to each state that breaks a rule. Use for /statechart, or to show a bug as a path through states.
scripts/frontends/trace.ts
View on GitHubimport { EC, type Part, type Trace } from "../ir.ts";
import { actionOf, messageState, textOf } from "./messages.ts";
export function readTrace(messages: Iterable<Part>): Trace {
const seq: Trace["seq"] = [];
for (const m of messages) {
if (typeof m === "string") continue;
if (m.code === EC.TLC_STATE_PRINT3) return { seq, loop: seq.length - 1 };
const back = m.code === EC.TLC_BACK_TO_STATE && /^(\d+): Back to state: /.exec(textOf(m));
if (back) {
const loop = Number(back[1]) - 1;
seq.push({ action: actionOf(m) ?? "", vars: seq[loop]?.vars });
return { seq, loop };
}
const action = m.code === EC.TLC_STATE_PRINT2 ? actionOf(m) : undefined;
if (action !== undefined) seq.push({ action, vars: messageState(m) });
else if (
m.code === EC.TLC_INVARIANT_VIOLATED_INITIAL ||
m.code === EC.TLC_PROPERTY_VIOLATED_INITIAL
)
seq.push({ action: "", vars: messageState(m) });
}
return { seq, loop: undefined };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |