- Home
- Skills
- Code Quality & Review
- Diff Risk Brief — Review the Risky Files First
More screenshots
Works with the AI Agents you already use
Diff Risk Brief — Review the Risky Files First
Reads a unified diff and ranks the files that deserve careful review first: auth, money, migrations, lockfiles, large edits and changes with no test moving with them.
Free
Diff Risk Brief — Review the Risky Files First
Example session with this skill installed
git diff main...HEAD > change.diff
python3 scripts/diff_brief.py change.diff --fail-on high
diff --git a/src/auth/session.ts b/src/auth/session.ts
--- a/src/auth/session.ts
+++ b/src/auth/session.ts
@@ -1,6 +1,30 @@
-const token = session.token;
+const rotated = rotate(session.token, key);
+if (!session.expiresAt || session.expiresAt < now) {
- throw new AuthError('expired session');
+}
- Read your context and instructions
- Compiled the diff risk brief
diff-risk-brief 8 files 987 changed lines
score 21/100 grade F findings 12
high 5 medium 3 low 4
REVIEW ORDER
- src/search/rank.ts high 457 lines 457 changed lines in one file.
- package-lock.json high 220 lines Dependency or dependency lockfile change.
- src/billing/refund.ts high 179 lines Touches money movement (179 changed lines).
- db/migrations/0042_add_invoices.sql high 41 lines Touches schema or migration change (41 changed lines).
- src/auth/session.ts high 33 lines Touches authentication or session code (33 changed lines).
- config/prod.ts medium 15 lines Touches configuration.
- src/utils/format.ts low 23 lines No matching test file changed with this source edit.
- README.md ok 19 lines no risk rule fired
VERDICT: REVIEW THE RISK FILES FIRST
Connects securely to your tools. The creator never sees your data.
About this skill
Most reviews read a diff file by file. Reviewers do not have equal attention, and a README edit does not deserve the same reading as a refund path. This turns the patch into a review order before anyone opens the pull request.
It reads a unified diff and ranks each changed file by evidence a reviewer can check:
- Files touching auth, sessions, payments, billing, migrations or deployment are moved to the front
- Large edits are split out: 150+ changed lines is a prompt, 400+ is a finding
- New source files with no matching test in the diff are named
- Deleted test files are flagged before the coverage quietly falls
- Lockfiles, manifests, environment files and production config get their own check
- Deletion-heavy files are marked, because removed branches are easy to miss
- A source edit with no test moving with it becomes a question for the author
The output has two blocks: the order to read, then the findings with a fix written as a review action. Every finding is something the patch shows, not a guess about the author.
The shipped failing diff is eight files and 987 changed lines: 12 findings, five high, a refund path, a schema migration, a 457-line ranking change, a lockfile and an auth file. Score 21/100, exit 1. The clean diff is two files with a matching test and scores 100.
Good to know: this is static analysis of the patch. It cannot know whether a change is correct, who owns the file, or whether a test already exists outside the diff. "No test in this diff" is a question, not proof. The 200/250-line review evidence comes from observational studies, not a universal cutoff. It does not clone the repository or execute code. Use it to decide where to look, not as a defect prediction.
Cannot verify tests outside the current diff. Static path and size rules only. Excludes docs, images, and binary changes. Requires Python 3.10+.
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 any payment.
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 forever
No account required to browse
Trust & safety
Security scan
Security scan passed 1 day ago
- Free with an Agensi account
Requires