Works with the AI Agents you already use

    Code Security Diff Reviewer

    by Badung

    1

    Automated 6-axis security and logic audit for code diffs with ranked findings and minimal fix patches.

    $3.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Code Security Diff Reviewer

    Code Security Diff Reviewer

    Example session with this skill installed

    Review these staged changes for a FastAPI wallet service:

    +def withdraw(db, user_id: int, amount: int):
    +    user = db.query(User).get(user_id)
    +    user.balance -= amount
    +    db.commit()
    
    • Read your context and instructions
    • Compiled the code security diff

    I have reviewed the staged changes for withdraw in the wallet service. I found 2 [BLOCKER] issues and 1 [HIGH] issue.

    Security and Logic Review

    • [BLOCKER] RACE — Atomic Balance Update (wallet.py:3): The balance is decremented in memory after a simple get(). In a concurrent environment, two requests could read the same balance before the first commits, leading to a double-spend or incorrect final balance.
    • [BLOCKER] BOUNDARY — Missing Insufficient Funds Check (wallet.py:3): The code does not check if user.balance >= amount. This allows accounts to go into an unvalidated negative state.
    • [HIGH] BOUNDARY — Unchecked User Existence (wallet.py:2-3): db.query(User).get(user_id) will return None if the user does not exist, causing an AttributeError on the next line.

    Minimal Patch:

    def withdraw(db, user_id: int, amount: int):
        if amount <= 0:
            raise ValueError("Amount must be positive")
        
        # Use with_for_update to lock the row during the transaction
        user = db.query(User).filter(User.id == user_id).with_for_update().first()
        if not user:
            raise ValueError("User not found")
            
        if user.balance < amount:
            raise ValueError("Insufficient funds")
            
        user.balance -= amount
        db.commit()
    

    Next steps

    1. Test Concurrency: Pending local run — Use a script to fire 5 simultaneous withdrawal requests for the same user_id and verify only one succeeds if the balance is low.
    2. Validate Input: Ensure the amount parameter is validated as a positive integer at the API layer.
    3. Verify Constraints: Check if your database schema has a CHECK (balance >= 0) constraint as a secondary safety measure.

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

    About this skill

    Reviewing your own diffs is a recipe for missing the obvious. This skill acts as a consistent pre-commit gate for your code, catching security holes and logic flaws before they reach your main branch. It checks staged changes or pasted patches against six specific axes and returns severity-ranked findings with exact line citations and minimal patches.

    What it does

    • Security audits: Detects missing authorization checks (BOLA/IDOR), SQL injection, XSS, path traversal, SSRF, and exposed secrets in your diffs.
    • Boundary analysis: Identifies unchecked nulls and undefined values, integer/date off-by-one errors, and unhandled empty collections.
    • Concurrency checks: Finds check-then-act races, missing transaction boundaries, and non-atomic database updates.
    • Error handling: Flags swallowed exceptions, empty catch blocks, ignored error returns, and stack traces or secrets leaking in error responses.
    • Contract validation: Spots breaking API changes, renamed or removed response fields, and schema changes without backward compatibility.
    • Verification gap: Points out behavioral changes or bug fixes that lack a test covering the failure path.

    How it works

    1. Input the diff: Provide staged changes via git diff --staged, a branch diff, or paste a unified diff into the chat.
    2. Review the findings: The skill classifies issues as [BLOCKER], [HIGH], or [NIT], each with a file:line citation and the quoted offending line.
    3. Apply patches: Use the provided minimal patch for each [BLOCKER] and [HIGH] finding.
    4. Verify locally: Run the recommended commands to confirm the fix in your environment.

    Frameworks & tools

    Works with TypeScript/JavaScript (Next.js, Express, React), Python (FastAPI, Django), Go, Java/Kotlin, and SQL.

    Why not just a generic prompt

    Generic prompts tend to return vague "clean code" advice. This skill applies a fixed six-axis checklist so each review covers the specific failure modes — atomic updates, IDOR, silent failures, contract breaks — instead of depending on what the model happens to notice.

    Use cases

    • Reviewing an AI agent's output before committing it to your codebase.
    • A pre-PR security sweep for BOLA/IDOR issues in API routes.
    • Checking for breaking contract changes in service updates.
    • Finding missing test cases for changed logic branches.

    Known limitations

    Sees only the diff you provide, not the whole codebase; findings are based on the hunks plus any assumptions marked explicitly. Verification commands are listed as Pending local run unless you execute them.

    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.

    Frequently Asked Questions

    Unlike general-purpose coding assistants that focus on syntax or style, this skill uses a specialized six-axis audit framework to detect deep logic flaws like race conditions, BOLA/IDOR vulnerabilities, and breaking API contract changes that typical linters and LLMs overlook.

    The skill is designed to work with any AI agent or platform that supports text input. Simply pipe your `git diff` output or paste your patch file directly into the agent's interface to trigger the audit.

    No. The skill is a "zero-setup" tool: it needs no access to your private codebase or any environment configuration. Because it analyzes the diff itself, you can use it immediately by providing the output of a `git diff --staged` command or a pasted patch.

    You receive the complete Code Security Diff Reviewer skill file (SKILL.md) with the six-axis audit framework, the severity and output rules, both worked examples, and install instructions for Claude Code and Codex.

    The skill currently supports TypeScript, JavaScript, Python, Go, Java, and SQL. It is optimized for modern web frameworks such as Next.js, FastAPI, and Django, specifically looking for common vulnerabilities inherent in those architectures.

    The skill is highly effective at analyzing the immediate logic within a diff, but since it does not scan your entire codebase, it may not detect issues caused by distant dependencies. It is best used as a high-speed security gate before final manual PR reviews.

    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.