| name | jaipilot-review-diff |
| description | Review a complete Java Git change for behavioral regressions, unnecessary code, compatibility risk, and missing proof using repository-native checks. Use for pull-request or pre-commit review, changed-code risk, architecture drift, regression analysis, or a request to verify a Java change. |
Review a Java diff
Review the complete requested change, not only the most obvious file. Use repository-native evidence
and keep the host agent in control.
Establish the boundary
- Confirm that the selected root contains a Java Maven or Gradle project. If it does not, report
that this skill is not applicable and stop.
- Read the repository's AGENTS.md, contribution guide, build files, and relevant module
instructions.
- Record git status --short, the current revision, and the comparison base. Never fetch or change
branches unless the user asks.
- Include staged, unstaged, and untracked Java, test, build, wrapper, and configuration files.
In a multi-module repository, include every affected module.
- Preserve all unrelated work. Never run reset, checkout, clean, stash, or broad formatting to
manufacture a clean diff.
Review
- Read every changed production file, relevant tests, and directly affected contracts.
- Look for incorrect behavior, missing edge cases, compatibility breaks, unsafe resource or
concurrency behavior, architecture drift, dead code, duplication, needless abstractions, and
unrelated edits. For normalization, lookup, sorting, collection, or caching changes, explicitly
compare nulls, empty values, duplicates and multiplicity, locale or Unicode, ordering,
exceptions, identity, mutability, and missing-value behavior. A bypass of a public accessor or
derived view must prove the skipped copy, sort, validation, and exception timing, including a
malformed later element after an earlier match; otherwise reject it even when ordinary tests and
benchmarks pass.
- Prefer deletion and reuse. Keep only lines required by the request or its proof.
- Treat repository-configured compiler checks, Checkstyle, PMD, SpotBugs, Error Prone, ArchUnit,
SonarQube reports, and similar tools as evidence. Do not invent equivalent findings when a tool
is absent.
- Make corrections only when the user asked for implementation. Otherwise report findings with
file, location, impact, and the smallest reasonable fix.
- For JDK, wrapper, plugin, framework, BOM, or dependency edits, verify authoritative stable
release selection, migration requirements, resolved graph changes, runtime compatibility, and
the repository's downstream-consumer baseline. Reject unrelated version churn.
Verify
- Use the repository wrapper and documented commands. Run focused tests while iterating.
- Run the normal module or repository verification command after the diff stabilizes.
- Run configured JaCoCo, PIT, ArchUnit, OpenRewrite, or static-analysis tasks when they apply.
Do not add plugins, dependencies, exclusions, suppressions, or weaker thresholds merely to pass.
Inspect declarations, executions, profiles, and lifecycle bindings before calling configured
evidence unavailable. If implementation was requested and a new durable ArchUnit rule would
materially help, follow the
jaipilot-clean-java tool procedure. For a justified bounded
migration, invoke jaipilot-openrewrite. Obtain approval before adding either tool.
- Confirm that changed tests actually executed. For behavior-sensitive production edits, require
focused coverage of the affected contract and edge cases. Review tests for observable assertions.
Do not infer test quality from a green build or line coverage alone.
- Re-read the final diff after verification and check that generated output did not enter it.
- If a command cannot run, report the exact failure and leave that property unavailable.
- Use
jaipilot-fast-execution for substantial command work whenever safe batching or bounded
native parallelism can reduce wall time without changing the required proof.
- Default focused tests, analyzers, coverage, mutation testing, and final verification to the
jaipilot-remote-java skill whenever the laptop provides no concrete advantage under that
skill's routing rules. Remote proof covers only the uploaded tracked and unignored working tree;
upload the latest state again after any relevant local correction.
Report
Return:
- revision, comparison base, modules, and files reviewed;
- findings ordered by severity, followed by extra or unnecessary code;
- edits made and why each was necessary;
- exact commands and whether each passed, failed, skipped, or was unavailable;
- test execution, coverage, mutation, architecture, and analyzer evidence when measured; and
- residual risks and unverified boundaries.
Do not claim that the change is correct solely because the build passed.