Works with the AI Agents you already use

    AI Code Diff & PR Hygiene Gate

    by Wasabi hu

    1

    Pure-Python unified-diff gate catching deleted test assertions, AI slop, hardcoded local paths, secrets, scope creep, and import boundaries.

    $5.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    AI Code Diff & PR Hygiene Gate

    AI Code Diff & PR Hygiene Gate

    Example session with this skill installed

    Run the offline PR hygiene and test-integrity gates on my staged diff (synthetic_dirty_pr.diff and synthetic_test_tamper.diff), list every failing rule ID and line number, and show how to fix or suppress intentional exceptions.

    • Read your context and instructions
    • Compiled the ai code diff

    Ran vet_diff_gate.py and audit_test_integrity.py offline on the two synthetic unified diffs (--format json). Both gates returned non-zero (ok: false).

    Stage 1 — PR Hygiene & AI Slop (vet_diff_gate.py, 3 files, 10 added lines: 3 errors, 1 warning)

    SeverityRule IDLocationFinding
    errorslop-guard/empty-exceptsrc/service.py:15Added empty broad except Exception: pass.
    errorslop-guard/ts-as-anysrc/client.ts:2Added as any type bypass.
    errorslop-guard/ts-ignoresrc/client.ts:3Added @ts-ignore / @ts-nocheck.
    warningpr-hygiene/lockfile-driftuv.lock:1Lockfile uv.lock modified without changing pyproject.toml.

    Stage 2 — Test Integrity (audit_test_integrity.py, 2 files: 3 errors)

    SeverityRule IDLocationFinding
    errortest-integrity/deleted-assertiontests/test_billing.py:5Commented out an existing test assertion.
    errortest-integrity/skipped-testtests/test_billing.py:7Added unconditional skipped/ignored test.
    errortest-integrity/assertionless-testtests/test_billing.py:11Newly added test function contains zero assertions.

    Commands Executed

    python3 scripts/vet_diff_gate.py synthetic_dirty_pr.diff --forbid-email ceo@example.com --format json
    python3 scripts/audit_test_integrity.py synthetic_test_tamper.diff --format json
    

    Next Steps

    1. Replace except Exception: pass with explicit error handling, remove as any / @ts-ignore, and verify whether pyproject.toml should change alongside uv.lock.
    2. Restore the commented assertion in tests/test_billing.py:5, remove the unconditional skip on line 7, and add an assertion to the new test on line 11.
    3. For an intentional, audited exception on a single line, add an inline suppression with the exact rule ID, e.g. // diff-gate:allow(slop-guard/ts-as-any) or # diff-gate:allow(pr-hygiene/abs-path).
    4. Re-run with --format sarif for CI/IDE integration.

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

    About this skill

    Coding agents often take shortcuts, such as commenting out failing tests, swallowing exceptions, or leaving hardcoded local paths in diffs. This skill provides a deterministic, zero-dependency gate that inspects unified diffs to enforce code hygiene and architectural boundaries before you commit.

    What it does

    • Slop detection flags empty exception handlers, TypeScript any escapes, and production debug macros like dbg!() or todo!().
    • Test integrity auditing catches deleted or commented-out assertions and newly added tests that lack actual validation logic.
    • Leak prevention identifies hardcoded local home directories, credential prefixes, and forbidden email addresses in the diff.
    • Architectural enforcement blocks forbidden cross-layer imports and ensures paired files, like schemas and generated artifacts, are updated together.
    • Scope control restricts edits to allowed directory globs and caps the total number of files an agent can modify in one pass.

    How it works

    1. Pipe the diff from git diff or a patch file directly into the script via stdin.
    2. Run specific auditors for general hygiene, test integrity, or architectural scope based on your needs.
    3. Review violations provided in standard agent text, JSON, or SARIF formats for CI integration.
    4. Apply suppressions using inline comments like # diff-gate:allow(...) for intentional exceptions.

    Frameworks & tools

    This skill uses Python 3.11+ standard library modules including ast, tomllib, and pathlib. It operates as a standalone utility with no external dependencies or network requirements.

    Why this beats prompting it yourself

    LLMs are notoriously bad at catching their own subtle "lazy" errors like missing assertions or silent try/except blocks. This tool uses deterministic AST and regex patterns to provide 100% reliable detection that doesn't cost tokens or suffer from hallucinations.

    Use cases

    • Preventing AI agents from quietly disabling tests to make a PR pass.
    • Blocking sensitive local file paths from entering the repository history.
    • Enforcing strict module boundaries in monorepos via import restrictions.
    • Verifying that generated code artifacts match their source definitions.

    Known limitations

    Does not replace full compilers or type checkers. Requires Python 3.11 or higher and does not execute git commands directly.

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

    Software
    PythonGit

    Permissions

    Terminal / Shell
    Read Files

    100% offline read-only Python 3.11+ standard library execution. Reads unified diffs from stdin or a file path plus optional read-only repo/TOML config and prints structured JSON, Markdown, or SARIF 2.1.0 to stdout. Zero network requests, zero subprocesses, zero environment variables, zero file mutations.

    Listed3 days ago

    What's inside

    Frequently Asked Questions

    This skill acts as a deterministic gate that inspects unified diffs to catch AI slop like empty exception handlers, deleted test assertions, and hardcoded local file paths that agents often introduce when trying to make code pass quickly.

    You only need Python 3.11 or higher. The skill is a zero-dependency utility that uses the Python standard library and does not require external packages, network access, or specialized software accounts.

    It provides violation reports in standard agent text, JSON, or SARIF formats for CI integration, and it supports a TOML configuration file to define custom architectural boundaries and file edit limits.

    The skill is not a replacement for full compilers or type checkers and it does not execute git commands directly; it requires you to pipe the diff output from stdin or a patch file.

    You can ask your agent to pipe its proposed git diff into the scripts to check for hygiene violations, test integrity issues, or architectural scope creep before it finalizes a commit.

    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.