Agent skill · Testing & QA

counterexample-explainer

Explain why counterexamples violate specifications by analyzing formal specifications (temporal logic, invariants, pre/postconditions, code contracts), informal requirements (user stories, acceptance criteria), test specifications (assertions, property-based tests), and providing step-by-step traces showing state changes, comparing expected vs actual behavior, identifying root causes, and assessing violation impact. Use when debugging test failures, understanding model checker output, explaining runtime assertion violations, analyzing static analysis warnings, or teaching specification concept

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill counterexample-explainer --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 14 KB
Bundled scripts: none
Path: skills/analysis/counterexample-explainer/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Counterexample Explainer ## Overview Analyze counterexamples that violate specifications and produce clear, structured explanations showing step-by-step how and why the violation occurs, with root cause analysis and impact assessment. ## Workflow ### 1. Understand the Specification Identify what property is being checked. **Questions to ask:** - What is the specification or requirement? - Is it formal (invariant, temporal logic) or informal (requirement doc)? - What should happen vs what actually happened? - Is this from a test failure, model checker, or runtime error? See [specification-types.md](references/specification-types.md) for comprehensive specification catalog. **Common specification types:** **Formal specifications:** - Invariants: `balance >= 0` - Temporal logic: `G(request → F grant)` - Pre/postconditions: `@requires(x > 0)`, `@ensures(result >= 0)` - State machines: Valid state transitions - Concurrency: Atomicity, deadlock freedom **Informal requirements:** - User stories with acceptance criteria - Functional requirements - API contracts - Expected behavior descriptions **Test specifications:** - Assertions: `assert result == expected` - Property-based tests - Int

What's inside
Steps it walks through
  1. Overview
  2. Workflow
  3. 1. Understand the Specification
  4. 2. Collect Counterexample Information
  5. 3. Identify Violation Point
  6. 4. Generate Step-by-Step Trace
  7. 5. Compare Expected vs Actual
  8. 6. Identify Root Cause
  9. 7. Assess Impact
  10. 8. Present Complete Explanation
  11. Example Workflows
  12. Example 1: Test Failure Explanation
  13. Example 2: Temporal Logic Violation
  14. Tips for Clear Explanations
Ships with 1 file
  • metadata.json
Commands it runs
Run test to get failure details
pytest test_file.py::test_name -v
Get stack trace
pytest test_file.py::test_name -v --tb=long
Get variable values at failure
pytest test_file.py::test_name -v -l
More from claude-skill-registry
All skills →
About this skill
What does the counterexample-explainer skill do?

Explain why counterexamples violate specifications by analyzing formal specifications (temporal logic, invariants, pre/postconditions, code contracts), informal requirements (user stories, acceptance criteria), test specifications (assertions, property-based tests), and providing step-by-step traces showing state changes, comparing expected vs actual behavior, identifying root causes, and assessing violation impact. Use when debugging test failures, understanding model checker output, explaining runtime assertion violations, analyzing static analysis warnings, or teaching specification concept

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill counterexample-explainer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going