counterexample-explainer

Generate step-by-step traces and root cause analysis for counterexamples violating specifications.

142|14|Updated Feb 14, 2026
One-click install
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill counterexample-explainer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: counterexample-explainer
Source: https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/counterexample-explainer
Command: npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill counterexample-explainer

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you understand and debug failures by providing clear, step-by-step explanations of why counterexamples violate specifications, pinpointing the root cause and impact.

Core Features & Use Cases

  • Analyze Violations: Understand why tests fail, model checker outputs are invalid, or runtime assertions are broken.
  • Generate Traces: Create detailed execution traces showing state changes leading to a violation.
  • Root Cause Analysis: Identify the underlying bug or design flaw causing the counterexample.
  • Impact Assessment: Explain the consequences of the violation.
  • Use Case: When a critical test fails, use this Skill to generate a human-readable explanation of the failure, including the exact steps that led to the bug and a proposed fix.

Quick Start

Explain why the provided counterexample for the 'balance >= 0' invariant failed.

Frequently Asked Questions about counterexample-explainer

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

FAQPage Schema
How do I debug a test failure using a counterexample trace?

Counterexample analysis works by generating detailed execution traces that show state changes leading to a violation. It compares expected versus actual behavior to pinpoint the exact root cause of the test failure or broken runtime assertion.

Why does my model checker output violate the formal specification?

Model checker outputs violate formal specifications when internal state transitions deviate from defined invariants. Analyzing the counterexample trace highlights the specific step where expected behavior diverges from actual behavior, revealing the design flaw or bug causing the violation.

What is the best way to perform root cause analysis on a runtime assertion violation?

The best way to perform root cause analysis on a runtime assertion violation is to assess the counterexample impact and generate a human-readable execution trace. This isolates the exact state change causing the specification violation and explains the consequences of the failure.

Do I need detailed specification input to explain a counterexample?

Yes, you need detailed input on the specification and the counterexample data to explain a violation accurately. Providing the formal or informal specification rules allows the analysis to compare expected versus actual behavior and identify the root cause effectively.

Can I assess the impact of a specification violation from a failed test?

Yes, you can assess the impact of a specification violation from a failed test by analyzing the counterexample data. The evaluation explains the consequences of the violation by detailing the exact execution steps and state changes that led to the failure.