ericrisco/rsc-harness / skills/java
java
VerifiedUse when writing, reviewing or refactoring modern Java (21+, 25 LTS) — records and sealed interfaces as algebraic data types, exhaustive pattern-matching switch over instanceof ladders, virtual-thread concurrency, structured concurrency and ScopedValue replacing ThreadLocal, Stream and Optional pipelines, compact-constructor validation, parametrized JDBC, and the Maven/Gradle build surface. NOT Spring framework wiring (that is `spring-boot`).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.9 KB |
| evals/README.md | markdown | 1.7 KB |
| evals/cases.yaml | config | 4.5 KB |
| references/builds.md | markdown | 5.0 KB |
| references/concurrency.md | markdown | 5.0 KB |
| references/streams.md | markdown | 4.0 KB |
| scripts/verify.shexecutable | script | 3.2 KB |
evals/cases.yaml
View on GitHubskill: java
should_trigger:
- prompt: "Write a service that fetches 500 URLs concurrently and aggregates the response bodies."
why: "Virtual-thread fan-out for blocking I/O is the core concurrency use case; the user never names Java or Loom but the shape (concurrent blocking fetches) is exactly what one-vthread-per-task owns here."
- prompt: "Refactor this instanceof + cast ladder over a Shape type into something cleaner and exhaustive."
why: "Replacing instanceof+cast ladders with a sealed type + exhaustive pattern-matching switch is explicitly owned by this skill."
- prompt: "Is this idiomatic modern Java? class User { private String name; private int age; with all the getters and setters and a no-arg constructor }"
why: "Idiom review of a JavaBean; the skill should push it to a record. 'Is this idiomatic Java' is a named trigger."
- prompt: "modela este dominio de pagos con tipos inmutables y casos exhaustivos (capturado, rechazado, pendiente)"
why: "Spanish phrasing for sealed-interface-plus-record ADT modeling with exhaustive handling — records and sealed types are owned here."
- prompt: "My ThreadLocal request context disappears inside the tasks I submit to the executor, and we're running on millions of virtual threads now. What should I use instead?"
why: "Non-obvious: the user describes the symptom (ThreadLocal not crossing submit, leaking on vthreads) without naming ScopedValue, which is exactly the fix this skill prescribes."
- prompt: "Set up a pom.xml that compiles against Java 25 and runs JUnit 5 tests, with warnings treated as errors."
why: "The Maven/Gradle build surface (compiler-plugin release, surefire + JUnit 5, -Xlint -Werror) is owned by this skill."
should_not_trigger:
- prompt: "Add a @RestController with @GetMapping(\"/users/{id}\") and inject a @Service bean for the lookup."
route_to: "spring-boot"
why: "Spring framework wiring (controllers, beans, annotations, autoconfiguration) is delegated to spring-boot; this skill is only the plain-JDK layer underneath."
- prompt: "Write a Kotlin coroutine-based repository with a Flow for my Android app."
route_to: "kotlin-android"
why: "Kotlin language and Android belong to kotlin-android; Java and Kotlin interop but are different languages."
- prompt: "Do an OWASP-style authorization review and threat model of my multi-tenant API's permission boundaries."
route_to: "security-audit"
why: "Language-agnostic threat modeling / authz / OWASP review is delegated to security-audit; only Java-specific controls (JDBC params, compact-constructor validation) stay here."
- prompt: "Write a multi-stage Dockerfile and a GitHub Actions pipeline to build and ship my jar."
route_to: "deployment"
why: "Containerfile / CI / shipping is delegated to deployment; this skill keeps only the jlink/jpackage note and base-image choice."
- prompt: "Tune the indexes and rewrite this slow query for a Postgres users table with a composite lookup."
route_to: "postgresdb"
why: "SQL schema/index/query tuning is a database concern; this skill covers only JDBC parametrization from the Java side."
capability:
- scenario: "Model a payment domain as a sealed interface with record cases (Captured, Declined, Pending), write an exhaustive switch that maps each case to an HTTP-ish result, validate a Money amount in a compact constructor, and fan out N payment validations concurrently. Provide a Maven build targeting Java 25."
must_include:
- "Payment outcome modeled as a sealed interface with record cases (sealed interface ... permits ...; record Captured/Declined/Pending implements it) — NOT a JavaBean with getters/setters or a class hierarchy"
- "Money (or the amount type) is a record that validates its invariant in a compact constructor (e.g. throws on negative cents / null currency) so an invalid instance cannot be constructed"
- "An exhaustive switch over the sealed type using record deconstruction patterns (case Captured(var id, var amt) -> ...) with NO default branch, relying on the compiler's exhaustiveness check"
- "No instanceof + cast ladder anywhere in the mapping logic"
- "Concurrency uses Executors.newVirtualThreadPerTaskExecutor() inside try-with-resources, one task per virtual thread (NOT a fixed-size pool, NOT new Thread per request, NOT pooled virtual threads)"
- "Returns Optional or an empty collection rather than null for absent results"
- "pom.xml configures maven-compiler-plugin with <release>25</release> (and ideally -Xlint:all/-Werror) and JUnit 5 via surefire"
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |