java-conventions

Apply Java 17+ idioms like records and sealed types to JVM projects.

9|1|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill java-conventions-aratkruglik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-conventions
Source: https://github.com/AratKruglik/antigravity-sdlc/tree/main/plugins/java-foundation/skills/java-conventions
Command: npx skills add https://github.com/AratKruglik/antigravity-sdlc --skill java-conventions-aratkruglik

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Modern Java projects often struggle to adopt modern idioms consistently, risking inconsistent interfaces and brittle code. This skill codifies Java 17+ patterns like records, sealed types, text blocks, and robust Optional handling to improve readability, safety, and maintainability across JVM projects.

Core Features & Use Cases

  • Records for immutable value objects to simplify data carriers and enforce invariants.
  • Sealed types to model closed hierarchies with exhaustiveness guarantees.
  • Optional discipline to avoid null-related bugs and clarify absence.
  • Streams and modern syntax for expressive, readable data processing.
  • Consistent package layouts and judicious use of var for clarity.

Quick Start

Begin by applying Java 17+ idioms, starting with records for value objects and sealed types for closed hierarchies.

Frequently Asked Questions about java-conventions

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

FAQPage Schema
How do I use Java records to create immutable value objects?

Java records provide immutable value objects to simplify data carriers and enforce invariants. You apply records to replace boilerplate data classes, ensuring consistent and safe data models across JVM projects.

What is the best way to handle null safety with Optional in Java?

Optional discipline avoids null-related bugs and clarifies absence. You use robust Optional handling to improve readability and safety, ensuring consistent interfaces and preventing brittle code in modern Java projects.

When should I use sealed types in Java 17?

Sealed types model closed hierarchies with exhaustiveness guarantees. You apply sealed types when you need strict control over inheritance and want the compiler to enforce exhaustive pattern matching across your data models.

Can I modernize a legacy Java codebase with streams and new syntax?

Yes, streams and modern syntax enable expressive, readable data processing. You modernize legacy codebases by applying stream-based pipelines, text blocks, and consistent package layouts to improve maintainability.

Does adopting Java 17+ idioms work under language-version constraints?

Adopting Java 17+ idioms addresses language-version constraints and coding standards. You apply modernized APIs and data models consistently, ensuring compatibility while improving readability and maintainability across JVM projects.

Why use var for local variables in Java?

Judicious use of var improves clarity in local variable declarations. You apply var consistently to reduce redundancy and enhance readability without sacrificing type safety or maintainability in your JVM projects.