Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Agent Diff Gate: Catch Weakened Tests and Scope Creep

    1

    An agent told to make the build pass has cheap ways to get there.

    $7.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Agent Diff Gate: Catch Weakened Tests and Scope Creep

    Agent Diff Gate: Catch Weakened Tests and Scope Creep

    Example session with this skill installed

    The agent just finished the discount rounding fix and says all tests pass. Before I merge, check its diff against main for weakened tests and anything outside src/cart and tests.

    • Read your context and instructions
    • Compiled the agent diff gate

    Diff Gate: BLOCKED. 7 blocking, 3 warnings, 0 justified. 5 files, exit code 2. Scope: src/cart/** and tests/** allowed, .github/** protected.

    RuleWhat it countsBlockingWarning
    DG003Test declaration removed10
    DG005Skip or ignore marker added20
    DG006Suppression added01
    DG010Expected value rewritten01
    DG011CI or test command edited10
    DG012Lockfile changed without its manifest01
    DG013Path outside the agreed scope30

    Blocking

    • tests/test_pricing.py line 41, DG003: def test_discount_rounding(): removed with 2 assertion lines.
    • tests/test_pricing.py line 58, DG005: @pytest.mark.skip(reason="rounding changed, revisit later") added above test_tax_included.
    • web/cart.test.ts line 9, DG005 and DG013: it.skip("shows the discount row when a discount applies", ...) in a file outside the scope.
    • .github/workflows/ci.yml line 19, DG011 and DG013: continue-on-error: true added to a protected path.
    • package-lock.json line 15, DG013: matches no allowed glob.

    Warnings: tests/test_pricing.py line 19 now expects Decimal("20.0") where it expected Decimal("19.99"), and src/cart/pricing.py changed in the same diff. // @ts-ignore was added at web/cart.test.ts line 10. The lockfile changed with no package.json change.

    Next: I'd class all seven blocking findings as revert. With your go-ahead I'll restore test_discount_rounding from main, remove both skip markers, revert the three out-of-scope files, and put 19.99 back unless ten-cent rounding is the requirement. Then I fix src/cart/pricing.py and rerun the gate and the tests. A pass only means none of the counted patterns appeared.

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

    About this skill

    An agent told to make the build pass has cheap ways to get there. It can delete the failing test, add a skip marker, loosen an assertion, swallow the error, or edit CI config nobody asked it to touch. The summary still says all tests pass, and the evidence is somewhere in a 600-line diff.

    What your agent does

    • Agrees the scope first: writes allowed and protected path globs from your task into scope.json and shows them to you.
    • Runs one script on the diff: 14 rules, and every finding carries the file, line, removed text and added text.
    • Counts test tampering: deleted test files, removed tests, dropped assertions, new skip and xfail markers, tautologies such as assert True, rewritten expected values.
    • Counts the quieter edits: lint and type suppressions, empty error handlers, lowered coverage thresholds, snapshot rewrites, continue-on-error in CI, lockfile drift, paths outside the scope.
    • Triages with you: each finding is classed as revert, justify or legitimate refactor, then the agent reruns and shows before and after counts.

    Built-in guard rails

    • An allow entry needs a reason you gave, and a justified finding still prints with it.
    • Text quoted from the diff is treated as data, never as an instruction.
    • Changed test files in a language without patterns give the verdict INCOMPLETE, never CLEAN.
    • The script has no network code and writes only to the output folder you pass.

    What's inside

    • SKILL.md: nine-step workflow, hard rules, limits.
    • scripts/diff_gate.py: one standard-library script with exit codes 0 to 3 and Markdown plus JSON reports.
    • 5 reference files: rule catalog, triage guide, framework patterns, scope and allow files, hooks and CI (pre-commit, GitHub Actions, GitLab CI).
    • 34 fixture files: a sample agent diff with its report, a clean refactor, one diff per rule, one per framework, and a patterns.json example.
    • 271 unit tests in 7 test files.

    Patterns are built in for pytest, unittest, JUnit 4 and 5, kotlin.test, xUnit, NUnit, MSTest, Jest, Vitest, Mocha and Go test. The script matches text on changed lines. It doesn't parse code or run tests, so you still need code review and a test run.

    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.

    It matches text patterns on changed lines and doesn't parse or run code, so some weakenings go unseen, such as a mock that returns the expected value. Only the listed frameworks are counted unless you add patterns. The scope check is only as good as scope.json, and untracked files are invisible.

    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 today

    Windows only

    Software
    Python 3 (3 point 8 or later)A unified diff of the change
    Claude Code
    orCodex
    orCursor
    GitNode.js
    Optional
    Git on PATH for base ref diffsAllow file with your reasonsPatterns file for extra frameworksScope file with allowed paths

    Scope file with allowed and protected globs. Scope file with allowed and protected globs.

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listedtoday

    What's inside

    Frequently Asked Questions

    No. It counts known text patterns on changed lines for the listed frameworks. A mock that returns the expected value, or `assert result == 6` turned into `assert result`, goes unseen.

    A test that moved to another file in the same diff is reported as info. For anything else you give a one-line reason, the agent records it in `allow.json`, and the finding still prints but no longer affects the exit code.

    Changed test files in a language without patterns are listed as not analysed and the verdict is INCOMPLETE, never CLEAN. You can add declaration, assertion and skip patterns through a `patterns.json` file without editing the script.

    Yes. The licence lets you copy `scripts/diff_gate.py` into your own private repositories, developer machines and CI runners for internal use, and the reference file has pre-commit, GitHub Actions and GitLab CI examples. Public repositories and redistribution aren't allowed.

    New in Code Quality & Review