tlaplus-add-variable

Add a variable to a TLA+ specification while preserving existing behavior.

36|1|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/tlaplus/AgentSkills --skill tlaplus-add-variable
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tlaplus-add-variable
Source: https://github.com/tlaplus/AgentSkills/tree/main/skills/tlaplus-add-variable
Command: npx skills add https://github.com/tlaplus/AgentSkills --skill tlaplus-add-variable

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you add a new variable to a TLA+ specification without changing its behavior, ensuring the new variable is properly declared, initialized, and integrated into all relevant constraints.

Core Features & Use Cases

  • Update the VARIABLE declaration block to include the new variable.
  • Initialize the new variable in Init.
  • Update all UNCHANGED statements (including converting single-variable UNCHANGED to a tuple) and ensure the new variable is included.
  • Update the vars tuple (if it exists) to include the new variable.
  • Optionally extend TypeOk invariants to constrain the new variable.

Quick Start

Provide the TLA+ specification and the desired variable name, and I will add the variable, initialize it, and update all UNCHANGED statements and related structures to preserve the model's semantics.

Frequently Asked Questions about tlaplus-add-variable

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

FAQPage Schema
How do I add a variable to a TLA+ specification without changing the model semantics?

To add a variable to a TLA+ specification without changing semantics, declare the new variable, initialize it in Init, and add it to all UNCHANGED statements and the vars tuple. This ensures the model preserves its existing behavior.

What happens to UNCHANGED statements when I introduce a new variable in TLA+?

When introducing a new variable in TLA+, all UNCHANGED statements must be updated to include it. If a statement currently references a single variable, it must be converted into a tuple format to correctly preserve the specification's semantics.

Do I need to update TypeOk invariants when adding a variable to a TLA+ model?

You need to update TypeOk invariants when adding a variable to a TLA+ model if the specification uses them. The new variable should be constrained by the TypeOk invariant to maintain type correctness within the extended specification.

Can I add per-thread variables to a TLA+ specification safely?

You can safely add per-thread variables to a TLA+ specification by ensuring each variable is declared, initialized in Init, and integrated into all relevant UNCHANGED tuples and vars definitions, preventing unintended semantic shifts during model checking.

Why does adding a variable to my TLA+ spec break the model checker?

Adding a variable to a TLA+ spec breaks the model checker if the variable is missing from Init or UNCHANGED statements. Proper integration into the vars tuple and TypeOk invariants is required to prevent state constraint violations.