tlaplus-systems-engineer

Specify and verify concurrent and distributed systems with TLA+, PlusCal, TLC, Apalache, and TLAPS.

3|Updated Apr 8, 2025
One-click install
npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill tlaplus-systems-engineer-zanzythebar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tlaplus-systems-engineer
Source: https://github.com/ZanzyTHEbar/dragonarchy/tree/main/packages/opencode/.config/opencode/skills/tlaplus-systems-engineer
Command: npx skills add https://github.com/ZanzyTHEbar/dragonarchy --skill tlaplus-systems-engineer-zanzythebar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Concurrent, distributed, and agentic systems fail in subtle interleavings that testing rarely catches. This Skill turns requirements, pseudocode, or source code into abstract TLA+/PlusCal models so you can verify safety invariants and liveness properties before writing production code. ## Core Features & Use Cases - Formal Modeling: Builds state-machine specifications with Init, named sub-actions, Next, TypeOK, safety invariants, and fairness constraints in TLA+ or PlusCal. - Verification Workflow: Runs TLC for exhaustive finite-state checking and simulation, escalates to Apalache for symbolic bounded checking, and uses TLAPS for proofs beyond finite instances. - Counterexample Analysis: Interprets TLC traces as design bugs, missing assumptions, or over-strong properties, and applies minimal fixes. - State-Space Explosion Control: Shrinks constants, replaces sequences with sets, adds symmetry, and splits oversized actions with program counters. - Use Case: Model a multi-agent coding workflow with a planner, executor, human approval gate, and fallible tool calls, then prove no file is committed without validation before implementing it. ## Quick Start Ask the assistant to model your concurrent or agentic workflow as a small TLA+ or PlusCal spec with bounded constants and check its safety invariants with TLC.

Frequently Asked Questions about tlaplus-systems-engineer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I model a concurrent system in TLA+?

Identify actors, shared state, environment actions, and safety invariants, then write TypeOK, Init, named sub-actions, and Next composed from them. Start with the smallest useful model, such as two agents and a bounded queue, and run TLC before adding liveness.

When should I use PlusCal vs raw TLA+?

Use PlusCal for algorithmic workflows with loops, retries, and process-local control flow, since it generates pc states automatically. Use raw TLA+ for declarative protocols, relation-heavy state, or highly abstract specifications not tied to program-like control flow.

TLC vs Apalache vs TLAPS: which checker should I use?

Use TLC for finite explicit-state bug hunting and invariant checking, and TLC simulation when the space is too large for exhaustive search. Use Apalache for bounded symbolic checking of arithmetic-heavy models, and TLAPS when properties must be proved beyond any finite instance.

How do I fix TLA+ state-space explosion in TLC?

Shrink constants and domains, replace payloads with symbolic tags, use sets instead of sequences when order is irrelevant, and split oversized actions with a program counter. Add symmetry or state constraints only after the model itself is clean, then consider simulation or Apalache.

Can TLA+ model LLM agents and tool calls?

Yes. Model the LLM as bounded nondeterminism over a finite set of decisions, and represent tools, approvals, and message failures as explicit environment actions. Avoid modeling prompt text; capture control state, tool state, and approval state instead.

Why does my TLA+ liveness property fail without fairness?

Without fairness assumptions, infinite stuttering is allowed, so eventual progress cannot be guaranteed. Add weak or strong fairness to specific sub-actions only after safety is stable, and only when the real system justifies the scheduling assumption.