AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Tlaplus Add Variable

skill-tlaplus-agentskills-tlaplus-add-variable · by tlaplus

Add a new variable to an existing TLA+ specification without changing its semantics. Ensures the variable is declared, initialized, and added to all UNCHANGED statements. Use when the user asks to add, introduce, or declare a new variable in a TLA+ spec, or mentions UNCHANGED statements.

No reviews yet
0 installs
0 views
view→install

Install

$ agentstack add skill-tlaplus-agentskills-tlaplus-add-variable

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-tlaplus-agentskills-tlaplus-add-variable)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Tlaplus Add Variable? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Add Variable to TLA+ Specification

Add a new variable to a TLA+ specification while preserving semantics. The new variable must appear in all necessary locations so the specification remains valid and its behavior is unchanged.

Required Locations for New Variables

When adding a variable newVar to a TLA+ specification, update these locations:

  1. VARIABLE declaration block - Add the variable name
  2. Init - Initialize the variable
  3. All UNCHANGED statements - Add variable to every UNCHANGED that doesn't modify it
  4. vars tuple - Add to the tuple used in temporal formulas (if exists)
  5. TypeOk (optional) - Add type constraint if TypeOk invariant exists

Workflow

Step 1: Analyze the Specification

Read the TLA+ file and identify:

  • All existing variables in the VARIABLE block
  • The Init predicate
  • All actions and their UNCHANGED statements
  • The vars tuple or similardefinition (usually near Next or Spec)
  • TypeOk invariant if present

Step 2: Add Variable Declaration

Add the new variable to the VARIABLE block. Preserve formatting:

VARIABLE
    existingVar1,
    existingVar2,
    newVar  \* Add with comment explaining purpose

Step 3: Initialize in Init

Add initialization. Match the style of existing initializations:

Init ==
    /\ existingVar1 = ...
    /\ existingVar2 = ...
    /\ newVar = 

Step 4: Update All UNCHANGED Statements

Critical step. Find every UNCHANGED statement and add the new variable:

\* Before:
UNCHANGED >

\* After:
UNCHANGED >

Search patterns to find UNCHANGED statements:

  • `UNCHANGED >

### Step 5: Update vars Tuple

If a `vars` tuple exists, add the new variable:

```tla
\* Before:
vars == >

\* After:
vars == >

Step 6: Update TypeOk (if exists)

Add type constraint for the new variable:

TypeOk ==
    /\ existingVar1 \in SomeSet
    /\ newVar \in ExpectedType

Verification Checklist

After making changes, verify:

  • [ ] Variable declared in VARIABLE block
  • [ ] Variable initialized in Init
  • [ ] Variable added to ALL UNCHANGED statements (use grep to count)
  • [ ] Variable added to vars tuple
  • [ ] Variable has type constraint in TypeOk (if TypeOk exists)
  • [ ] No action modifies the new variable (per task requirements)

Common Patterns

Per-Thread Variables

For variables indexed by thread/process:

\* Declaration
newVar,

\* Initialization
/\ newVar = [thread \in Threads |-> InitialValue]

\* In UNCHANGED (same as scalar variables)
UNCHANGED >

Conditional UNCHANGED

Some actions have conditional branches with different UNCHANGED statements. Update ALL branches:

Action(thread) ==
    IF condition
        THEN
            /\ ...
            /\ UNCHANGED >  \* Update this
        ELSE
            /\ ...
            /\ UNCHANGED >  \* AND this

Nested Disjunctions

Actions with \/ may have UNCHANGED in each branch:

Action(thread) ==
    \/  /\ guard1
        /\ UNCHANGED >  \* Each branch
    \/  /\ guard2
        /\ UNCHANGED >  \* needs update

Example

Adding debug_log variable to track operations:

Before:

VARIABLE state, counter

Init ==
    /\ state = "idle"
    /\ counter = 0

Increment ==
    /\ counter' = counter + 1
    /\ UNCHANGED state

vars == >

After:

VARIABLE state, counter, debug_log

Init ==
    /\ state = "idle"
    /\ counter = 0
    /\ debug_log = >

Increment ==
    /\ counter' = counter + 1
    /\ UNCHANGED >

vars == >

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.