/tlaplus:tla-debug-violationsfrom tlaplus
This skill provides a systematic workflow to isolate and diagnose TLA+ invariant or property violations. It should be used when the user mentions "invariant violated", "TLC found a bug", "counterexample", "property failed", "violation trace", "debugging TLA+ violations", "error trace", "why did TLC fail", "fix my spec", "TLC error", "trace analysis", "deadlock found", or "lasso-shaped counterexample".
Ships in tlaplus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use this skill when TLC reports invariant or property violations to systematically diagnose the issue.
IMPORTANT: Always use the MCP tools listed above. Never fall back to running Java or TLC commands via Bash.
Before debugging, read both the .tla spec file and its .cfg config file to understand:
This context is essential for interpreting counterexample traces.
Start with the smallest possible configuration to isolate the issue:
N is a constant, try N = 2 first)Goal: Get a fast, reproducible counterexample.
Edit the .cfg file and temporarily remove all PROPERTY entries:
Before (with property):
SPECIFICATION Spec
INVARIANT TypeInvariant
INVARIANT SafetyInvariant
PROPERTY LivenessProperty
After (property removed):
SPECIFICATION Spec
INVARIANT TypeInvariant
INVARIANT SafetyInvariant
Why: Disabling temporal properties isolates invariant failures. TLC configuration
files support TLA+ comments (\* for a line or (* ... *) for a block), so
commenting out a PROPERTY entry is also valid. Restore the entries after this
check.
Run TLC with only invariants enabled:
Call mcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_check with fileName set to the spec path and cfgFile set to the minimal config path.
If invariants fail:
If exhaustive checking completes successfully with exit code zero:
mcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_explore for additional sampled behaviors; random exploration does not reproduce a specific counterexample.If invariants pass but properties fail, re-enable properties one at a time:
Checks do not save trace files by default. To capture a counterexample, call
mcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_check with the chosen fileName, cfgFile,
and extraOpts: ["-dumpTrace", "tlc", "/absolute/path/trace.tlc"].
Use the actual generated .tlc file; do not assume a .vscode/tlc/ location.
Keep the matching spec, constants, and model configuration. Add an ALIAS
expression to the spec and an ALIAS <operator> entry in a replay config to
show derived values or animation data. Then call
mcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_trace with the matching fileName, replay
cfgFile, and absolute traceFile. Replay interprets the saved behavior;
it does not verify the whole model. Read tlc-alias-expressions.md from the
knowledge resource when designing the alias.
Distinguish the replayed violation from parser/config or process failures. Never infer safety from missing violation text in a failed or incomplete run.
WF_vars(Action) or SF_vars(Action)[]<>P vs <>[]P confusionmcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_check: Run model checker with configmcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_explore: Sample behaviorsmcp__plugin_tlaplus_tlaplus__tlaplus_mcp_tlc_trace: Replay saved counterexamples with ALIASmcp__plugin_tlaplus_tlaplus__tlaplus_mcp_sany_parse: Verify syntax after fixesreferences/debugging-strategies.md - Advanced debugging strategies and techniques, including trace analysis, Print debugging, and common bug patternsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub photoszzt/tlaplus-ai-tools --plugin tlaplus12 skills in this plugin
/tla-checkThis skill runs exhaustive model checking to verify all reachable states of a TLA+ specification using TLC. It should be used when the user asks to "check my spec", "run TLC", "verify my TLA+ spec", "find invariant violations", "exhaustive model checking", "check for bugs in my spec", "model check", "exhaustive check", "verify all states", "run model checker", "verify invariants", "check properties", "check temporal properties", "check liveness", "full check", "check all states", "check safety", or "verify properties"./tla-create-animationsThis skill guides the creation of animations that visualize TLA+ specifications during model checking or trace exploration. It should be used when the user asks to "create animation", "animate my spec", "visualize state transitions", "show me what's happening", "TLA+ animation", "trace visualization", "see state changes", "render animation in terminal", "ASCII animation", "SVG animation", or "show animation in browser"./tla-explore