CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

141-java-refactoring-with-modern-features

Use when you need to refactor Java code to adopt modern Java features (Java 8+) — including migrating anonymous classes to lambdas, replacing Iterator loops with Stream API, adopting Optional for null safety, switching from legacy Date/Calendar to java.time, using collection factory methods, applying text blocks, var inference, or leveraging Java 25 features like flexible constructor bodies and module import declarations. This should trigger for requests such as Review Java code for modern Java development; Apply best practices for modern Java development in Java code; Modernize Java code with records pattern matching or switch expressions; Replace legacy idioms with modern Java features; Adopt Java 8+ language features safely. Part of Plinth Toolkit

67

Quality

84%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

78%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A well-structured, lean skill body with executable commands, explicit compile/verify safety gates, and exemplary one-level-deep progressive disclosure. Remaining weaknesses are redundant duplication between the Constraints and Workflow sections and a missing error-recovery loop for post-change verification failures.

Suggestions

Merge the compile/verify bullets in the Constraints section into Workflow steps 1 and 4 (or vice versa) to remove the duplicated instructions.

Add a verify-failure feedback loop, e.g. 'If mvn clean verify fails, fix the failing changes or revert them, then re-run verification before completing the task.'

Trim or drop the 'When to use this skill' section, which duplicates the frontmatter description triggers, and add one line of guidance on how to prioritize high-value refactoring candidates from the reference.

DimensionReasoningScore

Conciseness

The body is lean — a bulleted feature list, constraint bullets, and a 4-step workflow with no explanation of concepts Claude already knows. However, the Constraints section repeats the compile/verify instructions already given in Workflow steps 1 and 4, and 'When to use this skill' duplicates the frontmatter triggers, so it is not fully tight.

4 / 5

Actionability

Concrete, executable commands are given throughout ('./mvnw compile or mvn compile', './mvnw clean verify'), plus an exact file to read (references/141-java-refactoring-with-modern-features.md) and explicit edge-case protocols (stop and ask when scope is ambiguous). The gap is step 3, 'Refactor incrementally using appropriate language/library features', which delegates the actual how without summarizing any selection criteria.

4 / 5

Workflow Clarity

The 4-step sequence is clear with explicit validation gates (compile before changes, 'stop immediately' on failure, full verify after), plus stop-and-ask checkpoints for ambiguity and missing tooling. It falls short of a 5 because there is no feedback loop for verify failures — no instruction to fix errors and re-run before finishing.

4 / 5

Progressive Disclosure

SKILL.md is a concise overview that appropriately pushes all good/bad code examples into a single reference, which exists, is clearly signaled twice (workflow step 2 and a markdown 'Reference' link), and is one level deep — the 54KB reference has its own TOC and no nested .md references.

5 / 5

Total

17

/

20

Passed

Description

83%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: comprehensive, concrete enumeration of modernization actions with explicit 'Use when' trigger phrasing and natural trigger examples. The main deductions are the second-person voice ('Use when you need to') and a few missing natural synonyms.

Suggestions

Rewrite in third-person voice (e.g., 'Refactors Java code to adopt modern Java features. Use when the user asks to modernize or review Java code...') to match the rubric's voice requirement and avoid the specificity penalty.

Add a few natural synonyms users might say, such as 'upgrade old Java code', 'clean up legacy Java', or 'migrate Java 8 code to newer versions', to broaden trigger coverage toward the top anchor.

DimensionReasoningScore

Specificity

The description enumerates many concrete actions — 'migrating anonymous classes to lambdas', 'replacing Iterator loops with Stream API', 'switching from legacy Date/Calendar to java.time', 'applying text blocks' — with only minor coverage gaps (records/pattern matching appear only in the trigger phrasing). It would score 5, but the second-person 'Use when you need to refactor' violates the third-person voice rule, reducing the score by 1.

4 / 5

Completeness

It explicitly answers both: what ('refactor Java code to adopt modern Java features (Java 8+)' with an enumerated feature list) and when ('Use when you need to refactor Java code...' plus 'This should trigger for requests such as...'). Both halves are concrete and explicit, matching the top anchor.

5 / 5

Trigger Term Quality

Trigger phrases like 'Review Java code for modern Java development', 'Modernize Java code', 'Replace legacy idioms with modern Java features', and 'Adopt Java 8+ language features safely' read as natural user requests, with 'refactor Java code' also present. A few common synonyms are missing (e.g., 'upgrade old Java code', 'clean up Java', 'migrate to streams').

4 / 5

Distinctiveness Conflict Risk

The Java-modernization niche is well-delineated with Java-version-specific features (Java 25 flexible constructor bodies, JEP references), giving a clear niche. Minor overlap risk remains with generic Java code-review or refactoring skills, e.g. the trigger 'Review Java code for modern Java development'.

4 / 5

Total

17

/

20

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 — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

jabrena/plinth

Path

skills/141-java-refactoring-with-modern-features/SKILL.md

Reviewed

Table of Contents

Is this your skill?

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.