- Home
- Skills
- Code Quality & Review
- Strict Code Review
Works with the AI Agents you already use
Strict Code Review
Strict code review for Java/Spring and beyond: bugs first, then your repo's own conventions, naming contracts, SOLID, an over-engineering guard, repeated-literal and MyBatis checks.
Free
Strict Code Review
Example session with this skill installed
Review the staged changes on this branch against main with /strict-code-review. This is a Spring Boot billing service; follow our existing conventions.
- Read your context and instructions
- Compiled the strict code review
Verdict: REQUEST CHANGES
Scope: main..feature/refunds (+ index), 7 files, +196/−0. Fully reviewed.
Conventions applied
- Package-by-feature under
com.acme.billing.<feature>; shared code only incommon(CONTRIBUTING.md §1). - Every domain error extends
BillingException(ErrorCode, message);GlobalExceptionHandlermaps it (4 existing subclasses). - Logging: SLF4J,
private static final Logger log,{}placeholders (4 classes). - Money is the
Moneyrecord (BigDecimal+Currency), neverdouble. - Persistence is Spring Data JPA; no MyBatis dependency in
pom.xml. - Tests: JUnit 5 + AssertJ + Mockito, classes
*Tests, methodsshould…. - Not applied:
PaymentGatewayhas one implementation but isolates provider I/O — kept (OVER-INTERFACE guard).
| BLOCKER | MAJOR | MINOR | NIT |
|---|---|---|---|
| 3 | 5 | 6 | 0 |
BLOCKER
- [BLOCKER][BUG-MONEY / DP-TYPES]
controllers/RefundController.java:24-26,util/PaymentUtils.java:16-19— Refund amounts aredouble;total.doubleValue() < amountand the JSON body lose cents. Trigger: refund 0.10 three times against 0.30 → rounding leaves 0.0000000000000001 and the comparison flips. Fix:Money amount, compare withisGreaterThan. - [BLOCKER][SEC-INJECTION / MYB-SUBSTITUTION]
resources/mappers/RefundMapper.xml:9—ORDER BY ${sortColumn}splices caller input into SQL. Fix: mapsortColumnto an allow-list enum of sortable columns, or#{}with a fixed<choose>. - [BLOCKER][JAVA-EXC-SWALLOW / BUG-ERROR]
refund/RefundService.java:25-27—catch (Exception e) { // ignore }around the provider call: a 503 from Stripe returns HTTP 200 to the caller and the refund is silently lost. Fix: translate toPaymentProviderUnavailableException("stripe", e)asStripePaymentGatewaydoes.
MAJOR
- [MAJOR][CONV-EXC / JAVA-EXC-HIERARCHY]
RefundController.java:27,PaymentUtils.java:24—throw new RuntimeException(...)bypassesBillingException/ErrorCode; clients get a 500 with no code. Fix:RefundExceedsInvoiceTotalException extends BillingException. - [MAJOR][CONV-LOG / JAVA-LOG-FACADE / JAVA-LOG-CONCAT]
RefundService.java:10,:22— JUL loggerLOGGERwith string concatenation in an SLF4J repo. Fix:private static final Logger log = LoggerFactory.getLogger(RefundService.class); log.info("Refund {} completed", invoiceId);
[MAJOR][NAME-M2] RefundService.java:30 — getRefund performs a remote HTTP call; this module documents get* as cheap local reads and fetch* as remote. Fix: fetchRefundStatus.
7. [MAJOR][REP-CLOSED-SET / MODEL-ENUM-FIELD] RefundMapper.xml:8,13,19,24, PaymentUtils.java:29-32 — 'DONE', 'FAILED', 'PENDING' hard-coded five times in SQL plus lowercase "done"/"failed" parsing in Java while RefundStatus already exists; the copies already diverge in case. Fix: bind #{status} from the enum (name-based TypeHandler), parse with RefundStatus.valueOf, fail fast on unknown values.
8.
[MAJOR][CONV-DEP / BUG-WIRING] RefundMapper.xml:1-27 — MyBatis mapper in a Spring Data JPA module with no MyBatis dependency and no mapper interface: either dead or a second persistence stack. Fix: RefundRepository extends JpaRepository, or an ADR for the migration.
MINOR
- [MINOR][JAVA-SPRING-NO-LOGIC-IN-CONTROLLER / CONV-PKG]
RefundController.java:1,:25-29— business rule and repository call in a controller, in a newcontrollerspackage; move tocom.acme.billing.refund.RefundService, return aRefundResponserecord. - [MINOR][CONV-DI]
RefundController.java:17-21— field@Autowired; the repo uses constructor injection. - [MINOR][NAME-M3 / NAME-M5]
RefundController.java:24,RefundService.java:18—processRefund(..., boolean partial)→issueRefund(invoiceId, Money amount, RefundKind kind). - [MINOR][OVER-INTERFACE]
RefundPolicy.java:3,DefaultRefundPolicy.java:6— interface with one implementation, one caller, no boundary or invariant; keep the class. - [MINOR][MYB-FOREACH-EMPTY / BUG-LOGIC]
RefundMapper.xml:19-20—IN (<foreach>)with an empty list producesIN (); guard with<if test="invoiceIds != null and !invoiceIds.isEmpty()">. - [MINOR][CONV-TEST / TEST-MISSING]
RefundServiceTest.java:5-12— Hamcrest in an AssertJ repo, class*Test, methodtest1, and it tests the policy, not the service. Missing: refund rule, provider failure path, controller.
Checks run: scan_conventions.py --ref main (baseline profile above), scan_names.py --base main (5 candidates, 4 confirmed), scan_literals.py --base main (7 leads, 6 confirmed), mvn -q test on the baseline (green).
Questions: Is a refund allowed for OPEN invoices or only PAID? Should partial refunds change invoice state?
Connects securely to your tools. The creator never sees your data.
About this skill
A code-review skill for Claude Code, Codex, Devin, Factory Droid and any agent that reads SKILL.md. It reviews a pull request, branch, diff, staged change or set of files the way a strict Spring/Apache-style maintainer would.
What it checks, in order
- Correctness and security first — a concrete trigger, impact, location and fix for every bug (null paths, races, transactions, money as floating point, injection, swallowed exceptions, missing timeouts).
- Your repository's own conventions before defaults — packaging, modules, exception hierarchy, logging facade, naming vocabulary, dependency injection, test stack. A profiler reads the base commit, so new code is judged against what the codebase already does. One codebase, one way.
- Naming — methods are action verb + noun, booleans are predicates, types are named by role and context, and a name must not contradict its documented contract (
getthat does I/O,validatethat mutates). - Design — SOLID, DRY/KISS/YAGNI, Law of Demeter, Tell-Don't-Ask, CQS, layering, DDD, each with explicit "when not to flag" guards.
- Simplicity — every new interface, layer, pattern, option or wrapper needs a current justification; speculative abstraction is a finding, a justified boundary is not.
- Repeated literals and data carriers — a string or number repeated three times gets one owner; literals compared under one key become an enum; POJOs built field by field become records, value objects or builders. MyBatis (
${}substitution, map results, unguarded<foreach>), JPA, Spring, Python and TypeScript specifics included. - Java/Spring quality bar — API design, exceptions, logging, nullability, collections, concurrency, Spring proxies/transactions/JPA, Javadoc, Kotlin.
How it reports
Every finding carries a rule ID, a severity (BLOCKER / MAJOR / MINOR / NIT), evidence and the smallest safe fix, plus a Conventions applied section that says which repository rules were enforced and which defaults were deliberately not applied. Verdict: REQUEST CHANGES, APPROVE WITH COMMENTS or APPROVE. Review-only unless you ask it to fix.
What is inside
SKILL.mdworkflow with precedence rules (your instructions >.agents/review-overrides.md> documented repo conventions > observed conventions > defaults; correctness never yields)- 9 reference rulebooks loaded on demand
- 3 optional read-only Python scanners (git diff/show/ls-files/grep only; no network, no writes): convention profile, naming candidates, repeated-literal and MyBatis leads
- an overrides template for per-repository exceptions
- MIT license
Repository entry points for hosted PR bots (Codex GitHub review, Devin Review, Factory automated review) and a verification fixture are in the linked GitHub kit.
Scanners need Python 3.8+ and git; without them the agent reviews manually and says so. Deepest coverage is Java/Spring (plus MyBatis and JPA); other languages get the language-neutral rules. Review-only by default; edits happen only when you ask for fixes. Hosted PR bots (Codex GitHub review, Devin Review, Factory) keep their own filters and may show fewer findings than the interactive review.
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
This skill has been used 22 times.
Trust & safety
Security scan
Security scan passed 24 days ago
- Free with an Agensi account
Requires
Permissions
Terminal: runs git (diff, show, ls-files, grep) and the three bundled Python scanners, all read-only. Read Files: reads the reviewed repository. Write Files: only in fix mode, when the user explicitly asks the skill to fix findings; the scanners never write. No network, no environment variables, no credentials.