java-conventions

Enforce modern Java 21+ conventions and Google Java Style across enterprise modules.

Updated Feb 7, 2026
One-click install
npx skills add https://github.com/jsamuelsen11/claude-config --skill java-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-conventions
Source: https://github.com/jsamuelsen11/claude-config/tree/main/plugins/ccfg-java/skills/java-conventions
Command: npx skills add https://github.com/jsamuelsen11/claude-config --skill java-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill standardizes modern Java idioms and Google-style guidelines across Java 21+ projects to improve readability, consistency, and maintainability.

Core Features & Use Cases

  • Enforce use of modern constructs such as records for DTOs, sealed interfaces for restricted hierarchies, and pattern matching to reduce boilerplate.
  • Promote safe Optional usage, immutable collections, and text blocks for multi-line content.
  • Ensure Spring-oriented patterns like constructor injection, @ConfigurationProperties, and prudent transactional boundaries are consistently applied across modules.

Quick Start

Apply these conventions to the codebase and generate an idiomatic Java 21+ example showing records, pattern matching, and constructor injection.

Frequently Asked Questions about java-conventions

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

FAQPage Schema
How do I enforce modern Java conventions and idioms across a Java 21+ codebase?

To enforce modern Java conventions across Java 21+ projects, apply standardized rules for records, sealed hierarchies, pattern matching, and Google Java Style to improve code readability and maintainability.

What is the best way to standardize Spring code structure and dependency injection?

Standardizing Spring code structure requires enforcing constructor injection, utilizing @ConfigurationProperties, and applying prudent transactional boundaries consistently across enterprise modules.

Does this work with typical enterprise Java modules using Spring integrations?

Yes, these Java conventions are applicable to typical enterprise Java modules including service, data, web, and Spring integrations to guide code structure, dependency injection, and testing.

How do I apply Google Java Style and safe Optional usage in my project?

Applying Google Java Style involves ensuring safe Optional usage, utilizing immutable collections, and adopting text blocks for multi-line content to reduce boilerplate and improve consistency.

When should I use records and sealed interfaces to reduce boilerplate in Java?

Use records for DTOs and sealed interfaces for restricted hierarchies to reduce boilerplate, leveraging modern Java 21+ constructs alongside pattern matching for cleaner, more maintainable code.