Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add maxtrezzi/java-best-practices-skills --skill java-best-practices-java11git clone --depth 1 https://github.com/maxtrezzi/java-best-practices-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/maxtrezzi/java-best-practices-skills/java-best-practices-java11)<a href="https://agentmods.dev/skills/maxtrezzi/java-best-practices-skills/java-best-practices-java11"><img src="https://agentmods.dev/badge/skills/maxtrezzi/java-best-practices-skills/java-best-practices-java11/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/maxtrezzi/java-best-practices-skills/java-best-practices-java11"><img src="https://agentmods.dev/badge/skills/maxtrezzi/java-best-practices-skills/java-best-practices-java11.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00277 | $0.04398 |
| Opus 5.5 | $0.00111 | $0.01759 |
| Sonnet 5.5 | $0.00055 | $0.00880 |
| Haiku 4.5 | $0.00028 | $0.00440 |
Grade A, and why
java-best-practices-java11 scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 318 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Java Best Practices — Java 11 (LTS) Edition
TARGET: JAVA 11. Every construct in this skill must compile and run on a stock JDK 11 with no preview flags. The features below DO NOT EXIST in Java 11 and must never appear in generated code, nor be recommended in a review as the "modern" fix:
record(Java 16) — use afinalclass withfinalfields, an all-args constructor, explicitequals/hashCode/toString, and accessors.sealedinterfaces/classes (Java 17) — emulate a closed set with a package-private abstract base or anenum, and document the closed set.- Pattern matching for
instanceof(Java 16) — write the explicitinstanceoftest followed by a cast.- Pattern matching / arrow
switchexpressions (switchexpr Java 14, patterns Java 21) — use a classicswitchstatement or anif/else ifchain; assign the result to a variable explicitly.- Text blocks (
""", Java 15) — use ordinary quoted strings with explicit\nand concatenation, orString.join.- Virtual threads, Structured Concurrency, Scoped Values (Java 21+) — use a platform-thread
ExecutorServicesized to the workload.- Unnamed variables
_(Java 21+) — name the variable, prefix unused with a comment.What you DO have on Java 11 and should use:
varfor locals (Java 10),Optional, the full Streams API, unmodifiable factory methodsList.of/Map.of/Set.of(Java 9),Collectors.toUnmodifiableList(Java 10),String.strip/isBlank/repeat/lines(Java 11),Files.readString/writeString(Java 11), thejava.net.http.HttpClient(Java 11),Optional.isEmpty(Java 11), andCollection.toArray(IntFunction)(Java 11). If a reference file shows a record, sealed type, or pattern switch, mentally translate it to the Java 11 equivalent above before applying it.
You are a senior Java engineer. Your job in this skill is to make code that is correct, then clear, then fast — in that order — and to explain the reasoning when it is not obvious. Rules without reasons don't generalize; a junior memorizes rules, a senior knows why each exists and therefore when it bends. Carry that posture into every response.
Two modes. Infer which one applies:
- GENERATE — the user describes something to build. Write the code.
- REVIEW — the user shows existing code and asks about it. Audit it.
When both apply (e.g. "rewrite this"), generate the improved version first, then briefly justify the decisions that changed.
What ships with it
13 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/anti-patterns.md 9.7 KB
- references/collections-streams.md 6.9 KB
- references/concurrency.md 7.3 KB
- references/datetime.md 4.0 KB
- references/design-api.md 9.3 KB
- references/exceptions.md 8.7 KB
- references/generics.md 3.4 KB
- references/io-resources.md 3.4 KB
- references/language-features.md 5.7 KB
- references/performance.md 6.5 KB
- references/review-example.md 4.7 KB
- references/strings-text.md 5.7 KB
- references/testing.md 4.8 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 318 lines · 277 tokens per session scan A df2dc00d1c4b
java-best-practices-java11 is a skill published in the GitHub repository maxtrezzi/java-best-practices-skills (1 stars, last pushed 1mo ago), licensed MIT. It adds 277 tokens to every session and 4,398 once invoked, about $0.0011 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
java-best-practices
Java coding best practices. Use when writing or reviewing Java code (17+). Covers modern features, error handling, and patterns.
springboot-patterns
Spring Boot architecture patterns, REST API design, layered services, data access, caching, async processing, and logging. Use for Java Spring Boot backend work.
java-concurrency-review
Reviews Java code for thread safety, race conditions, deadlocks, and Java 21 virtual thread compatibility. Use when user asks to "review concurrency", "is this thread safe", "check for race conditions", "concurrency issues", or "virtual thread compatible".
java-refactor
Suggests and applies version-gated Java refactorings. Use when user asks to "refactor this", "clean up this code", "modernize this Java", "simplify this", "extract method", "improve this class", or "make this more idiomatic".
java-review
Reviews Java code for bugs, naming issues, code smells, and version-appropriate idioms. Use when user asks to "review this code", "check my Java", "look at this class", "find issues in", "code review", "what's wrong with this", or "review this file".
java-solid
Checks Java code for SOLID principles violations with Java-specific patterns. Use when user asks to "check SOLID principles", "is this good OOP", "single responsibility", "SOLID violations", "open closed principle", or "dependency inversion".