arabelatso/interface-contract-verifier
Verify that interface and class contracts (preconditions, postconditions, invariants) are preserved across program versions. Use when validating refactorings, checking API compatibility, verifying design-by-contract implementations, or ensuring behavioral contracts remain intact after code changes. Automatically detects contract violations, identifies affected methods and classes, and provides actionable guidance for resolving violations while maintaining program correctness.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill interface-contract-verifier
Verify that formal or structured contracts (preconditions, postconditions, invariants) defined in interfaces and classes are preserved when updating to a new program version.
Extract contracts from both versions:
python scripts/contract_extractor.py --program old_version --output old_contracts.json
python scripts/contract_extractor.py --program new_version --output new_contracts.json
Compare and verify contract preservation:
python scripts/contract_verifier.py --old old_contracts.json --new new_contracts.json --output report.json
Examine violations: weakened preconditions, strengthened postconditions, broken invariants.
Requirements before method execution:
def withdraw(amount):
"""Precondition: amount > 0 and amount <= balance"""
Guarantees after method execution:
def deposit(amount):
"""Postcondition: balance == old(balance) + amount"""
Properties always true for a class:
class BankAccount:
"""Invariant: balance >= 0"""
Liskov Substitution Principle:
New version rejects previously valid inputs.
New version guarantees less.
Class invariant no longer holds.
Relax precondition or update callers.
Strengthen implementation to meet original guarantee.
Add checks to maintain invariant in all methods.
Take arabelatso/interface-contract-verifier 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.