ds-java-review
Skill20 starsChanged 46 days agoMITView on GitHub
Review Java code with Tiger Style constraints and Java idioms.
In this repository52 other files it gives its agents.
- ds-dev-skill-benchSkill
- ds-agent-reviewSkill
- ds-architecture-planSkill
- ds-arenaSkill
- ds-blast-radiusSkill
- ds-blueprintSkill
- ds-bug-reviewSkill
- ds-clarity-reviewSkill
- ds-code-quality-reviewSkill
- ds-comment-reviewSkill
- ds-data-modeSkill
- ds-data-reviewSkill
- ds-debugSkill
- ds-deslopSkill
- ds-doc-quality-reviewSkill
- ds-exploreSkill
- ds-git-modeSkill
- ds-go-reviewSkill
- ds-grill-meSkill
- ds-handoffSkill
- ds-howSkill
- ds-humanizeSkill
- ds-interaction-modeSkill
- ds-notebook-reviewSkill
- ds-onboardingSkill
- ds-osvSkill
- ds-perf-planSkill
- ds-project-checkpointSkill
- ds-project-resumeSkill
- ds-python-reviewSkill
- ds-quality-gateSkill
- ds-reflectSkill
- ds-retroSkill
- ds-roadmapSkill
- ds-rust-reviewSkill
- ds-security-reviewSkill
- ds-semgrepSkill
- ds-shell-reviewSkill
- dsSkill
- ds-specSkill
- ds-step-modeSkill
- ds-tdd-modeSkill
- ds-test-modeSkill
- ds-test-quality-reviewSkill
- ds-tiger-style-modeSkill
- ds-tldtSkill
- ds-ts-reviewSkill
- ds-ui-modeSkill
- ds-ui-quality-reviewSkill
- ds-verify-thisSkill
- ds-zig-reviewSkill
- ds-zoom-outSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Use the checklist as a lens, not a scorecard: reason about the actual change, report real violations anchored to file:line, and flag issues …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Applies to: Java 21+ (LTS). Backend services, APIs, CLIs.
Arguments
Scan the invocation for the --no-tiger, --fix, and --full flags. Treat every other argument as review scope (files or directories); if no scope is given, review the changed files on the current branch.
--no-tigerpresent → skip the Tiger Style section; run Java Idioms, Performance, Security, and Testing only.--no-tigerabsent → run all sections (default).--fix→ after reporting, apply only the violations whose fix is mechanical and unambiguous (a rename to the idiom, a missing error check the review is certain about). Anything that changes logic or rests on an unverified assumption — especially security and correctness findings — stays report-only. After applying, re-run any build/test/lint check already in the loop and revert any fix that breaks it — or that touched more than the intended mechanical edit. End with a summary of what was applied and what was left.--full→ review the entire codebase instead of just the branch's changes. Explicit positional scope still wins;--fullonly replaces the no-scope default.
Example: /ds-java-review --no-tiger src/main/ src/test/ reviews both trees without Tiger Style.
Review Checklist
Use the checklist as a lens, not a scorecard: reason about the actual change, report real violations anchored to file:line, and flag issues even when they aren't listed. Don't manufacture findings to fill a category. Report only violations — no praise, no summary.
Tiger Style
Skip this section entirely if --no-tiger was passed. Otherwise it is mandatory.
- Non-trivial methods validate preconditions and key invariants (
Objects.requireNonNull, guard clauses,assertfor internal invariants) — don't demand checks in trivial getters or thin wrappers - All loops over external input have explicit bounds; no unbounded iteration
- No recursion without provable termination
- All exceptions handled or propagated deliberately — no empty
catchblocks, no swallowed errors - No post-initialization allocation in paths actually identified as hot — don't flag ordinary allocation
- Methods under 70 lines
- Variable names include units/qualifiers where applicable
Java Idioms
recordfor immutable data carriers instead of hand-written boilerplate classessealedinterfaces/classes with exhaustiveswitchpattern matching for closed hierarchies;switchexpressions over statement chains- Immutability favored:
finalfields,List.of/Map.of/unmodifiable collections; internal mutable collections not exposed Optionalused only as a return type — not as a field or parameter; no.get()without a presence check- No
nullreturned for collections/arrays/strings — return an empty value; references treated as non-null by default and validated at boundaries (Objects.requireNonNull) - Resources closed with try-with-resources, not manual
finallyonAutoCloseable - Catch the most specific exception; no
catch (Exception)/Throwablecatch-all unless re-raising; cause preserved (new X("ctx", e)) - Streams used for transformation without side effects in
map/filter— and a plain loop preferred where a stream would be contorted varonly where the right-hand side makes the type obvious- Blocking per-request work runs on virtual threads (
Thread.ofVirtual/Executors.newVirtualThreadPerTaskExecutor, final in 21), not a tuned bounded platform-thread pool — virtual threads aren't pooled; on 21–23 asynchronizedblock held across a blocking call pins the carrier (useReentrantLock), which JDK 24+ removes (JEP 491) - No
staticmutable shared state; constants arestatic final
Performance
Idiom-level checks only — for a ranked, costed optimization plan, use /ds-perf-plan.
- No allocation or boxing in hot paths that profiling has identified (autoboxing in tight loops,
Stringconcatenation in loops →StringBuilder) - Collections pre-sized with a known capacity (
new ArrayList<>(n),new HashMap<>(n)) - Database queries not issued inside loops; N+1 patterns absent
- Streams not materialized to intermediate lists unnecessarily; large data streamed rather than fully buffered
Security
- No string-built SQL (concatenation/
String.format) — usePreparedStatementparameters or the ORM - No command injection via
Runtime.exec/ProcessBuilderwith unsanitized input - No unsafe deserialization of untrusted data (Java native serialization, unconfigured XML/YAML parsers); XML parsers disable external entities (XXE)
- Filesystem paths from user input validated and confined to an expected root — no path traversal
- No hardcoded credentials or secrets; read from env/secret store
- All external input validated and bounded at the boundary; network/HTTP calls set timeouts
Testing
- Public surface and error paths have meaningful coverage — flag notable gaps, not every untested accessor
- Error paths tested with
assertThrows, not just the happy path - Input variants parametrized (
@ParameterizedTest) rather than copy-pasted - No real network/filesystem in unit tests — fakes/mocks and
@TempDir; noThread.sleepto coordinate — await latches/futures with a timeout
Version-specific checks
Read the target version from the build (release in Gradle/Maven, or the toolchain). Run the checklist above for every project. If it targets Java 25 or newer, also read 25.md in this skill directory and apply its checks on top. If the version can't be determined, run the base and note that version-specific checks were skipped.
Output Format
<file>:<line>: <severity>: <problem>. <fix>.Severity levels: critical (correctness/security), major (reliability/performance), minor (idiom/style).
Skip formatting nits unless they affect correctness or readability significantly.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

