- Home
- Skills
- Code Quality & Review
- Code Security Diff Reviewer
Works with the AI Agents you already use
Code Security Diff Reviewer
by Badung
Automated 6-axis security and logic audit for code diffs with ranked findings and minimal fix patches.
$3.99
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 simpleget(). 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 ifuser.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 returnNoneif the user does not exist, causing anAttributeErroron 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
- Test Concurrency:
Pending local run— Use a script to fire 5 simultaneous withdrawal requests for the sameuser_idand verify only one succeeds if the balance is low. - Validate Input: Ensure the
amountparameter is validated as a positive integer at the API layer. - 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
- Input the diff: Provide staged changes via
git diff --staged, a branch diff, or paste a unified diff into the chat. - Review the findings: The skill classifies issues as
[BLOCKER],[HIGH], or[NIT], each with afile:linecitation and the quoted offending line. - Apply patches: Use the provided minimal patch for each
[BLOCKER]and[HIGH]finding. - 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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 8 days ago
- Software
Git
Permissions
What's inside
Frequently Asked Questions
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.