Holy Trinity Testing: TLA+, Lean 4 and Bend 2 Bug Finder

    by Eris Margeta

    1

    When code handles money, storage, or complex timing, normal tests often miss the "one in a million" bugs that cause total failure.

    $10

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    What it does

    • Scans your folders to find which parts of your code are risky enough to need extra checking
    • Models how your code handles crashes and retries to find hidden timing errors
    • Proves whether your business rules hold up for every possible input without missing any cases
    • Creates real tests in your project language that recreate the exact steps of a discovered bug
    • Maintains a record of all found holes and the specific conditions needed to trigger them
    • Ensures every green result is backed by a negative test that proves the checker is actually working

    Who it's for

    Founders building complex systems like banks or databases

    Find the hidden errors in your logic that normal testing misses before they crash your business.

    Try asking: “Check my new payment ledger code for bugs that happen during server crashes.”

    Software teams managing high-risk codebases

    Strengthen your most critical features with math-based proof and targeted tests.

    Try asking: “Verify our distributed locking logic to make sure two users can't edit the same file.”

    Developers working on data storage or queues

    Catch rare timing issues and race conditions that only happen once in a million runs.

    Try asking: “Find why our background worker occasionally misses a task when it retries.”

    Holy Trinity Testing: TLA+, Lean 4 and Bend 2 Bug Finder

    Example session with this skill installed

    Check our database migration script to see if it can lose data if the server loses power halfway through.

    • Read your context and instructions
    • Compiled the holy trinity testing

    I will assess your migration script to see if it is a good fit for a formal check. **1. Assessment** Your script handles multi-step data moves. This is a good fit because a crash mid-operation could leave the database in a broken state. I will focus on the "move and verify" step. **2. The Promise** "A record is either in the old table or the new table, but never missing from both, even if the process stops at any line." **3. Modeling Results** I modeled the migration using two steps and a potential power failure. * **Status**: Hole Found (H-01). * **The Issue**: If the power fails after the delete but before the insert is confirmed, the record is lost. The current code assumes the delete always happens in the same transaction as the insert, but the connection pool is configured to auto-commit. **4. The Evidence** **I have created a new test file:** `tests/migration_failure_H01.test.js`. * This test forces a crash after the delete command. * **Current Result**: Fails (Data is lost). **5. Recommended Fix** You should wrap the delete and insert in an explicit database transaction. Once you apply this, we will run the check again to ensure the model stays green even under crash conditions. Would you like me to show you the specific lines to change for the transaction fix?

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

    About this skill

    When code handles money, storage, or complex timing, normal tests often miss the "one in a million" bugs that cause total failure. This skill finds those hidden cracks by using formal logic to check your designs. It looks for problems that only happen when a server crashes at the exact wrong time or when tasks happen in a weird order. Instead of just guessing, this skill models your riskiest logic and proves whether it can actually break. It focuses on things like payment flows, database rules, and messy retry loops. **How it works** 1. Your AI agent scans your code to see if it is a good fit for this deep check. 2. It picks one risky area, like how you save data, and writes down exactly what that code promises to do. 3. It creates a small model of that logic to test every possible order of events. 4. If it finds a failure, it helps you write a real, failing test in your own language to prove the bug exists. 5. It guides you through fixing the code and keeps the model as a guard to stop that bug from ever coming back. **What you get:** A report on the safety of your logic, a list of discovered holes, and new tests that catch rare crashes. **Source and paper** The method is open source on GitHub as "holy-trinity-testing", with five runnable examples, a CLI (npx holy-trinity) and the whitepaper "Serving, deploying, and testing enterprise code in the generative AI era" (8 pages). Nothing here guarantees a result: what you find depends on what you model and how faithfully. A green model means no counter-example within the checked bounds, not that the code is correct.

    This skill is for complex logic only. It is not for simple websites or UI code. It requires TLA+, Lean, or Bend tools to be installed to run the full checks.

    Uses TLA+ for concurrency/ordering, Lean 4 for rule proofs, and Bend 2 for executable model replays. It generates a trinity/ folder containing PLAN.md, HOLES.md, and expected.tsv to track verification state. It relies on a CLI tool (npx holy-trinity) for scaffolding and gating. Best suited for systems with ACID requirements, distributed state, or complex idempotency logic.

    How to use

    1. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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 1 day ago

    Software
    Node.jsholy-trinity
    Optional
    Java 11+ (TLA+ TLC)Lean 4Bend 2

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    This skill finds rare bugs that happen during server crashes, weird timing, or messy retries. It uses formal logic to check critical areas like payment flows and database rules where normal testing often misses "one in a million" failures.

    Your AI agent uses specialized tools named TLA plus, Lean 4, and Bend 2 to model your code. You do not need to provide anything extra, but the agent will check if these tools are available to run the deep checks.

    It is for high risk logic like data storage, payment ledgers, and systems where multiple tasks happen at once. It is not meant for user interfaces, simple data entry code, or code that changes every week.

    You receive a report on your logic safety, a list of discovered holes in your code, and new tests that prove the bugs exist. It also provides the specific fixes to close those holes and prevent the bugs from returning.

    You can ask your agent to verify or formally check a specific part of your code, such as a database or a payment queue. It will first scan your repository to tell you plainly if the code is a good fit for this type of deep analysis.

    A green result means no errors were found within the specific limits and rules defined for the model. It does not guarantee the entire program is perfectly correct, only that the specific logic path was checked against those rules.

    New in Code Quality & Review

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.