tlaplus-spec-generator

tlaplus-spec-generator is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 118 tokens per session (2,176 once invoked), scanned A, original, Apache-2.0.

A generator that converts C, C++, or Python implementations into TLA+ models for formal verification. It identifies state variables, actions, and system structure, then writes a TLA+ module.

In plain words
What is it for?
Create TLA+ specifications from source files, including models of distributed systems, consensus protocols, and concurrent algorithms.
Why use it?
It helps teams examine whether an existing distributed or concurrent program follows its intended behavior before relying on informal reasoning alone.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Create TLA+ specifications from source files, including models of distributed systems, consensus protocols, and concurrent algorithms.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/arabelatso/skills-4-se/tlaplus-spec-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ArabelaTso/Skills-4-SE --skill tlaplus-spec-generator
Clone the repo
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tlaplus-spec-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/tlaplus-spec-generator/github.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/tlaplus-spec-generator)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/tlaplus-spec-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/tlaplus-spec-generator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tlaplus-spec-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/tlaplus-spec-generator"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/tlaplus-spec-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,176 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00118 $0.02176
Opus 5 $0.00059 $0.01088
Sonnet 5 $0.00024 $0.00435
Haiku 4.5 $0.00012 $0.00218

Measured 9d ago against content hash b87054317091, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

tlaplus-spec-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/generate_spec.py, scripts/program_analyzer.py, scripts/tlaplus_generator.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tlaplus-spec-generator/SKILL.md · 308 lines

How it starts

The opening of the file, as written. The whole thing — 308 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TLA+ Spec Generator

Automatically generate TLA+ specifications from program implementations for formal verification of distributed systems.

Overview

This skill transforms imperative programs (C/C++, Python) into declarative TLA+ specifications. It analyzes program structure to identify state variables, actions, and system behavior, then generates well-structured TLA+ modules suitable for model checking with TLC.

Workflow

1. Analyze Source Code

Generate TLA+ specification from source files:

# Single file
python3 scripts/generate_spec.py program.py -o Spec.tla

# Multiple files
python3 scripts/generate_spec.py server.py client.py protocol.py -o Protocol.tla

# With module name
python3 scripts/generate_spec.py distributed_system.c -o System.tla --module-name DistributedSystem

The generator automatically:

  • Detects programming language
  • Parses source code
  • Identifies state variables and actions
  • Extracts system structure
  • Generates TLA+ specification

2. Specify System Parameters

For distributed systems, specify the number of processes:

python3 scripts/generate_spec.py consensus.py -o Consensus.tla --processes 3

This creates a constant N in the TLA+ spec representing the number of processes/nodes.

3. Generated Output

The generator produces two files:

1. Spec.tla - Complete TLA+ specification:

---- MODULE Spec ----
EXTENDS Naturals, Sequences, FiniteSets, TLC

CONSTANTS N  \* Number of processes

VARIABLES
  state,
  messages,
  committed

vars == <<state, messages, committed>>

TypeOK ==
  /\ state \in [1..N -> {"Init", "Working", "Done"}]
  /\ messages \in SUBSET Messages
  /\ committed \in SUBSET Operations

Init ==
  /\ state = [p \in 1..N |-> "Init"]
  /\ messages = {}
  /\ committed = {}

SendMessage(p, msg) ==
  /\ state[p] = "Working"
  /\ messages' = messages \cup {msg}
  /\ UNCHANGED <<state, committed>>

Next ==
  \/ \E p \in 1..N, msg \in Messages : SendMessage(p, msg)

Spec == Init /\ [][Next]_vars

====

Read the full file on GitHub · 308 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 308 lines · 118 tokens per session scan A b87054317091

Subscribe to this mod's changes

tlaplus-spec-generator is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (252 stars, last pushed 22d ago), licensed Apache-2.0. It adds 118 tokens to every session and 2,176 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

python

Use when writing, reviewing, or modernizing Python 3.11+ code. Produces fully type-annotated modules, async I/O, dataclasses and protocols, pytest suites, and a lint/type gate built on ruff and mypy --strict.

nimadorostkar/Claude-Skills-collection · 55 tokens

locust

When the user wants to design, implement, debug, or operate Locust load tests in Python. Use when the user mentions "Locust," "HttpUser," "@task," "TaskSet," "locustfile.py," "master/worker," "Locust web UI," "FastHttpUser," "constantpacing," "waittime," or "locust -f -u -r --headless." For k6 see k6. For JMeter see…

aks-builds/quality-skills · 116 tokens

pytest

When the user wants to design, implement, debug, or optimize pytest tests in Python. Use when the user mentions "pytest," "pytest fixtures," "conftest.py," "pytest.ini," "pyproject.toml pytest section," "@pytest.fixture," "@pytest.mark.parametrize," "pytest-xdist," "pytest-asyncio," "pytest-cov," "monkeypatch,"…

aks-builds/quality-skills · 129 tokens

pytest-optimizer-00-scan

Use when starting or re-baselining a pytest optimization pass by profiling tests and fixtures without editing the suite.

tony/skills · 30 tokens

pytest

Provides comprehensive guidance for pytest testing framework including test writing, fixtures, parametrization, mocking, and plugins. Use when the user asks about pytest, needs to write Python tests, use pytest fixtures, or configure pytest for Python projects.

Zephyrex21/claude-skills-vetted · 48 tokens

polars

High-performance DataFrame library for Python ETL, analytics, and pandas migration. Use for expression-based data manipulation with lazy query optimization, parallel execution, streaming out-of-core processing, Arrow interoperability, and optional GPU execution.

K-Dense-AI/scientific-agent-skills · 47 tokens