create-formal-verification-skill

Generate a project-local skill that formally verifies critical code using model checkers, proof assistants, or SMT solvers.

15.8k|1.6k|Updated Jan 23, 2026
Ready to run
npx skills add https://github.com/cursor/plugins --skill create-formal-verification-skill-cursor
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: create-formal-verification-skill
Source: https://github.com/cursor/plugins/tree/main/harness/pstack/claude-code/skills/create-formal-verification-skill
Command: npx skills add https://github.com/cursor/plugins --skill create-formal-verification-skill-cursor

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? This Skill addresses the gap between testing and production safety. Tests cover cases developers think to write; formal verification checks every case in a stated scope. When bugs cost lives or money—in concurrent systems, parsers, state machines, or unsafe code—this Skill finds the highest-impact target and proves a property holds across all possible executions. ## Core Features & Use Cases - Automated verification target selection: Analyzes the codebase to identify where breaks harm users most and tests reach least. - Tool-agnostic verification: Selects the right verification engine (TLA+, SMT solver, proof assistant) based on the property and language. - Generates reusable local skills: Produces a project-specific skill that future agents can run on every relevant change to catch regressions. - Use Case: Your Go service has a race condition in the request-retry logic that causes data duplication. This Skill models the concurrent state transitions, proves the condition is unreachable under the current locking strategy, and leaves a TLA+ check that catches any future change that reintroduces the bug. ## Quick Start Run this skill to identify the highest-risk code section in your repository, formally verify one critical property with the appropriate tool, and generate a reusable verification skill that the next agent can run on changes.

Frequently Asked Questions about create-formal-verification-skill

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

FAQPage Schema
How do I choose between TLA+, SMT solvers, and proof assistants for verification?▼

TLA+ models concurrent event orderings and is language-agnostic, making it ideal for race conditions and state machines. SMT solvers like Z3 work on code itself for memory safety and overflow checks. Proof assistants (Coq, Lean) handle complex invariants requiring mathematical reasoning. Pick based on your question: Can it happen in a bad order? → TLA+. Does the code stay within bounds? → SMT. Must hold at every size? → Proof assistant.

What makes a good formal verification target in my codebase?▼

Choose code where a break harms users significantly (data loss, security bypass, money) and existing tests rarely exercise all paths. Concurrent request handlers, retry logic, cryptographic code, and state machine transitions are common targets. Avoid code that is already well-tested by your existing suite or where the cost of modeling exceeds the harm of a bug.

How do I know if the formal verification actually caught a real bug?▼

Before handing off, intentionally break the property in the real code—remove a lock, reorder a check, or change a guard—and confirm the verification fails with a counterexample grounded in your source code. Then revert the break and confirm the check passes. A skill never run is a draft; you must see it fail on a real break first.

Can I use formal verification on code written in languages without verification tools?▼

Yes. If no verifier exists for your language, model the relevant logic in a verification-friendly language (TLA+, Alloy) or write generated property-based tests that try many input combinations. The model or tests must stay synchronized with the code as it evolves.

What if formal verification finds no bugs in the current code?▼

That is a valid result. Report it with the verification command, tool version, and scope (what is proven, under which bounds). A passing check proves the property holds within that scope; it does not prove the code is bug-free overall. Leave the skill in place so future changes can be checked against the same property.