backnotprop/pstack / skills/statechart
statechart
VerifiedCheck 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/backends/cfg.ts
View on GitHubimport { CHART_STATES, type ConfigSection, RERUN_STATES, type Spec } from "../ir.ts";
export function configText(sections: ConfigSection[], extra: string[]) {
const lines: string[] = [];
for (const s of sections) lines.push(`${s.key} ${s.tokens.join(" ")}`);
lines.push(...extra);
return lines.join("\n");
}
export const boundRun = (module: string) =>
[
`---- MODULE ChartBound ----`,
`EXTENDS ${module}`,
`ChartTLC == INSTANCE TLC`,
`ChartNaturals == INSTANCE Naturals`,
`ChartBound == ChartNaturals!<(ChartTLC!TLCGet("distinct"), ${RERUN_STATES})`,
`====`,
].join("\n");
export function chartRun({ module, variables, invariants }: Spec, tag: string) {
const every: string[] = [];
for (const name of invariants) every.push(`(IF ~${name} THEN {"${name}"} ELSE {}) \\cup `);
return [
`---- MODULE ChartRun ----`,
`EXTENDS ${module}`,
`ChartTLC == INSTANCE TLC`,
`ChartNaturals == INSTANCE Naturals`,
`ChartBudget == ChartNaturals!<=(ChartTLC!TLCGet("distinct"), ${CHART_STATES})`,
`ChartBroken == ${every.join("")}{}`,
`ChartMark == ChartBroken = {} \\/ ChartTLC!PrintT(<<"${tag}", <<${variables.join(", ")}>>, ChartBroken>>)`,
`====`,
].join("\n");
}
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: 193k | 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: 193k | 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: 193k | Updated | Claude CodeCodex | Verified | Install |