TLA+ AI Tools
TLA+ formal specification and model checking toolkit for Claude Code and Codex
AI-powered assistance for writing, verifying, and debugging TLA+ specifications.

Overview
TLA+ AI Tools is a comprehensive plugin that brings the power of TLA+ formal methods to AI coding assistants. It combines an MCP server for TLA+ tools with AI skills to provide intelligent assistance throughout the entire TLA+ workflow.
Key Capabilities:
- 🤖 AI Skills - Learn TLA+, model checking, refinement, debugging, and animation creation
- 🛠️ MCP Integration - Full access to SANY parser, TLC model checker, and animation tools
- 📚 Knowledge Base - 20+ articles on TLA+ best practices
Features
AI Skills (12)
Educational (5):
- tla-getting-started - Introduction to TLA+ with examples and tutorials
- tla-model-checking - Complete guide to TLC configuration and workflows
- tla-refinement-proofs - Specification refinement and verification
- tla-debug-violations - Systematic debugging of counterexamples
- tla-create-animations - Visualize specifications with SVG animations
Operational (7):
- tla-parse - Parse and validate TLA+ specifications
- tla-check - Run exhaustive model checking with TLC
- tla-smoke - Quick 3-second smoke test
- tla-explore - Generate behavior traces with TLC
- tla-symbols - Extract symbols and generate TLC config
- tla-review - Comprehensive spec review with validation
- tla-setup - Interactive setup and verification
MCP Tools (10)
Full integration with TLA+ toolchain:
SANY Parser Tools (3):
- sany_parse - Syntax and semantic validation
- sany_symbol - Analyze spec structure and extract symbols
- sany_modules - List available TLA+ modules
TLC Model Checker Tools (4):
- tlc_check - Exhaustive state space exploration
- tlc_smoke - Fast random simulation
- tlc_explore - Generate execution traces
- tlc_trace - Replay saved TLC counterexample traces with ALIAS expressions
Animation Tools (3):
- animation_detect - Detect animation elements in specs
- animation_render - Render animation frames as SVG
- animation_frameCount - Count animation frames
Installation
Claude Code Plugin Installation
Via Plugin Marketplace (Automatic):
# Add to marketplace
claude plugin marketplace add https://github.com/photoszzt/tlaplus-ai-tools.git
claude plugin install tlaplus
Note: The plugin now includes automatic setup during installation. The MCP server is built and TLA+ tools are downloaded automatically when you install the plugin.
Codex Plugin Installation
codex plugin marketplace add https://github.com/photoszzt/tlaplus-ai-tools.git
codex plugin add tlaplus@tlaplus
No local build is required. On first startup, the installed plugin downloads its
runtime dependencies and TLA+ JARs automatically, then runs the shared TypeScript
MCP server through tsx. Later startups reuse those files. Node.js, npm, Java,
and network access are needed for initial setup. The Codex skills are maintained
in codex/tlaplus/skills/. See the
Codex plugin notes for updates and migration from the
previous tlaplus-local installation.
Local install
# Clone repository
git clone https://github.com/photoszzt/tlaplus-ai-tools.git
cd tlaplus-ai-tools
# Install and setup
npm install
npm run build
npm run setup # Downloads TLA+ tools
# Verify installation
npm run verify
# Use with Claude Code
claude --plugin-dir $(pwd)
Requirements
- Node.js 18.14.0 or higher
- Java 11 or higher (for TLA+ tools)
- Claude Code or Codex
Quick Start Guide (Claude Code)
1. Create Your First Spec
User: "I want to learn TLA+"
→ tla-getting-started skill loads with tutorial
Follow the guidance to create a simple counter specification.
2. Generate Configuration
/tla-symbols @Counter.tla
→ Generates Counter.cfg with proper settings
3. Test Quickly
/tla-smoke @Counter.tla
→ 3-second smoke test finds obvious bugs
4. Full Verification
/tla-check @Counter.tla
→ Exhaustive model checking
5. Review and Debug
/tla-review @Counter.tla
→ Comprehensive review with automated validation
Workflows
Learning TLA+
1. Ask: "teach me TLA+"
2. Follow tla-getting-started skill
3. Create example specs
4. Run /tla-parse and /tla-smoke
5. Progress to /tla-check
Writing Specifications
1. Write spec in editor
2. /tla-symbols to generate config
3. /tla-smoke for quick test
4. /tla-check for full verification