Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when you need to review, improve, or refactor Java code for generics quality — including avoiding raw types, applying the PECS (Producer Extends Consumer Super) principle for wildcards, using bounded type parameters, designing effective generic methods, leveraging the diamond operator, understanding type erasure implications, handling generic inheritance correctly, preventing heap pollution with @SafeVarargs, and integrating generics with modern Java features like Records, sealed types, and
.claude/skills/jabrena-128-java-generics/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-15 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-18 | ✗→✓ | ▲ Improved | -24% | 0% |
| case-16 | ✓→✗ | ▼ Worse | 57% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 9% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 1% | 0% |
Review and improve Java code using comprehensive generics best practices that enforce compile-time type safety and enable flexible, reusable APIs.
What is covered in this Skill?
? extends for producers, ? super for consumers@SafeVarargs for heap pollution preventionComparator<? super T>, Function<? super T, ? extends R>TypeReference/TypeTokenT, E, K/V, ?), typesafe heterogeneous containersScope: The reference is organized by examples (good/bad code patterns) for each core area. Apply recommendations based on applicable examples.
Before applying any generics changes, ensure the project compiles. If compilation fails, stop immediately — do not proceed until resolved. After applying improvements, run full verification.
./mvnw compile or mvn compile before applying any change./mvnw clean verify or mvn clean verify after applying improvementsRun ./mvnw compile or mvn compile and stop immediately if compilation fails.
Read references/128-java-generics.md and identify raw types, unsafe casts, wildcard misuse, and API variance opportunities.
Implement selected generic type and API improvements while preserving behavior.
Run ./mvnw clean verify or mvn clean verify after applying improvements.
For detailed guidance, examples, and constraints, see references/128-java-generics.md.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 9,680 | 5,165 | -47% | 1 | 1 | 0% | 1,799 | 904 | -50% | 0 | 0 | — |
case-02 | fail→fail | 4,226 | 5,685 | +35% | 1 | 1 | 0% | 240 | 935 | +290% | 0 | 0 | — |
case-03 | fail→fail | 6,978 | 5,365 | -23% | 1 | 1 | 0% | 803 | 934 | +16% | 0 | 0 | — |
case-04 | pass→pass | 8,215 | 4,853 | -41% | 1 | 1 | 0% | 1,445 | 1,569 | +9% | 0 | 0 | — |
case-05 | pass→pass | 7,992 | 4,796 | -40% | 1 | 1 | 0% | 1,568 | 1,576 | +1% | 0 | 0 | — |
case-06 | pass→pass | 5,179 | 5,319 | +3% | 1 | 1 | 0% | 878 | 1,612 | +84% | 0 | 0 | — |
case-07 | pass→pass | 5,139 | 4,708 | -8% | 1 | 1 | 0% | 845 | 1,420 | +68% | 0 | 0 | — |
case-08 | pass→pass | 8,357 | 4,921 | -41% | 1 | 1 | 0% | 1,430 | 1,565 | +9% | 0 | 0 | — |
case-09 | pass→pass | 9,655 | 6,786 | -30% | 1 | 1 | 0% | 1,516 | 1,803 | +19% | 0 | 0 | — |
case-10 | pass→pass | 5,390 | 3,921 | -27% | 1 | 1 | 0% | 868 | 1,251 | +44% | 0 | 0 | — |
case-11 | pass→pass | 7,017 | 2,662 | -62% | 1 | 1 | 0% | 1,188 | 1,143 | -4% | 0 | 0 | — |
case-12 | pass→pass | 12,133 | 10,984 | -9% | 1 | 1 | 0% | 2,131 | 2,711 | +27% | 0 | 0 | — |
case-13 | pass→pass | 5,413 | 4,730 | -13% | 1 | 1 | 0% | 959 | 1,424 | +48% | 0 | 0 | — |
case-14 | pass→pass | 6,418 | 5,384 | -16% | 1 | 1 | 0% | 1,261 | 1,518 | +20% | 0 | 0 | — |
case-15 | fail→pass | 6,151 | 1,737 | -72% | 1 | 1 | 0% | 754 | 835 | +11% | 0 | 0 | — |
case-16 | pass→fail | 5,944 | 6,159 | +4% | 1 | 1 | 0% | 993 | 1,555 | +57% | 0 | 0 | — |
case-17 | fail→fail | 6,010 | 5,998 | -0% | 1 | 1 | 0% | 940 | 958 | +2% | 0 | 0 | — |
case-18 | fail→pass | 8,273 | 2,191 | -74% | 1 | 1 | 0% | 1,231 | 932 | -24% | 0 | 0 | — |
case-19 | pass→pass | 7,187 | 4,824 | -33% | 1 | 1 | 0% | 1,232 | 1,394 | +13% | 0 | 0 | — |
case-20 | pass→pass | 9,256 | 7,816 | -16% | 1 | 1 | 0% | 1,661 | 1,960 | +18% | 0 | 0 | — |
case-21 | pass→pass | 6,118 | 7,186 | +17% | 1 | 1 | 0% | 1,298 | 1,996 | +54% | 0 | 0 | — |
case-22 | pass→pass | 7,003 | 4,586 | -35% | 1 | 1 | 0% | 1,157 | 1,370 | +18% | 0 | 0 | — |
case-23 | pass→pass | 11,264 | 8,125 | -28% | 1 | 1 | 0% | 2,050 | 1,443 | -30% | 0 | 0 | — |
case-24 | pass→pass | 17,672 | 20,567 | +16% | 1 | 1 | 0% | 2,793 | 3,237 | +16% | 0 | 0 | — |
case-25 | pass→pass | 14,674 | 6,584 | -55% | 1 | 1 | 0% | 2,264 | 1,698 | -25% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 25 cases were attempted, and 22 counted toward the lift figure. The other 3 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -100 percentage points is the difference between those two pass rates over the 22 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.