By richashworth
Hide TLA+ formal verification behind a conversational interface. Specialist agents extract, specify, review, verify, and test stateful system designs without exposing formal notation.
Reads source code to identify stateful and concurrent patterns — state machines, shared resources, locks, queues, lifecycle management, distributed protocols. Produces a draft structured summary (entities + transitions) that can bootstrap the specification process.
Reviews a TLA+ spec against its structured summary for requirement coverage and semantic accuracy. Back-translates the spec into plain language and flags mismatches between what the spec does and what the summary requires.
Translates a structured system summary into a formal TLA+ spec (.tla) and model-checking config (.cfg). Takes entities, transitions, constraints, and concurrency rules and produces a complete, verifiable specification.
Generates or updates implementation tests based on a verified TLA+ spec and structured summary. Reads the spec, the existing test suite, and the implementation code, then produces tests that close coverage gaps — property-based tests for invariants, state transition tests for action sequences, regression tests from counterexample traces, and boundary tests from type constraints.
Runs the TLC model checker against TLA+ specifications and translates results to plain language. Verifies safety invariants, detects deadlocks, checks liveness properties, and presents violations as concrete step-by-step scenarios.
Modifies files
Hook triggers on file write and edit operations
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
A Claude Code plugin for formal verification without learning TLA+. Describe your system through conversation (or point at code), and get back a verified TLA+ spec with results presented narratively.
Install the plugin once — it's then available in every project you open with Claude Code.
git clone https://github.com/richashworth/tlaplus-workflow ~/.claude/plugins/tlaplus-workflow
The tlaplus-mcp MCP server is installed automatically via npx when the plugin is used. It handles TLC/SANY toolchain management.
Open Claude Code in your project directory and run the skill:
cd your-project/
claude
> /tlaplus-workflow
Or point it at specific code to bootstrap from:
> /tlaplus-workflow src/booking/
Specs are written into your project (default: specs/). No configuration needed.
/tlaplus-workflow
Walks you through describing your system — entities, states, transitions, constraints, concurrency, edge cases. Then: generate spec → verify → results.
/tlaplus-workflow src/booking/
Scans your code for stateful patterns (state machines, locks, queues, shared resources), pre-fills the interview with what it finds, then asks you to confirm and fill gaps. When implementation details are found (transaction boundaries, concurrency primitives), the spec models operations at that granularity.
/tlaplus-workflow summary.md
Skip the interview — go straight to: generate spec → verify.
/tlaplus-workflow
↓ interview (or bootstrap from code)
↓ specifier agent → .tla + .cfg
↓ reviewer agent → coverage + semantic check
↓ verifier agent → TLC check + state graph
↓ results presented narratively in conversation
↓ violations? → discuss, fix, refine
↓ optionally: generate implementation tests from spec
Already have a spec? Just ask Claude directly — it picks the right agent:
"Verify specs/LockManager.tla" # Runs the verifier agent
Specialist workers invoked by the skill or used standalone. They contain all the domain expertise.
| Agent | Role |
|---|---|
| extractor | Scans source code for stateful/concurrent patterns. Produces a draft structured summary. |
| specifier | Translates a structured summary into a TLA+ module (.tla) and TLC config (.cfg). |
| reviewer | Reviews a spec against its structured summary for coverage gaps and semantic mismatches. |
| verifier | Runs TLC, parses output, translates counterexamples to plain-language bug reports. |
| test-gen | Generates or updates implementation tests from a verified spec — PBTs, state transition tests, boundary tests. |
A SANY syntax check runs automatically whenever a .tla file is written or edited, catching syntax errors immediately.
The pipeline asks where to store spec files on first run (default: specs/). If the project already has a directory with .tla files, it reuses that automatically.
specs/ # (or .tlaplus/, or custom path)
LockManager.tla # TLA+ specification
LockManager.cfg # TLC model-checking config
LockManager/ # Derived artifacts
states.dot # TLC state graph dump (DOT format)
tlc-output.txt # Captured TLC stdout/stderr
state-graph.json # Parsed state graph (structured JSON)
traces.md # Mermaid sequence diagrams for violation traces
For interactive state-space exploration, load the spec in Spectacle.
The tlaplus-mcp MCP server is installed via npx from npm on first use and auto-downloads tla2tools.jar — no manual setup needed.
agents/
extractor.md # Code → draft structured summary
specifier.md # Structured summary → TLA+ spec
reviewer.md # Spec ↔ summary coverage + semantic check
verifier.md # TLC runner + narrative translator
test-gen.md # Verified spec → implementation tests
skills/
tlaplus-workflow/SKILL.md # Full pipeline: interview → specify → verify → results
hooks/
hooks.json # SANY syntax check on .tla writes
check-tla-syntax.sh # Hook implementation (uses tlaplus-mcp's jar)
npx claudepluginhub richashworth/tlaplus-workflow --plugin tlaplus-workflowTLA+ model checker as MCP tools — validate specs, list invariants, run checks, and replay counterexamples directly from Claude Code.
TLA+ skills for checking specs and writing proofs.
Verified Coherence Spec-Driven Development — adversarial quality gates for AI-assisted development
SPEC-First development workflow with TDD, Ralph Loop, and autonomous agent coordination for Claude Code
Spec-Driven Development: specifications compiled into executable, verifiable behavior
Formal methods and specification languages: UML/SysML modeling, TLA+ specifications, OpenAPI/AsyncAPI contract-first design, state machines, and Use Case 2.0 methodology.