methodical-programming

Derive correct programs from formal specifications using preconditions and postconditions.

Updated Feb 27, 2026
One-click install
npx skills add https://github.com/vmvarela/skills --skill methodical-programming
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: methodical-programming
Source: https://github.com/vmvarela/skills/tree/main/skills/methodical-programming
Command: npx skills add https://github.com/vmvarela/skills --skill methodical-programming

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Rigorous, mathematically-grounded program construction and verification by deriving correct programs from formal specifications rather than ad-hoc coding. This skill is language-agnostic and applies to any programming paradigm.

Core Features & Use Cases

  • Specification-driven development using preconditions and postconditions to ensure correctness.
  • Derivation over verification, induction on algebraic data types, and loop invariant reasoning for reliable software.
  • Language-agnostic applicability to Python, Haskell, Java, and beyond; useful for algorithms, data-structure operations, and correctness-critical code.

Quick Start

Define a simple pre/post specification and derive a correct implementation from it.

Frequently Asked Questions about methodical-programming

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

FAQPage Schema
How do I derive a correct program from formal specifications?

Deriving a correct program from formal specifications involves defining preconditions and postconditions first, then systematically constructing the implementation logic to rigorously satisfy those mathematical constraints. This approach guarantees correctness by design rather than relying on ad-hoc coding or after-the-fact testing.

What is specification-driven development and when should I use it?

Specification-driven development is a rigorous programming approach where you derive code from formal mathematical specs rather than writing it ad-hoc. You should use it for algorithm design, data-structure operations, and any correctness-critical code where formal precondition and postcondition reasoning is required to prevent failures.

How do I derive loop invariants for algorithm correctness?

Deriving loop invariants requires formulating logical conditions that hold before, during, and after each loop iteration to bridge the precondition and postcondition. This skill facilitates loop invariant derivation, enabling rigorous development and mathematical verification that iterative code satisfies the original formal specification.

Can I use formal specification derivation with Python, Java, or Haskell?

Yes, you can use formal specification derivation with Python, Java, Haskell, and other languages because the approach is entirely language-agnostic. The skill focuses on precondition and postcondition reasoning, making it applicable across any programming paradigm where correctness-critical code is required.

How do I verify recursive functions using algebraic data types?

Verifying recursive functions using algebraic data types requires applying structural induction to prove that your recursive logic satisfies the postcondition. This skill performs induction over algebraic data types, ensuring your recursive algorithm design is mathematically grounded and functionally correct across all input structures.