skills/provably-correct-software/SKILL.md
Apply formal verification methods (Hoare Logic, wp calculus, Design-by-Contract) to ensure software correctness. Use this skill whenever writing new functions, implementing algorithms, modifying existing logic, or performing code reviews. Trigger when asked to "prove correctness", "verify code", "check invariants", "mathematical proof of code", or "ensure the algorithm is correct".
npx skillsauth add jpc0/skills provably-correct-softwareInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build software that is correct by design using formal verification.
{P} C {Q} to specify code blocks.wp(C, Q) to derive the weakest precondition from your postcondition.wp("x := E", R) = R[x -> E].wp("S1; S2", R) = wp(S1, wp(S2, R)).Define Postcondition (Q): State the exact logical goal.
Derive Precondition (P): Calculate the minimum required state using wp.
Loop Verification (Total Correctness):
(I AND NOT B) => Q.P => I), Preservation ({I AND B} Body {I}), and Termination (v decreases, I => v >= 0).assert statements within the loop body to verify the Invariant and Variant at each iteration.Annotate: Use language-native assertions (e.g., assert in Python, @requires/@ensures in Eiffel/JML) to document the contract.
def binary_search(array: list[int], target: int) -> int:
"""
Precondition: array is sorted.
Postcondition: returns mid s.t. array[mid] == target, else -1.
"""
# DbC Precondition
assert all(array[i] <= array[i+1] for i in range(len(array)-1))
low, high = 0, len(array) - 1
# Invariant I: target in array iff target in array[low...high]
# Variant v: high - low + 1
while low <= high:
# Runtime Invariant & Variant Verification
v_old = high - low + 1
assert (target not in array) or (target in array[low:high+1])
assert v_old >= 0
mid = (low + high) // 2
if array[mid] == target:
return mid # Postcondition Q reached
elif array[mid] < target:
low = mid + 1
else:
high = mid - 1
# v decreases, I is preserved
v_new = high - low + 1
assert v_new < v_old
return -1 # (I AND low > high) => target not in array
testing
Define module boundaries, structure infrastructure layers, implement dependency inversion, and create sociable unit tests using MIM (Module-Infrastructure-Module) architecture and modular design principles. Use this skill when the user mentions "MIM", "Module-Infrastructure-Module", "Screaming Architecture", or asks for advice on modular design, high cohesion, low coupling, or sociable unit testing.
development
Use this skill to refactor, design, or review application architecture. Trigger it when discussing clean architecture, separating business logic from UI, or cross-platform/WASM development. This skill enforces the 'Headless Core & Passive View' pattern, it proactively refactors logic out of the UI, creates platform-agnostic Core interfaces, and ensures the View is a 'Humble Object' that only reflects state.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.