writing-tla-plus-specs

writing-tla-plus-specs is a skill for Claude Code, Codex from OutlineDriven/odin-claude-plugin. It costs 52 tokens per session (2,076 once invoked), scanned A, original, Apache-2.0.

A skill for writing formal models of distributed protocols, concurrent algorithms, and system designs in TLA+ or Alloy. These models describe possible states and actions so tools such as TLC or Apalache can check stated safety and liveness properties.

In plain words
What is it for?
Use it to create model and configuration files, run bounded checks, and interpret failures for concurrent or distributed designs.
Why use it?
It can reveal design defects and produce counterexample traces showing how a property fails, rather than relying only on ordinary tests or inspection.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the odin-formal plugin — 9 skills shipped together

Good fit Use it to create model and configuration files, run bounded checks, and interpret failures for concurrent or distributed designs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs
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 OutlineDriven/odin-claude-plugin --skill writing-tla-plus-specs
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/odin-claude-plugin

Made for: Claude Code, Codex.

Or install odin-formal, the plugin that ships this one along with the rest of its 9 skills.

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 writing-tla-plus-specs

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs/github.svg)](https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs/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 writing-tla-plus-specs

Your own site · 80×15
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/writing-tla-plus-specs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,076 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high YARA Match · line 3
    YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).
    Fix: Remove offensive tool references and exploit code. Legitimate agent skills should not contain penetration testing tools, exploit frameworks, or reconnaissance utilities.
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.00052 $0.02076
Opus 5 $0.00026 $0.01038
Sonnet 5 $0.00010 $0.00415
Haiku 4.5 $0.00005 $0.00208

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

Security

Grade A, and why

writing-tla-plus-specs 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 6d ago.

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.

plugins/odin-formal/skills/writing-tla-plus-specs/SKILL.md · 39 lines

How it starts

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

Writing TLA+ specs

Contract

Field Bound contract
Trigger A distributed protocol, concurrent algorithm, or system design needs an explicit-state or symbolic model check of its safety and liveness properties, or an existing TLC, Apalache, Quint, or Alloy run needs its counterexample read and acted on.
Authority Reversible local: writes .tla, .cfg, .qnt, and .als files and the tool output directories they produce; rollback is deleting those files. No remote mutation.
Side effect Spec and configuration files on disk, plus TLC's states directory and Apalache's _apalache-out directory.
Done Every named invariant and temporal property either passes under a recorded bound and configuration, or has a counterexample trace mapped to a named design defect.

Inputs

A description of the system: its state variables, the actions that change them, and the properties that must hold. The tool pins from the grounded set: tla2tools.jar v1.7.4 (stable; v1.8.0 is a pre-release and the old TLA+ Toolbox GUI is declared unmaintained, so use the tlaplus.vscode-ide extension or the command line), Apalache v0.62.2 (download apalache.zip or apalache.tgz from GitHub Releases), Alloy v6.2.0 (standalone .jar from alloytools.org), Quint 0.32.0 (install per https://quint-lang.org/docs/getting-started). A JVM is required for TLC, Apalache, and Alloy. Optional: a state-space bound, a ConstInit operator that bounds constants for Apalache, and a Quint spec when the author prefers its surface syntax.

Procedure

  1. Pick the engine. Use TLC when the model has a small finite instance and the properties include liveness. Use Apalache when constants are unbounded or the explicit state space is too large, and the properties are safety invariants or bounded temporal checks. Use Alloy when the question is about a data or relational structure rather than a protocol's steps; Alloy 6 adds always, eventually, after, before, until, and releases for temporal checks, and that mode requires NuSMV or nuXmv on PATH. Use Quint only as an alternate front end: it keeps TLA semantics and hands checking to Apalache or TLC through quint verify. Done when: one engine is named with the reason.
  2. Write the spec skeleton. In TLA+, declare CONSTANTS and VARIABLES, define Init, one operator per action, Next as their disjunction, Spec == Init /\ [][Next]_vars, and a TypeOK invariant that names the domain of every variable. Keep every action a conjunction of a guard and primed assignments. For Apalache, annotate every constant and variable with \* @type: T; (types Bool, Int, Str, Set(T), Seq(T), <<T1, T2>>, T1 -> T2, { f: T }) and run apalache-mc typecheck Spec.tla until it prints Type checker [OK]. In Alloy, declare sig and fact blocks, one pred per operation, and run p for N or check a for N commands; the scope keyword for bounds each signature. Done when: the spec parses and TypeOK holds in the initial state.
  3. State the properties. Safety goes in invariants: one operator per claim, named for the claim (NoDoubleSpend, not Inv1). Liveness goes in temporal formulas under a fairness assumption (WF_vars(Action) or SF_vars(Action)) in Spec; without fairness every liveness property fails on a stuttering behavior. Done when: every property in the design brief has an operator, and every liveness formula has the fairness it needs.
  4. Configure and run TLC. Write Spec.cfg with SPECIFICATION Spec, CONSTANTS Name = Value for each constant at a small instance (two or three processes first), INVARIANTS TypeOK NoDoubleSpend, and PROPERTIES Liveness. Run java -jar tla2tools.jar -config Spec.cfg -workers auto Spec.tla. Add -deadlock only when the spec models a terminating system and deadlock is not a defect; otherwise TLC treats a state with no successor as an error. Use -simulate num=1000 for a quick random pass before an exhaustive run, and -dfid N for depth-first search of a deep state space. Done when: TLC exits 0 with the state count recorded, or exits 11 (deadlock), 12 (invariant violation), or 13 (temporal property violation) with a trace.
  5. Read the TLC trace. The trace starts with Error: Invariant X is violated followed by State 1: through State n:, each listing every variable and the action that produced it. Read the last state first: the violated invariant names the variable that went wrong. Walk backward to the first action whose guard was too weak. Use -difftrace to print only changed variables, and -dumpTrace json trace.json to save the trace for a diff against the next run. Classify the cause as a spec bug (the action does not model the system), a property bug (the invariant is stronger than the design promises), or a design defect. Only the third is a finding for the design owner. Done when: the trace is classified and the defect or spec fix is written down.
  6. Scale with Apalache. When TLC cannot finish, run apalache-mc check --inv=NoDoubleSpend --length=10 Spec.tla; --length bounds the number of steps and defaults to 10. Bound constants with --cinit=ConstInit where ConstInit == N \in 2..5. Check an inductive invariant with two runs: --init=IndInv --inv=IndInv --length=0 proves the initial state satisfies it, and --init=IndInv --next=Next --inv=IndInv --length=1 proves every step preserves it. Counterexamples land in _apalache-out/ (override with --out-dir) as counterexample1.tla; --max-error=N collects up to N of them. Switch the backend with --smt-solver=cvc5 when Z3 stalls. Done when: the property holds at the recorded bound, or the counterexample is classified as in step 5.
  7. Drive Quint when the spec is written in Quint. Run quint typecheck spec.qnt, then quint run spec.qnt --invariant=NoDoubleSpend --max-steps=20 --max-samples=10000 for random simulation, then quint verify spec.qnt --invariant=NoDoubleSpend --max-steps=10 for the Apalache-backed bounded check (--backend=tlc selects TLC). quint run prints [violation] with the trace on failure; --out-itf writes the trace as an ITF file. Done when: the same property classification as step 5 is recorded.
  8. Record the result. State the tool, version, configuration, bound, state count or step length, and wall time beside each property. A property checked at three processes and depth 10 is proven at that instance and nothing more; write the bound next to the claim. Done when: every property line in the output carries its bound.

Read the full file on GitHub · 39 lines

Files

What ships with it

1 file 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. 6d ago First seen · 39 lines · 52 tokens per session scan A a6f75803be30

Subscribe to this mod's changes

writing-tla-plus-specs is a skill published in the GitHub repository OutlineDriven/odin-claude-plugin (36 stars, last pushed 3d ago), licensed Apache-2.0. It adds 52 tokens to every session and 2,076 once invoked, about $0.0003 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-06.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens