jade-recipe-1.7-diamond-operator

Convert explicit generic Java constructor calls to diamond operator syntax.

1|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/TheRealSeber/PolishedJADEite --skill jade-recipe-1-7-diamond-operator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jade-recipe-1.7-diamond-operator
Source: https://github.com/TheRealSeber/PolishedJADEite/tree/main/.claude/skills/jade-recipe-1.7-diamond-operator
Command: npx skills add https://github.com/TheRealSeber/PolishedJADEite --skill jade-recipe-1-7-diamond-operator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It removes repetitive explicit generic type arguments from Java constructor calls so code is shorter, clearer, and compatible with Java 7+ type inference.

Core Features & Use Cases

  • Diamond Operator Conversion: Rewrites explicit generic constructor instantiations into <> syntax.
  • Nearby Flag Handling: Finds the target edit even when the JADE flag comment is on an adjacent line.
  • Safety Checks: Skips already-converted lines and avoids constructor delegation contexts where inference is ambiguous.
  • Atomic File Updates: Writes changes through a temporary file and rename workflow to reduce edit risk.

Quick Start

Use the jade-recipe-1.7-diamond-operator skill to convert the flagged Java constructor in the specified file and line into diamond operator syntax.

Frequently Asked Questions about jade-recipe-1.7-diamond-operator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert explicit Java generic constructors to diamond operator syntax?

The diamond operator conversion handles nearby JADE flag comments by scanning adjacent lines to locate the target edit. It skips already converted code and avoids constructor delegation contexts where type inference is ambiguous.

How does diamond operator refactoring handle existing JADE flags on adjacent lines?

Diamond operator refactoring handles nearby JADE flags by scanning adjacent lines to locate the target constructor edit. It removes the JADE-FLAG marker during the atomic file rewrite, ensuring the conversion applies accurately even when the flag is not on the exact same line.

Does this diamond operator migration skip already converted Java code?

The conversion process skips already converted code to prevent duplicate refactoring. It recognizes existing `<>` syntax and ignores those lines during the atomic file rewrite process.

What are the limitations of converting to diamond syntax in Java 7?

A key limitation of converting to diamond syntax in Java 7 is ambiguity in constructor delegation contexts. The Skill avoids applying the `<>` operator when explicit generic types are required for safe type inference during constructor chaining.