program-to-tlaplus-spec-generator

Generate TLA+ specifications from concurrent or distributed code.

1|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill program-to-tlaplus-spec-generator-santosomar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: program-to-tlaplus-spec-generator
Source: https://github.com/santosomar/general-secure-coding-agent-skills/tree/main/skills/verification/program-to-tlaplus-spec-generator
Command: npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill program-to-tlaplus-spec-generator-santosomar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you formally verify the correctness of concurrent or distributed code by automatically generating TLA+ specifications, enabling rigorous model checking.

Core Features & Use Cases

  • State Machine Modeling: Translates code constructs into TLA+ VARIABLES representing persistent state.
  • Action Identification: Defines atomic transitions in code as TLA+ actions for model checking.
  • Use Case: Use this when verifying concurrency properties of production code, designing a new protocol and wanting to check it before implementation, or when debugging a race condition and needing to prove a fix.

Quick Start

Generate a TLA+ specification from the provided Go-like code snippet.

Frequently Asked Questions about program-to-tlaplus-spec-generator

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

FAQPage Schema
How do I generate TLA+ specifications from concurrent code for formal verification?

To generate TLA+ specifications for formal verification, you provide concurrent or distributed code, which is abstracted into TLA+ state variables, actions, and fairness conditions for model checking.

What's the best way to model state machines for race condition debugging?

Modeling state machines for race condition debugging involves translating code constructs into TLA+ variables representing persistent state and defining atomic transitions as actions for rigorous model checking.

Can I use TLA+ model checking for pre-implementation protocol design?

Yes, you can use TLA+ model checking for pre-implementation protocol design by generating specifications that model concurrency properties, allowing you to verify correctness before writing production code.

Does formal verification with TLA+ work with distributed systems code?

Formal verification with TLA+ works with distributed systems code by abstracting concurrent operations into state machines and actions, enabling model checking of liveness and safety properties.

When do I need to abstract code into TLA+ state and action components?

You need to abstract code into TLA+ state and action components when translating concurrent or distributed code for model checking, ensuring persistent state and atomic transitions are correctly represented.

Why does model checking require defining fairness conditions in TLA+ specifications?

Model checking requires defining fairness conditions in TLA+ specifications to ensure that concurrent actions eventually progress, which is necessary for verifying liveness properties and proving race condition fixes.