- Home
- Skills
- Agents & Orchestration
- proof mcp source first verification
Works with the AI Agents you already use
proof mcp source first verification
by Yasir Karam
Generate and verify Lean or TLA+ formal specifications directly from source code using Proof-MCP.
$5
proof mcp source first verification
Example session with this skill installed
Verify the inventory reservation logic in src/inventory.py for potential race conditions. Discover the modules first.
- Read your context and instructions
- Compiled the proof mcp source
I have discovered the modules in the repository and identified candidate checks for the inventory system. I have extracted the source for src/inventory.py to analyze the reservation transitions.
Verification Discovery & Analysis
| Component | Language | Candidate Check | Directory |
|---|---|---|---|
inventory | Python | pytest src/test_inventory.py | / |
reservation_flow | TLA+ (Proposed) | TLC Generated.cfg | /temp |
Observed Behavior
The reserve_stock function in src/inventory.py performs a read-modify-write operation on the database. It checks if available > requested before updating.
Formal Modeling (TLA+)
To check for race conditions, I have drafted a TLA+ model to verify the
Safety property: Total reserved stock never exceeds initial inventory.
---------------- MODULE Generated ----------------
EXTENDS Integers, Sequences
VARIABLE inventory, reserved
Init ==
/\ inventory = 10
/\ reserved = 0
Reserve(n) ==
/\ inventory >= n
/\ inventory' = inventory - n
/\ reserved' = reserved + n
Next == \exists n \in {1, 2}: Reserve(n)
Spec == Init /\ [][Next]_<<inventory, reserved>>
Safety == reserved <= 10
==================================================
Next steps
- Approve the execution of
proof_run_approved_checksfor the initial Python test suite. - Run
proof_check_generatedwith the TLA+ model above to check for concurrency violations. - Define the upper bound of concurrent users for the model check.
Connects securely to your tools. The creator never sees your data.
About this skill
Formal verification is often inaccessible to developers because it requires writing complex specifications before seeing any results. This skill bridges the gap by generating Lean or TLA+ specifications directly from your source code and running them through the Proof-MCP verification server.
What it does
- Source discovery identifies languages, modules, and candidate verification checks within a repository.
- Formal modeling drafts Lean 4 theorems for functional correctness or TLA+ models for concurrency and protocols.
- Automated checking executes model-checkers and proof-checkers via MCP to verify safety and liveness properties.
- Evidence reporting generates QA reports that separate runtime test results from formal proof evidence.
- Structural analysis maps dependencies and cycles to provide context for verification bounds.
How it works
- Use
proof_discover_qato map the codebase and identify which modules require verification. - Provide a specific verification goal to extract the relevant source and structural context.
- Review the ledger of observed behaviors versus intended properties and approve specific project commands.
- Generate and check a candidate Lean or TLA+ bundle using the
proof_check_generatedtool. - Review the final evidence report which documents passes, failures, and unmodeled gaps.
Frameworks & tools
This skill requires a connection to a Proof-MCP server. It supports Lean 4 for mathematical proofs, TLA+ with the TLC model checker for state transitions, and Python for property-based testing.
Why this beats prompting it yourself
Generic prompts often hallucinate proof results or fail to maintain the strict boundary between implementation and abstraction. This skill uses a structured verification workflow that forces explicit documentation of assumptions and prevents the agent from claiming a proof passed without actual checker execution.
Use cases
- Verify distributed protocols or state machine transitions using TLA+.
- Prove functional invariants and mathematical bounds in critical Lean 4 modules.
- Audit a complex workflow for potential deadlocks or liveness violations.
- Generate a formal QA report for a specific subset of a legacy codebase.
Known limitations
Requires a configured Proof-MCP server to execute checks. It does not prove that executable source is verified unless a refinement relationship is explicitly modeled.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 14 days ago
- Software
- Proof MCP
Git
Permissions
What's inside
Frequently Asked Questions
New in Agents & Orchestration
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.