proof-driven-development

Prove algorithm correctness in Lean 4 before implementing in the target language.

Updated May 4, 2026
One-click install
npx skills add https://github.com/xaionaro/.config-codex --skill proof-driven-development-xaionaro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: proof-driven-development
Source: https://github.com/xaionaro/.config-codex/tree/main/skills/proof-driven-development
Command: npx skills add https://github.com/xaionaro/.config-codex --skill proof-driven-development-xaionaro

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prove correctness in Lean 4 before implementing the algorithm in the target language. This practice provides a formal reference to guide translation and reduce errors.

Core Features & Use Cases

  • Formal specification in Lean 4 that captures types, function signatures, and properties.
  • Proofs & verification with lake to ensure properties hold across edge cases and invariants.
  • Differential testing that compares Lean and target-language results to catch translation bugs.
  • Maintain proofs alongside production in a dedicated proofs/ directory and keep them synchronized with code.

Quick Start

Initialize a Lean-based proof project, prove the specification with lake, translate the verified algorithm to the target language, and run differential tests.

Frequently Asked Questions about proof-driven-development

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

FAQPage Schema
What is proof-driven development in Lean 4 used for?

Proof-driven development uses Lean 4 to formally specify and prove algorithm correctness before translation. It targets logic-rich software like data structures and parsers, providing a verified formal reference to guide implementation and reduce errors.

How do I verify algorithm correctness before translation using lake?

To verify algorithm correctness using lake, initialize a Lean 4 proof project, write the formal specification, and execute proofs to ensure properties hold across edge cases before translating the verified algorithm to the target language.

Does proof-driven development require differential testing after translation?

Yes, proof-driven development requires differential testing after translation. It compares outputs from the Lean 4 specification against the target-language implementation to validate equivalence and catch any translation bugs.

Can I apply formal specification and proof to state machines and parsers?

Yes, you can apply formal specification and proof to state machines and parsers. Lean 4 captures types, function signatures, and properties to verify logic-rich software components before implementation.

How do I maintain proofs alongside production code?

To maintain proofs alongside production code, store them in a dedicated proofs directory and keep them synchronized with the target-language implementation to ensure ongoing formal verification.

What is the best way to translate a verified Lean 4 algorithm to a target language?

The best way to translate a verified Lean 4 algorithm is to first prove the specification with lake, then translate the verified algorithm to the target language, and finally run differential tests to validate equivalence.