Automatically repair code violations of temporal properties using model-checking counterexamples as guidance. Use when working with formal verification results, temporal logic property violations (LTL, CTL), model checking counterexamples, or when asked to repair property violations, fix counterexamples, repair temporal properties, fix model checking violations, or repair code based on counterexamples. Applicable to concurrent systems, state machines, synchronization issues, safety/liveness properties, and resource management violations.
Install with Tessl CLI
npx tessl i github:ArabelaTso/Skills-4-SE --skill model-guided-code-repair82
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
This skill enables automatic repair of code that violates temporal properties by analyzing model-checking counterexamples. It reasons about the root cause of violations at the model level, proposes minimal and semantically justified code modifications, and validates repairs through re-verification or test generation.
Follow this sequential process when repairing temporal property violations:
Gather and understand three required inputs:
Read all inputs carefully. If the temporal property is in natural language, formalize it first.
Trace through the counterexample step-by-step:
Output: A clear narrative of the execution path leading to the violation.
Analyze why the violation occurs:
Output: A precise diagnosis of the model-level cause.
Design a minimal repair that:
Common repair strategies:
Output: A clear repair plan with justification.
Implement the repair:
Output: Modified source code with changes clearly indicated.
Verify that the repair resolves the violation:
Option A: Re-run Model Checker
Option B: Generate and Run Tests
Output: Validation results showing the property is satisfied.
Provide a comprehensive explanation:
Structure the final output as follows:
## Repaired Code
[Modified source code with changes clearly marked]
## Changes Made
- [Line X]: [Description of change]
- [Line Y]: [Description of change]
## Root Cause Analysis
[Explanation of what caused the violation]
## Repair Strategy
[Why this repair approach was chosen]
[Why it is minimal and semantically justified]
## Behavior Preservation
[How the repair maintains intended program behavior]
## Validation Results
[Model checking results OR test execution results]
[Confirmation that the property now holds]Example: "The system must never enter an error state"
Example: "Every request must eventually be processed"
Example: "Shared resources must be accessed atomically"
Example: "State transitions must follow the specified protocol"
This skill works with various model checking tools:
When counterexamples are provided in tool-specific formats, translate them into a clear execution trace before analysis.
c1fb172
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.