java-code-style

Enforce Google Java Style and Java 21 conventions in source files.

1|1|Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Jylhis/skills --skill java-code-style-jylhis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-code-style
Source: https://github.com/Jylhis/skills/tree/main/skills/java-code-style
Command: npx skills add https://github.com/Jylhis/skills --skill java-code-style-jylhis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Java projects often drift from modern Java 21 conventions; this guide consolidates Google Java Style baseline, records, sealed types, pattern matching, and modern constructs to improve readability and maintainability.

Core Features & Use Cases

  • Enforce Google Java Style baseline with 2-space indentation and 100-column lines.
  • Promote modern constructs (records, sealed types, pattern matching) with consistent naming rules.
  • Tooling guidance for google-java-format, pre-commit hooks, and CI checks to ensure style compliance.

Quick Start

Apply the guide by configuring your project to use google-java-format and enforcing 2-space indentation and 100-column lines during development and CI.

Frequently Asked Questions about java-code-style

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

FAQPage Schema
How do I enforce Java 21 coding conventions across my codebase?

To enforce Java 21 coding conventions, apply a fixed set of formatting and naming rules aligned with Google Java Style, including 2-space indentation and 100-column lines, across your source files.

What is the best way to configure google-java-format in a CI pipeline?

The best way to configure google-java-format in a CI pipeline is to use the provided tooling guidance to integrate checks directly into your pre-commit hooks and CI pipelines, ensuring style compliance automatically.

Can I use this Java code style guide for modern constructs like records and sealed types?

Yes, you can use this Java code style guide for records, sealed types, pattern matching, switch expressions, and text blocks. It consolidates modern Java 21 conventions to improve code readability and maintainability.

Does this Java style guide work for projects of varying sizes?

Yes, this Java style guide works for projects of varying sizes. It specifies a fixed set of formatting rules and tooling guidance to consistently enforce modern Java 21 conventions across small and large codebases.

Why does my Java project drift from modern coding conventions?

Java projects often drift from modern Java 21 conventions due to inconsistent formatting and lack of automated checks. Consolidating Google Java Style rules with CI tooling prevents this drift and improves maintainability.