formal-methods-reconciler

Extract claims from specs and code, select formal verification tools, model system behavior, and translate counterexamples into domain decisions.

416|6|Updated Apr 24, 2026
Ready to run
npx skills add https://github.com/mizchi/skills --skill formal-methods-reconciler-mizchi
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: formal-methods-reconciler
Source: https://github.com/mizchi/skills/tree/main/formal-methods-reconciler
Command: npx skills add https://github.com/mizchi/skills --skill formal-methods-reconciler-mizchi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? This Skill transforms vague correctness concerns—where specs and implementation disagree, or expected behavior is undocumented—into concrete, machine-checked claims and actionable domain questions. It bridges the gap between informal reasoning and formal verification by guiding tool selection, model construction, and result interpretation. ## Core Features & Use Cases - Source-of-truth selection: Decide whether specs, code, tests, or logs represent expected behavior versus observed reality. - Claim extraction and formalization: Translate English requirements into formal properties (predicates, relations, state transitions, protocols, theorems). - Tool selection: Match question shapes to appropriate solvers—Z3 for config consistency, Alloy for authorization relations, TLA+ for retry/crash interleavings, Dafny for sequential contracts, Lean/Rocq for universal theorems. - Witness reproduction: Run the machine counterexample against the implementation to confirm it is a real bug, not a model artifact. - Domain translation: Convert SAT/UNSAT results and traces into business-readable questions: "Is BillingAdmin intended to bypass project tenant boundaries?" - Use Case: Your API docs say idempotency keys guarantee at-most-once execution. The implementation records the key asynchronously after calling the provider. Model the retry race with TLA+, extract the trace showing double charge under concurrent retry, reproduce it in a test, and translate the fix into product policy. ## Quick Start Describe the spec or docs you trust, the implementation or config you observe, and the correctness concern. For example: "Our targeting config has age gte=30 AND lt=30 in the include block, plus country JP in both include and exclude. Does this dead config make the campaign unreachable, and if so, is that intended?"

Frequently Asked Questions about formal-methods-reconciler

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

FAQPage Schema
When should I use Z3 versus Alloy versus TLA+ for formal verification?▼

Use Z3 for pure predicates and config consistency (input → Bool). Use Alloy for entity relations and structural properties (RBAC, tenants, ownership graphs). Use TLA+ for state transitions with retry, crash, and event ordering where interleavings matter. If the question is only about static relations without time, Alloy is faster. If all interleavings must be checked, TLA+ is necessary.

How do I translate a formal counterexample into a test that reproduces the bug?▼

Extract the witness trace or model instance from the verifier output. Write an implementation test that forces the same input, state sequence, or interleaving—using the same values, test barriers, or injected delays. If the test fails identically to the model counterexample, the bug is real and the test becomes a regression guard. If the test passes, the model's assumptions about the runtime (isolation level, lock semantics, retry policy) were wrong and need correction.

What is a minimal model and why is it important?▼

A minimal model includes only the observable values, state variables, actions, and invariants needed to express the claim. Strip I/O, frameworks, databases, and UI unless they define the property. Minimal models run faster, produce smaller counterexamples, and are easier to review. Always include a positive sanity case that passes and a broken variant that fails to prove the property is load-bearing.

When should I not use formal methods instead of cheaper checks?▼

If a simple linter, schema validator, or integration test already covers the concern, say so and propose the cheaper check. Formal methods are worth building when the claim involves hidden interleavings, unbounded quantification, implicit protocol assumptions, or past failures that tests alone have not caught.

How do I know if my model's assumptions match the implementation?▼

Reproduce the counterexample against the code using a test that injects the same inputs, state transitions, or timing. If the test fails the same way, the witness is real. If the test passes or fails differently, compare the model's assumptions (snapshot isolation level, lock scope, retry timing, provider guarantees) against the actual runtime behavior and correct the model first before trusting the green result.

What should I include in a domain ledger entry?▼

Record the source (spec, code, log), the implementation observation, the model question, the tool used, the machine result (SAT/UNSAT/trace), the witness, whether it reproduced in an implementation test, a plain-English description of what went wrong or why it is correct, a domain-owner question (if unclear), and the decision (bug/spec update/accepted/unresolved) with any CI guard or regression test to lock.