Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseOpenClawOpenClaw+21 more

    Formal Correctness Engineer

    1

    Turns your agent into an adversarial correctness engineer: explicit specs, complexity bounds, refusal of invalid premises, and testable code.

    Free

    1 installSecurity scanned
    Formal Correctness Engineer

    Formal Correctness Engineer

    Example session with this skill installed

    I'm designing a metrics ingestion path for our payments service and need a defensible review before we ship. Please act as an adversarial correctness engineer on this design: a single Python worker consumes an unbounded Kafka stream of transaction amounts (floats in dollars) and maintains a rolling average of the last 5,000 events in memory, then a gRPC endpoint exposes it. Our SLO is p99 read latency under 2 ms and under 50 MB RAM per worker. I'm worried about floating-point drift on the running sum and about what happens when the stream stalls or the worker restarts. Give me the full spec, verdict, resource bounds, a reference implementation with no placeholders, the checks I should run, and the exact conditions under which your answer stops holding.

    • Read your context and instructions
    • Compiled the formal correctness engineer

    Summary

    The design is conditionally valid: a circular buffer with Kahan-compensated summation meets the latency and memory SLO exactly, but restart durability and stall semantics must be specified explicitly rather than assumed.

    MetricBefore (naive sum)After (bounded Kahan)
    Read complexityO(cap) recomputeO(1)
    RAM per workerunbounded list, ~38 MB growth5,000 slots, < 1 MB
    Drift at 1e7 events~1e-9 relative, unbounded sign~1e-16 per update, bounded
    Restart behavioraverage lost, silently wrongrejected: requires offset checkpoint

    VERDICT: conditional. MODEL: ring buffer + compensated accumulator, sequence-numbered reads. ARTIFACT: BoundedMean class with push(), mean(), finite-value validation, and reset. CHECKS: capacity-1 identity, NaN/inf rejection, conservation of push count, monotonic window eviction. LIMITS: breaks if amounts arrive as non-finite floats, if cap exceeds 10^7 slots, or if readers require exactly-once across restarts without offset replay.

    Next steps

    • Persist consumer offset and replay the last cap events on restart
    • Switch amounts to integer cents to eliminate binary rounding at the source
    • Add a property test comparing incremental vs. recomputed means over 10^5 random pushes

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Stop shipping code that only works on the happy path. This skill transforms your agent into an adversarial correctness engineer that prioritizes machine-checkable evidence over vague reassurances. It forces explicit specifications, identifies mathematical impossibility early, and produces implementations with defined resource bounds.

    What it does

    • Formal Specification defines input domains, error semantics, and consistency models before writing code.
    • Complexity Analysis calculates time and space bounds for every algorithm to ensure it meets your performance budget.
    • Invariant Enforcement selects data structures that make invalid states unrepresentable and maintains clear state transitions.
    • Failure Visibility implements explicit error channels and observability rather than swallowing exceptions.
    • Verification Strategy generates testable properties like idempotence, monotonicity, and stability for critical logic.

    How it works

    1. Analyze constraints by mapping your request to specific problem classes and checking known lower bounds.
    2. Review premises to identify invalid assumptions, such as using regex for nested markup or exact streaming medians without storage.
    3. Build models using the Algorithmic Decision Ladder to select the most efficient representation for your data.
    4. Implement artifacts with runnable code that includes Kahan compensation for floats or ownership-aware concurrency.

    Frameworks & tools

    Language agnostic with specialized knowledge in Rust, Ada/SPARK, Julia, C++, Python (fractions/NumPy), and formal tools like Z3 or TLA+ concepts.

    Why this beats prompting it yourself

    Generic prompts often lead to "clever" code that fails at the edges. This skill enforces a rigid response pattern (SPEC, VERDICT, MODEL, BOUND) that prevents silent approximations and forces the agent to prove its work.

    Use cases

    • Auditing concurrent algorithms for race conditions or memory ordering issues.
    • Building high-precision financial systems using exact rational arithmetic.
    • Designing streaming data pipelines with fixed memory ceilings and backpressure.
    • Verifying parser logic for complex, nested data structures.

    Known limitations

    This skill focuses on algorithmic and systems correctness, not aesthetic UI design or creative writing. It requires standard IEEE arithmetic for floating-point compensation to be effective.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    1 install

    Downloaded by developers to date

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean today

    • Free to download with an account

    Listedtoday

    What's inside

    Frequently Asked Questions