proof-tactics

Prove or refute code correctness claims using induction, contradiction, and counterexamples.

2|Updated Apr 30, 2026
One-click install
npx skills add https://github.com/NlightNFotis/skills --skill proof-tactics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: proof-tactics
Source: https://github.com/NlightNFotis/skills/tree/main/proof-tactics
Command: npx skills add https://github.com/NlightNFotis/skills --skill proof-tactics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you justify that code is correct for all relevant inputs, not just the handful of cases you tested. It is especially useful when loops, recursion, exhaustive branching, or universal claims about behavior make informal reasoning too weak.

Core Features & Use Cases

  • Proof tactic selection: Choose the right reasoning method such as induction, contradiction, contrapositive, case analysis, construction, or counterexample.
  • Correctness arguments for code: Build loop invariants, termination measures for recursion, and explicit exhaustiveness checks for branching logic.
  • Edge-case driven validation: Stress claims with empty inputs, singleton cases, boundaries, duplicates, numeric extremes, and adversarial examples before trusting them.
  • Use case: When reviewing a binary search implementation, use this Skill to define the loop invariant, show initialization and maintenance, and connect loop termination to the postcondition.

Quick Start

Use the proof-tactics skill to verify that a recursive function terminates and returns the correct result for all finite inputs.

Frequently Asked Questions about proof-tactics

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

FAQPage Schema
How do I prove code correctness beyond passing unit tests?

Prove code correctness by applying mathematical proof tactics like induction, contradiction, and case analysis to verify behavior across all inputs, not just tested cases. This requires precise claim statements and explicit loop invariants.

What is the best way to verify loop invariants and termination for recursive functions?

Verify loop invariants and termination by defining explicit invariants, showing initialization and maintenance, and providing well-founded decreasing measures for recursion. This connects loop termination directly to the desired postcondition.

How do I find counterexamples for exhaustive branching logic edge cases?

Find counterexamples for exhaustive branching by systematically searching adversarial examples, empty inputs, singleton cases, boundaries, duplicates, and numeric extremes before trusting the universal behavior claims.

When do I need formal reasoning and mathematical proofs for software engineering?

You need formal reasoning when loops, recursion, exhaustive branching, or universal behavior claims make informal testing too weak to justify correctness across all relevant inputs and execution paths.

Can I use mathematical proof techniques to validate behavior-preserving refactors?

Yes, you can validate behavior-preserving refactors by applying proof tactics like contrapositive and case analysis to exhaustively verify that the refactored logic maintains identical behavior across all inputs and state transitions.