tla-precheck

tla-precheck is a skill for Claude Code, Codex from Plazmodium/odin-workflow. It costs 46 tokens per session (1,539 once invoked), scanned A, original, MIT.

A design-verification tool that turns TypeScript state-machine definitions into TLA+ specifications and checks them with a model checker. A state machine describes allowed states, events, and transitions.

In plain words
What is it for?
Use it for lifecycle changes, shared-state updates, billing flows, distributed workflows, and other features where invariants must hold across all interleavings.
Why use it?
It checks whether important rules remain true across possible event orders, including concurrent operations that are difficult to cover with ordinary tests.

Skill for Claude CodeCodex

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

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.

agentmods
npx agentmods add skills/plazmodium/odin-workflow/tla-precheck
Any agent
npx skills add Plazmodium/odin-workflow --skill tla-precheck
Clone the repo
git clone --depth 1 https://github.com/Plazmodium/odin-workflow

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 tla-precheck

README.md
[![agentmods](https://agentmods.dev/badge/skills/plazmodium/odin-workflow/tla-precheck.svg)](https://agentmods.dev/skills/plazmodium/odin-workflow/tla-precheck)
Your own site
<a href="https://agentmods.dev/skills/plazmodium/odin-workflow/tla-precheck"><img src="https://agentmods.dev/badge/skills/plazmodium/odin-workflow/tla-precheck.svg" alt="Measured on agentmods" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,539 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00046 $0.01539
Opus 5 $0.00023 $0.00770
Sonnet 5 $0.00009 $0.00308
Haiku 4.5 $0.00005 $0.00154

Measured 5d ago against content hash 1b511bd0dd18, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

tla-precheck 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 5d 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.

agents/skills/architecture/tla-precheck/SKILL.md · 172 lines

How it starts

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

TLA+ PreCheck — Formal Design Verification

Overview

tla-precheck translates a TypeScript state machine DSL (.machine.ts) into TLA+ specifications, then runs the TLC model checker to exhaustively verify invariants and graph equivalence. Odin integrates it as an opt-in design verification step in the Architect → Guardian flow.

When to Use

Write a .machine.ts file when the feature involves:

  • Entity lifecycle management — status transitions, state machines with guard conditions
  • Concurrent operations on shared state — multiple actors mutating the same resource
  • Financial/billing state changes — charges, refunds, subscriptions where invariant violations cause real damage
  • Distributed workflow coordination — where guard conditions are scattered across files/services
  • Any invariant that must hold across all possible interleavings — not just the happy path

Complexity level (L1/L2/L3) is a secondary signal. Even a small L1 feature can contain a high-risk lifecycle invariant.

The .machine.ts DSL

A machine definition describes states, events, transitions, and invariants:

import { defineMachine } from 'tla-precheck';

export default defineMachine({
  moduleName: 'AgentRuns',

  constants: {
    Users: { type: 'set', values: ['u1', 'u2'] },
    MaxConcurrent: { type: 'number', value: 1 },
  },

  state: {
    runs: { type: 'map', keys: 'Users', values: ['idle', 'queued', 'running', 'completed'] },
  },

  init: {
    runs: { u1: 'idle', u2: 'idle' },
  },

  actions: {
    QueueRun: {
      guard: (s) => Object.values(s.runs).some((v) => v === 'idle'),
      update: (s) => {
        const user = Object.keys(s.runs).find((u) => s.runs[u] === 'idle')!;
        s.runs[user] = 'queued';
      },
    },
    StartRun: {
      guard: (s) => {
        const running = Object.values(s.runs).filter((v) => v === 'running').length;
        return running < MaxConcurrent && Object.values(s.runs).some((v) => v === 'queued');
      },
      update: (s) => {
        const user = Object.keys(s.runs).find((u) => s.runs[u] === 'queued')!;
        s.runs[user] = 'running';
      },
    },
    CompleteRun: {
      guard: (s) => Object.values(s.runs).some((v) => v === 'running'),
      update: (s) => {
        const user = Object.keys(s.runs).find((u) => s.runs[u] === 'running')!;
        s.runs[user] = 'completed';
      },
    },
  },

  invariants: {
    AtMostOneRunning: (s) =>
      Object.values(s.runs).filter((v) => v === 'running').length <= MaxConcurrent,
  },
});

Read the full file on GitHub · 172 lines

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. 5d ago First seen · 172 lines · 46 tokens per session scan A 1b511bd0dd18

Subscribe to this mod's changes

tla-precheck is a skill published in the GitHub repository Plazmodium/odin-workflow (0 stars, last pushed 3mo ago), licensed MIT. It adds 46 tokens to every session and 1,539 once invoked, about $0.0002 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-01.

Related

Other skills, from other repositories

vue-component-testing

Applies the three-tier test taxonomy for Vue 3 applications: writes unit tests for composables and Pinia stores with Vitest, component tests for behaviour and user interactions with @testing-library/vue, and acceptance tests for full user flows with Playwright. Ensures tests focus on observable behaviour, not…

soulcodex/agentic · 79 tokens

next-application-structure

Establishes or reviews directory layout, server/client boundaries, routing, data-fetching strategy, and testing structure for Next.js 14+ App Router TypeScript applications. Invoked when the user asks to structure a Next app, set App Router conventions, or review architecture for React parity.

soulcodex/agentic · 64 tokens

react-component-testing

Applies the three-tier test taxonomy for React applications: unit tests for hooks and pure logic, component tests for behavior and interactions, and end-to-end tests for user flows. Uses Vitest, React Testing Library, and Playwright while focusing on observable behavior over implementation details.

soulcodex/agentic · 59 tokens

fix-bug

Investigates and fixes a reported bug. Reads relevant code, identifies the root cause, proposes a fix, and adds or updates tests to prevent regression. Invoked when the user describes unexpected behavior, an error, a crash, or a failing test.

soulcodex/agentic · 54 tokens

live-audit

Audit steam-games-mcp — build/test/lint gate, live MCP tool edge-case sweep (input validation, SteamID64/vanity/appid edge cases, key-gating), and source-level code review. Use when asked to test/audit the published or just-fixed steam-games-mcp package, hunt for bugs/edge cases, or repeat "the same kind of testing as…

Grinv/steam-games-mcp · 83 tokens

create-terraform-tests

Designs and implements Terraform module tests for AWS-targeted modules. Covers terraform-native tests, validation gates, fixture composition, and risk-focused assertions for regressions, address migration, and unsafe changes.

soulcodex/agentic · 44 tokens