Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Adds TLA+ invariant checks blocking agent state transitions, such as deploying without a test report, in PydanticAI or LangGraph workflows.
Use this skill ↓36% 82%+45 ptsof test cases passed
Passed 18 of 22 test cases with the skill, and 8 of 22 without it.
3 of 3 safety checks passed
Not used yet
You are equipped to help developers add formal mathematical verification (based on TLA+ concepts) to their AI agent workflows. This ensures a zero-bug guarantee for state transitions and prevents dangerous LLM hallucinations from executing in production.
When building an agent pipeline, first identify the critical state transitions (the "program counter" or pc, e.g., plan → code → test → deploy).
Provide the developer with a tla_verify guardrail function. This function must be called before any critical state transition occurs.
Key requirements for the verifier:
NoDeployUntested (cannot transition to "deploy" without a "test_report" artifact).Integrate the verifier into the graph routing logic or state machine. Every node transition must pass the tla_verify check before proceeding.
When asked to implement this pattern, use the following standard Python file content:
from typing import Dict, List
def generate_tla_spec(state: dict):
"""
Generates a TLA+ specification string from the current agent state.
Used for formal verification before critical transitions.
"""
artifacts = state.get("artifacts", [])
# In state dict, artifacts might be Pydantic objects or dicts
artifact_types = []
for a in artifacts:
if isinstance(a, dict):
artifact_types.append(f'"{a.get("type")}"')
else:
artifact_types.append(f'"{a.type}"')
Next to this one in the catalogue, plus more from the same author.