lang-java
Skill0 starsChanged 7 days agoMITView on GitHub
Use when writing, reviewing, testing or setting up Java backend code in a loops run (the java language pack) - toolchain, layout, race policy, coverage, idioms and footguns.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- alexderz/agentic-toolboxtheir own version, first seen Oct 17, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- alexderz/agentic-toolbox★ 5same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skills/work/platforms/claude.mdCLAUDE.md
- llms.txtllms.txt
- clarifySkill
- consistencySkill
- debuggingSkill
- documentationSkill
- featureSkill
- hexagonalSkill
- initSkill
- jobs-and-state-machinesSkill
- lang-clojureSkill
- lang-cppSkill
- lang-csharpSkill
- lang-elixirSkill
- lang-erlangSkill
- lang-goSkill
- lang-kotlinSkill
- lang-phpSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-scalaSkill
- lang-swiftSkill
- lang-typescriptSkill
- memorySkill
- parallel-workSkill
- performanceSkill
- qualitySkill
- reportSkill
- review-integrationSkill
- statusSkill
- testingSkill
- workSkill
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 40
Always use the wrapper (JAVA-REPO-03).
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Java backend (the java pack)
JDK 25 LTS (27 current, 21 floor for libraries), Maven 3.9/3.10 base with a Gradle variant, JUnit 6, Spring Boot 4.1 as the dominant framework. As of 2026-11. Rule book: specs/languages/java/RULES.md (IDs JAVA-<SEC>-NN). Pack data: specs/languages/java/pack.json (loops lang show java).
When it applies
loops lang detect reports java: a pom.xml, build.gradle.kts or build.gradle at the root, and no src/main/kotlin (that goes to the kotlin pack). The Gradle variant is picked when a build.gradle* file exists. Multi-module reactors and multi-project builds are one pack root; the tool aggregates modules, loops does not iterate them.
Project rules first
The repo's own config beats the pack defaults: its Checkstyle/PMD/SpotBugs rulesets, .editorconfig, Spotless or formatter settings, .mvn/maven.config, gradle.properties, the framework it already uses (Spring, Quarkus or Micronaut: JAVA-FW-07), its test conventions and JDK pin. Read config_files from the pack before coding. Every time you follow a project rule over a loops rule, log it: loops run override --rule "<loops rule>" --project "<project rule, file:line>" --note "<what you did>" (ROLES.md "Project rules first").
Toolchain the gate runs
Agents run loops gate (all checks) or loops gate --only <check>,... while iterating. The checks, in order (Maven form; the Gradle variant uses ./gradlew --no-daemon <task>):
| Check | Command | Required |
| build | ./mvnw -B -ntp -DskipTests verify (falls back to mvn without a wrapper) | yes |
| spotless | ./mvnw -B -ntp spotless:check (skipped when the plugin is not in the pom) | no |
| checkstyle, pmd | ./mvnw -B -ntp checkstyle:check / pmd:check, only when the ruleset file is committed | no |
| spotbugs | ./mvnw -B -ntp spotbugs:check (FindSecBugs as its plugin) | no |
| arch | loops arch (import scanner, package-dir resolver) | no |
| test | ./mvnw -B -ntp verify plus the JUnit parallel and random-order keys, run twice | yes |
| coverage | loops parses JaCoCo XML for new-code coverage (WORKFLOW §6) | yes |
| osv-scanner, dependency-check, sbom | opt-in (--vuln, or enable in config); OSV needs no key, dependency-check needs an NVD key | no |
Gradle equivalents: assemble, spotlessCheck, checkstyleMain checkstyleTest, spotbugsMain, pmdMain, test --rerun jacocoTestReport, dependencyCheckAnalyze, cyclonedxBom.
Direct commands for a fast loop (the test-guard accepts ./mvnw test|verify, mvn test|verify, ./gradlew test, gradle test):
- one test:
./mvnw -B -ntp -pl <module> -Dtest=OrderServiceTest#placesOrder -Dsurefire.failIfNoSpecifiedTests=false test - Gradle:
./gradlew :module:test --tests 'com.acme.OrderServiceTest.placesOrder'
Always use the wrapper (JAVA-REPO-03). Do not set JAVA_HOME, JAVA_TOOL_OPTIONS, MAVEN_ARGS or Gradle cache dirs yourself; the run environment scopes tmp and the JaCoCo exec, and ~/.m2 and GRADLE_USER_HOME stay shared (JAVA-OPS-05). Never relocate -Dmaven.repo.local per run.
Race policy
The JVM has no general data-race detector, so the pack's race mode is none with a required substitute (WORKFLOW §6, GENERIC §5.2). The test check carries it:
- JUnit Jupiter parallel execution on (
junit.jupiter.execution.parallel.enabled=true,mode.default=concurrent,mode.classes.default=concurrent); - random method order (
junit.jupiter.testmethod.order.default=org.junit.jupiter.api.MethodOrderer$Random); - the whole check runs twice, with a different
junit.jupiter.execution.order.random.seedeach run; the gate records the seeds. A failing seed is the reproduction: rerun it with that seed.
Do not defeat it: no --rerun-failed/retry plugins that hide a flake (rerunFailingTestsCount), no fixed order, no -DforkCount=0 serial mode, no @Execution(SAME_THREAD) to silence a failure. A test that only passes serially has a race or shared state: fix the code or the test isolation (JAVA-TEST-09, JAVA-CONC-05).
On Gradle the -D flags do not reach the test JVM. The project needs a committed src/test/resources/junit-platform.properties with the same keys (architect or java-engineer, wave 0). Without it the gate's race substitute does not run: report it as a missing prerequisite, do not skip it. Where the project has jcstress or Lincheck suites, run them for lock-free or memory-model-sensitive code (JAVA-CONC-06) and report the result. If the substitute cannot run on the host, the gate fails with "race policy unavailable"; never skip it silently.
Coverage recipe
The gate parses **/target/site/jacoco/jacoco.xml (Gradle: **/build/reports/jacoco/test/jacocoTestReport.xml), one file per module, merged. Source files resolve against src/main/java. Coverage is line-based; new-code coverage ≥ 70% is computed by loops against the diff (JAVA-TEST-06, -07).
Wave-0 prerequisites the architect or java-engineer adds if missing (log each as an override when the project already differs):
- Maven:
jacoco-maven-pluginwith executionsprepare-agentandreport(bound toverify); any Surefire<argLine>must include@{argLine}or the agent is dropped and the report is empty. - Gradle: the
jacocoplugin withtasks.jacocoTestReport { reports { xml.required = true } }; the test task mustfinalizedByor be followed byjacocoTestReport. src/test/resources/junit-platform.propertieswith the parallel and random-order keys (needed for Gradle, harmless for Maven).- Optional:
spotless-maven-plugin(google-java-format), SpotBugs with FindSecBugs, an ArchUnit test (JAVA-ARCH-03).
The exec file is relocated per run with both -Djacoco.destFile and -Djacoco.dataFile (done by the run environment). Setting only destFile makes the report read stale data. Gradle needs test --rerun, or :test UP-TO-DATE gives a stale report. Exclude generated code and composition roots (*Application, config/**); the pack's globs already do.
Layers on this language
src/main/java/com/acme/orders/
domain/ pure: records, sealed types, value objects, Clock and IdGenerator ports; no Spring, JPA, Jackson, java.io, java.sql
application/ use cases (@Transactional here), consumer-owned ports (OrderRepository, PaymentGateway)
adapter/in/web/ controllers, request records + Bean Validation, ProblemDetail mapping
adapter/out/persistence/ JPA entities + mappers, Flyway migrations in resources/db/migration
config/ composition root: @Configuration wiring adapters to ports, @SpringBootApplication
src/test/java/... mirrors main; *Test unit, *IT integration (Failsafe / jvm-test-suite)Direction is enforced by loops arch (imports resolved by package and directory) and, where present, ArchUnit tests in the normal test run. See specs/ARCHITECTURE.md, JAVA-ARCH-01..10.
Top 10 footguns
- Open-session-in-view left on:
spring.jpa.open-in-view=false. - N+1 from lazy collections:
JOIN FETCH,@EntityGraph, DTO projections. @Transactionalself-invocation or on private methods: move to another bean.@Data/naiveequalson JPA entities: id-based equals, constanthashCode.Optionalas a field or parameter, or.get():orElseThrow.- Mutable state in singleton beans: stateless or
java.util.concurrent. - Swallowed
InterruptedException: restore the interrupt flag and propagate. - Preview APIs (
StructuredTaskScope) on an LTS: executors orCompletableFuture. doublemoney,new BigDecimal(0.1),SimpleDateFormat:BigDecimal("0.10"),java.time.- Native deserialization, XXE, SSRF defaults: closed-type JSON, secure-processing features.
Load on demand
repo.md: layout, wrapper, JDK toolchain, BOMs, CI,.gitignore(REPO, TOOL).architecture.md: layering, access control, ArchUnit, constructor injection, modules (ARCH).idioms.md: exceptions, Optional, records, sealed types, equals, time and money (IDIOM).testing.md: JUnit, AssertJ, Mockito, Testcontainers, coverage, flakiness (TEST, PERF).concurrency.md: virtual threads, scoped values, race substitute, async and background work (CONC).security.md: injection, deserialization, secrets, supply chain, SAST (SEC).data-api.md: JPA, transactions, Flyway, HTTP and messaging, observability, packaging (DATA, API, OBS, OPS, DOC).frameworks.md: Spring Boot, Quarkus, Micronaut, Modulith (FW).
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.

