Works with the AI Agents you already use

    Self-Healing Verify Loop

    by Rakgorak Rak

    1

    Tests pass, or your agent tells you exactly why: auto-detected test command, compact failure summaries and hard stop rules. No infinite loops, no fake "done".

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Self-Healing Verify Loop

    Self-Healing Verify Loop

    Example session with this skill installed

    Make the tests pass for the date-parsing change, and keep going until it's green.

    • Read your context and instructions
    • Compiled the self-healing verify loop

    Verification command: npm run typecheck && npm test (from package.json, npm).

    Attempt 1/3: FAILED (exit 1, 8.2s)

    FAIL test/parseDate.test.ts > parses ISO week dates
    AssertionError: expected 2026-01-05 to equal 2025-12-29
      at test/parseDate.test.ts:22:31
    

    Root cause: parseIsoWeek counts week 1 from Jan 1 instead of from the Monday of the week that contains Jan 4 (ISO 8601).
    Fix: computed the week-1 Monday from Jan 4 in src/parseDate.ts:57.

    Attempt 2/3: FAILED (exit 2, 3.1s)

    src/parseDate.ts(61,7): error TS2322: Type 'number | undefined' is not assignable to type 'number'.
    

    A different failure, so the fix made progress. I added the missing guard for an out-of-range week number.

    Attempt 3/3: PASSED in 9.0s

    #1 FAIL exit 1  8.2s  b5bd3d38bf7868dc
    #2 FAIL exit 2  3.1s  7586c078c8cfaaab
    #3 PASS         9.0s
    

    Summary

    • npm run typecheck && npm test now passes: 112 tests, 0 failures.
    • Changed: src/parseDate.ts (ISO week-1 rule, range guard). No tests were skipped or loosened.

    Next step: commit, or run Cross-Model Review on the diff first.

    from package.json

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

    About this skill

    AI agents waste time and tokens in two ways after writing code: they say "done" without running anything, or they retry the same broken fix again and again. This skill stops both with a bounded test → fix → re-test loop whose exit codes tell the agent to continue or stop.

    What it does

    • Auto-detects the right check: typecheck/lint + test with the correct package manager (npm, pnpm, yarn, bun), pytest, cargo, go vet + go test, dotnet, Maven, Gradle, make.
    • Compact failure summaries: thousands of log lines become the error lines, their context and stack frames, with ANSI colours stripped. Your agent reads the error, not the noise.
    • Failure fingerprinting: if a fix produces the same failure (ignoring timings, timestamps, addresses and line shifts), the loop stops with exit 5: no progress, report it.
    • Hard budget: 3 attempts by default, capped at 5.
    • Anti-cheating rules: the agent may not delete tests, loosen assertions, add ignore comments or swallow errors to get a green run. Environmental failures are reported, not "fixed".
    • Evidence: history shows every attempt's result and fingerprint for an honest final report.

    How it works

    1. node scripts/verify.mjs detect picks the check and the agent tells you which command it will run.
    2. node scripts/verify.mjs run runs it with a timeout and prints a failure summary.
    3. Exit 0 passed, 4 fix and retry, 5 stop (same failure twice), 6 stop (budget used).
    4. The agent reports exactly what it observed, with the attempt history.

    Frameworks & tools

    A single zero-dependency Node.js 18+ script. Works with Node, Python, Rust, Go, .NET, Maven, Gradle and Makefile projects on Windows, macOS and Linux.

    Why this beats prompting it yourself

    "Keep going until the tests pass" has no stop rule, so agents loop, burn tokens, or quietly weaken the tests. Deterministic exit codes and failure fingerprints make the agent stop at the right time and report honestly.

    Security

    Runs only your project's own verification command (detected from its manifest, or one you give) through the system shell, with a timeout that ends the whole process tree. Writes only .self-heal/log.json. No network calls of its own.

    Known limitations

    Needs a project with a runnable test, build or type-check command. It cannot fix environmental problems (missing services, credentials or network); it reports them instead.

    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 9 days ago

    Software
    Node.js 18+Python
    Optional
    Your project's own test toolchain

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables

    File Scopes

    .self-heal/**
    **

    Terminal: runs the project's own test/build command through the system shell (detected from package.json, pyproject.toml, Cargo.toml, go.mod and similar, or given explicitly), with a timeout. Environment Variables: the test process inherits the environment plus CI=1 and colour turned off; nothing is printed or stored. Write Files: .self-heal/log.json, plus the agent's code fixes. The script makes no network calls; your own tests may.

    Listed9 days ago

    What's inside

    Creator

    Rakgorak Rak

    Rakgorak Rak

    4 skills on Agensi

    Frequently Asked Questions

    This skill eliminates 'success hallucination' where agents claim to be finished without actually running tests. It forces the agent to interact with your real CLI tools, using failure fingerprinting to stop it from getting stuck in an infinite loop of the same mistake.

    The skill is language-agnostic and includes auto-detection for Node.js, Python, Rust, Go, .NET, and Java. As long as your environment supports Node.js 18+ to run the controller script, it can trigger almost any standard build or test runner.

    One zero-dependency Node.js script (scripts/verify.mjs) with detect, run, history and reset commands, plus a SKILL.md that teaches your agent the loop: how to choose the check, how to fix between attempts, the anti-cheating rules and how to report. Attempt history is written to .self-heal/log.json automatically.

    No, this skill is designed to work with your existing infrastructure. It automatically detects and uses the commands you already have defined, such as `npm test`, `pytest`, or `cargo test`, so you don't have to write new tests from scratch.

    Each failure summary gets a fingerprint that ignores timings, timestamps, addresses and line shifts. If a fix produces the same failure again, the script exits with code 5 and tells the agent to stop and report. The attempt budget (3 by default, capped at 5) ends the loop with exit code 6.

    New in Testing & Debugging

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.