java

java is a skill for Claude Code, Codex from ericrisco/rsc-harness. It costs 89 tokens per session (4,549 once invoked), scanned A, original, MIT.

A guide for writing, reviewing, and refactoring modern Java code, targeting Java 21 and newer.

In plain words
What is it for?
It is for modeling domains with records and sealed interfaces, improving pattern matching, handling concurrent work with virtual threads, and building Stream or Optional pipelines.
Why use it?
It helps developers use current Java language and concurrency features instead of relying on older patterns that can add boilerplate or unsafe state handling.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/ericrisco/rsc-harness/java
Any agent
npx skills add ericrisco/rsc-harness --skill java
Clone the repo
git clone --depth 1 https://github.com/ericrisco/rsc-harness

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for java

README.md
[![agentmods](https://agentmods.dev/badge/skills/ericrisco/rsc-harness/java.svg)](https://agentmods.dev/skills/ericrisco/rsc-harness/java)
Your own site
<a href="https://agentmods.dev/skills/ericrisco/rsc-harness/java"><img src="https://agentmods.dev/badge/skills/ericrisco/rsc-harness/java.svg" alt="Measured on agentmods" height="20"></a>
Per session 89 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,549 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00089 $0.04549
Opus 5 $0.00044 $0.02275
Sonnet 5 $0.00018 $0.00910
Haiku 4.5 $0.00009 $0.00455

Measured yesterday against content hash 5e3a0f613d47, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

java 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/java/SKILL.md · 342 lines

How it starts

The opening of the file, as written. The whole thing — 342 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Modern Java (21+)

Write, review, and refactor Java the way the language is shaped today, not the way it was in 2014.

Targets Java 21+ with Java 25 as the current LTS (released 2025-09-16, supported to 2033; Java 26 is the current non-LTS, 2026-03-17). "Modern" here means: records and sealed interfaces instead of JavaBeans and type hierarchies, exhaustive pattern-matching switch instead of instanceof+cast ladders, virtual threads instead of hand-tuned pools, and ScopedValue instead of ThreadLocal. If you are reaching for a telescoping constructor, a getter/setter bean, or a manual ExecutorService sized to a core count, stop.

When to use / When NOT to use

Use when:

  • Authoring, reviewing, or refactoring any .java file.
  • Modeling a domain: record vs class, sealed hierarchy vs enum, where immutability belongs.
  • Replacing instanceof+cast chains or visitor boilerplate with a pattern-matching switch.
  • Concurrency that blocks on I/O at scale: migrating thread pools / reactive chains to virtual threads, fan-out with structured concurrency, ThreadLocal -> ScopedValue.
  • Stream / Optional / Collector pipelines, and deciding when a plain loop beats a stream.
  • Setting up or fixing a pom.xml / build.gradle(.kts) for a current JDK (toolchain, --release, preview flags, JUnit 5).

When NOT to use (delegate):

  • Spring controllers, beans, starters, autoconfiguration, @Transactional -> spring-boot. This skill is the plain-JDK layer underneath; framework wiring is out of scope by topic.
  • Kotlin on the JVM (Android or server) -> kotlin-android. Java and Kotlin interop but are different languages; coroutines and Kotlin null-safety belong there.
  • Language-agnostic threat modeling / OWASP / authz -> secure-coding. This skill keeps only Java-specific controls (parametrized JDBC, compact-constructor validation, sane deser).
  • Containerfile / CI pipeline / shipping -> deployment. This skill keeps only a jlink/jpackage note and the JDK base-image choice.
  • PostgreSQL schema / index / query tuning -> postgresdb. This skill covers JDBC parametrization from the Java side only.
  • Recording per-project conventions in a workspace wiki -> harness (see "Project grounding").

Read the full file on GitHub · 342 lines

Files

What ships with it

6 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.

Changes

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.

  1. yesterday First seen · 342 lines · 89 tokens per session scan A 5e3a0f613d47

Subscribe to this mod's changes

java is a skill published in the GitHub repository ericrisco/rsc-harness (60 stars, last pushed yesterday), licensed MIT. It adds 89 tokens to every session and 4,549 once invoked, about $0.0004 per session on Opus 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-09-03.

Related

Other skills, from other repositories

effective-java

Generate and review Java code using patterns and best practices from Joshua Bloch's "Effective Java" (3rd Edition). Use this skill whenever the user asks about Java best practices, API design, object creation patterns, generics, enums, lambdas, streams, concurrency, serialization, method design, exception handling, or…

booklib-ai/booklib · 165 tokens

java-expert

Expert knowledge for Modern Java (21+) development, including Virtual Threads, performance tuning, and idiomatic clean code. Use for deep Java language/logic questions.

kinhluan/rules-quarkus-skills · 36 tokens

video-cover-image

Generate matched 3:4, 16:9, and 4:3 short-video cover images from toBeBetterJavaer video scripts or AI/Java technical topics. Use when the user asks for 视频封面, 封面图, 横版和竖版, 小红书/抖音/B站/快手封面, pure-text covers with 白色大字+黄色小字, reference-image-matched covers, or wants a repeatable cover workflow for Markdown scripts under…

itwanger/toBeBetterJavaer · 113 tokens

zsxq-reply

以二哥(沉默王二)的身份回复知识星球「Java进阶之路&二哥编程星球」的帖子、提问和评论。完整工作流:扫描未回复的球友提问 → 参照二哥历史回复出草稿 → 用户确认后通过 zsxq-cli 发布。当用户说"看看星球有没有没回的提问"、"回复星球"、"星球回帖"、"帮我回答球友的问题"、"星球提问",或给出某条星球帖子链接/ID 要求回复时,必须使用此 Skill。涉及星球的任何发帖、评论、回答操作也走此 Skill。.

itwanger/toBeBetterJavaer · 156 tokens

java-idioms

Java rewards clarity, type safety, and robust ecosystem tooling. Modern Java (17+ LTS) favors records, sealed classes, and pattern matching. Idiomatic Java = clean, readable, framework-aware.

irahardianto/awesome-agv · 0 tokens

spring-boot-idioms

Spring Boot (3.x) rewards auto-configuration, constructor injection, and actuator-driven observability. Idiomatic Spring = annotation-driven, testable, production-ready.

irahardianto/awesome-agv · 0 tokens