tlaplus-guided-code-repair

Analyze TLC error traces to repair source code bugs.

1|2|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill tlaplus-guided-code-repair-santosomar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tlaplus-guided-code-repair
Source: https://github.com/santosomar/general-secure-coding-agent-skills/tree/main/skills/verification/tlaplus-guided-code-repair
Command: npx skills add https://github.com/santosomar/general-secure-coding-agent-skills --skill tlaplus-guided-code-repair-santosomar

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automatically identifies and fixes bugs in source code by analyzing error traces from TLA+ model checking, specifically when TLC reports invariant violations or deadlocks.

Core Features & Use Cases

  • TLA+ Error Analysis: Parses TLC error traces to pinpoint the exact state and action causing a violation.
  • Root Cause Identification: Determines the specific TLA+ predicate that should have been false to prevent the error.
  • Automated Code Patching: Maps the identified TLA+ fix to the corresponding source code and applies the necessary changes.
  • Use Case: After TLA+ model checking reveals a deadlock in your distributed system's protocol, use this skill to analyze the TLC trace, identify the faulty action's guard, and automatically update the relevant code to resolve the deadlock.

Quick Start

Use the tlaplus-guided-code-repair skill to fix the code based on the provided TLC error trace.

Frequently Asked Questions about tlaplus-guided-code-repair

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

FAQPage Schema
How do I fix source code bugs from a TLA+ model checking error trace?

You can fix source code bugs by analyzing the TLC error trace to pinpoint the exact state and action causing the invariant violation or deadlock, then mapping the required TLA+ guard fix to your source code.

Can I automatically repair a deadlock in my distributed system using a TLC trace?

Yes, you can automatically resolve a deadlock by analyzing the TLC error trace to identify the faulty action's guard that should have been false, and applying the necessary patch directly to the corresponding source code.

What is the process for mapping a TLA+ invariant violation to a code repair?

The process involves parsing the TLC trace to determine the specific predicate that failed, identifying the enabling condition that should have been false, and translating that TLA+ state transition fix into source code changes.

Do I need to understand TLA+ action enablement to use automated code repair?

Yes, understanding TLA+ action enablement and variable state transitions is required to effectively identify the root cause of the error and map the TLA+ predicate fix to the corresponding source code.

What types of TLA+ model checking errors can be used to guide code repair?

Code repair can be guided by TLC model checking errors that report either invariant violations or deadlocks, allowing the identification of the specific state and action causing the failure.

Are there limitations to fixing code from TLC error traces?

The primary limitation is that effective repair requires understanding TLA+ action enablement and variable state transitions, meaning the source code must map directly to the TLA+ specification to apply the automated patch.