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 pattern matching. This should trigger for requests such as Improve the code with Generics; Apply Generics; Refactor the code with Generics. Part of cursor-rules-java project
85
81%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Quality
Discovery
100%Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.
This is a strong skill description that thoroughly covers the what and when of Java generics code review and refactoring. It lists an extensive set of specific capabilities and includes explicit trigger guidance with example user phrases. The only minor weakness is that it's quite verbose, but the detail serves the purpose of disambiguation well.
| Dimension | Reasoning | Score |
|---|---|---|
Specificity | Lists multiple specific concrete actions: avoiding raw types, applying PECS principle, using bounded type parameters, designing generic methods, leveraging diamond operator, understanding type erasure, handling generic inheritance, preventing heap pollution with @SafeVarargs, and integrating with Records/sealed types/pattern matching. | 3 / 3 |
Completeness | Clearly answers both 'what' (review, improve, or refactor Java code for generics quality with a comprehensive list of specific techniques) and 'when' (explicit 'Use when' clause at the start plus 'This should trigger for requests such as...' with concrete example phrases). | 3 / 3 |
Trigger Term Quality | Includes strong natural trigger terms users would say: 'Improve the code with Generics', 'Apply Generics', 'Refactor the code with Generics', plus domain-specific terms like 'raw types', 'PECS', 'wildcards', 'bounded type parameters', 'diamond operator', 'type erasure', '@SafeVarargs'. These cover a good range of how users would phrase generics-related requests. | 3 / 3 |
Distinctiveness Conflict Risk | Highly specific niche focused on Java generics quality, which is unlikely to conflict with other skills. The domain is narrow (Java generics specifically) with distinct trigger terms like 'PECS', 'raw types', 'bounded type parameters', and 'type erasure' that clearly differentiate it. | 3 / 3 |
Total | 12 / 12 Passed |
Implementation
62%Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.
The skill has a well-structured workflow with proper validation checkpoints and clear blocking conditions, which is its strongest aspect. However, it lacks any inline code examples showing good vs bad generics patterns, making the body feel like a table of contents rather than actionable guidance. The extensive bullet list of covered topics adds verbosity without providing concrete value that Claude couldn't infer from the reference file name alone.
Suggestions
Add 1-2 inline code examples showing a common before/after pattern (e.g., raw type → parameterized type, or a PECS wildcard fix) so the skill body itself is actionable without requiring the reference file for basic cases.
Trim the 'What is covered' bullet list to 3-4 high-level categories instead of 12+ items — the detailed enumeration belongs in the reference file, not the skill overview.
Make step 3 ('Apply generics refactorings') more concrete by listing the priority order of changes (e.g., 'First eliminate raw types, then apply PECS wildcards, then add bounded type parameters').
| Dimension | Reasoning | Score |
|---|---|---|
Conciseness | The 'What is covered' bullet list is somewhat verbose and reads like a table of contents for the reference file rather than actionable content. The constraints and workflow sections are reasonably tight, but the long feature enumeration adds tokens without teaching Claude anything new about Java generics. | 2 / 3 |
Actionability | The workflow provides concrete commands (`./mvnw compile`, `./mvnw clean verify`) which is good, but the actual generics guidance is entirely deferred to the reference file. There are no inline code examples showing good vs bad patterns, no executable snippets, and the core step 'Apply generics refactorings' is vague. | 2 / 3 |
Workflow Clarity | The workflow has a clear 4-step sequence with explicit validation checkpoints: compile before changes (blocking on failure), read reference, apply changes, then verify with full build. The feedback loop for compilation failure is explicitly stated as a blocking condition. | 3 / 3 |
Progressive Disclosure | The skill correctly references a single external file (`references/128-java-generics.md`) for detailed examples, which is good one-level-deep disclosure. However, since no bundle files were provided, we cannot verify the reference exists or is well-structured. The inline content is mostly a feature list rather than a useful quick-start overview with concrete examples. | 2 / 3 |
Total | 9 / 12 Passed |
Validation
100%Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.
Validation — 11 / 11 Passed
Validation for skill structure
No warnings or errors.
762cb86
Table of Contents
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.