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.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill model-guided-code-repair
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.
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.
Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling
Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification
Take arabelatso/model-guided-code-repair from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.