Works with the AI Agents you already use

    Test Gap Finder: Test the Risky Code First

    by Abhineet Sharma

    1

    Ranks your untested code by real risk (untested lines and branches, complexity, how often it changes, auth/payment/delete logic) from your coverage report, then writes behaviour tests that are proven to catch breakage.

    Free

    Security scanned

    What it does

    • Identifies untested code that handles risky tasks like payments or deleting data
    • Ranks code by how often it changes and how complex the logic is
    • Writes behavior tests that follow your existing project style and fixtures
    • Verifies new tests by temporarily breaking code to ensure they catch the error
    • Reports potential bugs found during testing instead of just hiding them

    Who it's for

    Founders with a growing codebase

    Find and fix the blind spots in your app where bugs are most likely to hide.

    Try asking: “Find the riskiest untested parts of my app and write tests for them.”

    Freelance developers taking over old projects

    Quickly understand which parts of a messy project have no safety net before you start changing things.

    Try asking: “Rank the most dangerous untested code in this new repo.”

    Small dev teams focused on stability

    Stop guessing what to test and focus your time on code that handles money, logins, or deletes data.

    Try asking: “Look at my coverage report and tell me what critical features are missing tests.”

    Test Gap Finder: Test the Risky Code First

    Test Gap Finder: Test the Risky Code First

    Example session with this skill installed

    Our Python service has bad coverage. Find what matters most and write tests for the top targets.

    • Read your context and instructions
    • Compiled the test gap finder

    Ran: pytest --cov=shop --cov-branch --cov-report=json, then gaps.py --coverage coverage.json

    score cov% miss br cx chg function risk words

    1 51.43 0.0 11 10 7 2 refund_payment (shop/billing.py:5-15) NEVER RUN admin,order,pay,permission,refund
    untested lines: 5-15
    2 9.39 50.0 3 3 3 2 apply_discount (shop/billing.py:17-22) discount,price
    3 8.01 20.0 4 2 2 2 Report.render (shop/billing.py:25-29)

    Coverage: 37.9% -> 93.1% lines (targets: 3 functions)

    Function Before After Tests added Mutations caught

    1 refund_payment 0% 100% 6 3/3
    2 apply_discount 50% 100% 3 2/2

    Possible bug found (not fixed): refund_payment caps the amount at order.paid, but marks every refundable item as refunded even on a partial refund (billing.py:11-13). Intended?

    Files: tests/test_billing.py (+9 tests). git diff shows test files only.

    then gaps.py --coverage coverage.json

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

    About this skill

    Coverage percentage is a vanity number. 80% coverage with the refund logic untested is worse than 60% with it nailed down. This skill finds the untested code most likely to hurt you and writes tests that actually catch bugs.

    The ranker (gaps.py, stdlib only, read-only, no network)

    • Reads the coverage report you already have: coverage.py / pytest-cov JSON, Istanbul (Jest, Vitest, nyc) JSON, lcov (c8, Jest, Vitest, pytest-cov and tools for Go/Rust), and Cobertura XML. Auto-detects the format.
    • Maps uncovered lines and branches to the functions that contain them (Python via the AST; JS/TS via the report's function map), handling nested functions, methods and module-level code.
    • Scores each function by: share of untested lines, untested branches, complexity, git churn (how often the file changed recently), and risk words in the code (auth, permission, payment, refund, price, delete, migrate, parse, validate, webhook, retry, rate limit...).
    • Flags functions no test runs at all, and prints the exact untested line ranges so you know which behaviours are missing.
    • No coverage yet? Static mode lists Python functions that no test file even mentions.

    The workflow

    1. Generate coverage with your existing setup (commands included for pytest, coverage.py, Vitest, Jest, c8, Go).
    2. Rank, then sanity-check the list: promote money/auth/data-deletion code, demote thin wrappers and generated code.
    3. For each target, list behaviours (happy path, every branch, boundaries, error paths, side effects) and write one clearly-named test each, in your framework and style, mocking only at the edges.
    4. Prove the tests work: temporarily break the code (flip a condition, shift a boundary) and confirm a new test fails, then revert. Tests that can't fail get strengthened.
    5. Before/after coverage for the targets, and a list of possible bugs found. It reports bugs instead of writing tests that bless them, and never edits production code to make tests pass.

    Free, no API keys.

    Needs a coverage report from your test suite (static mode is a rough fallback for Python only). The risk score is a heuristic to prioritise, not a bug detector. Doesn't build end-to-end test suites from scratch or refactor code to make it testable (it suggests those). Installing coverage tooling, if missing, needs your OK.

    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

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 6 days ago

    • Free with an Agensi account

    Software
    Python 3.9+Your project's test runner
    Optional
    Git (for churn ranking)Coverage tooling (pytest-cov, @vitest/coverage-v8, c8)

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    Coverage
    reports
    and
    source
    files
    (read-only)
    Test
    the
    agent
    adds
    (write)

    gaps.py is stdlib-only, read-only and makes no network calls; it runs read-only git log for churn. The agent writes only test files, temporarily mutates source to prove tests can fail and reverts every change (verified with git diff), and never edits production code to make tests pass.

    Listed6 days ago

    What's inside

    Frequently Asked Questions

    coverage.py JSON (pytest-cov --cov-report=json), Istanbul coverage-final.json (Jest, Vitest, nyc), lcov.info (c8, Jest, Vitest, pytest-cov, and converters for Go/Rust), and Cobertura XML. The format is detected automatically.

    Only test files. To prove a test works it temporarily breaks the code (e.g. flips a condition), checks a test fails, then reverts and confirms with git diff. It never edits production code to make tests pass.

    That may be a real bug. The skill reports it (file, line, input, expected vs actual) and asks you, instead of rewriting the test to match the buggy behaviour.

    Untested share of the function, untested branches, complexity, how often the file changed in git recently, and whether the code touches auth, payments, deletion, parsing and similar. It's a prioritisation heuristic you can override.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.

    Free