java-code-standards

Enforce Java code quality with Checkstyle, SpotBugs, Spotless, and coverage gates.

2|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/grimlor/universal-dev-skills --skill java-code-standards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-code-standards
Source: https://github.com/grimlor/universal-dev-skills/tree/main/skills/java-code-standards
Command: npx skills add https://github.com/grimlor/universal-dev-skills --skill java-code-standards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents Java projects from accumulating avoidable quality issues by standardizing compiler strictness, static analysis, formatting, coverage gates, and documentation rules.

Core Features & Use Cases

  • Toolchain quality gates: Enforces strict compiler warnings (-Xlint:all with -Werror), plus Checkstyle and SpotBugs verification and coverage verification.
  • Consistent build configuration: Provides canonical Gradle (Kotlin DSL) setup using toolchains for a target Java 21 build.
  • Documentation and hygiene: Requires Javadoc for public APIs and standardizes formatting via Spotless (Google Java Format).

Quick Start

Use the java-code-standards skill to set up a new Java project’s Gradle (Kotlin DSL) build with Checkstyle, SpotBugs, Spotless, JaCoCo, strict compiler warnings, and a 100% line coverage gate.

Frequently Asked Questions about java-code-standards

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

FAQPage Schema
How do I configure Gradle to enforce strict Java code quality with Checkstyle and SpotBugs?

To enforce strict Java code quality in Gradle, you need canonical Kotlin DSL setup for Checkstyle, SpotBugs, Spotless, and JaCoCo. This includes configuring plugin wiring and verification tasks to standardize static analysis and formatting gates.

How do I fail a Gradle build on Java compiler warnings?

You fail a Gradle build on Java compiler warnings by enabling strict compiler handling using -Xlint:all combined with the -Werror flag. This ensures the compiler treats all warnings as errors during the build verification process.

What is the best way to enforce 100% line coverage and Javadoc hygiene in a Java 21 project?

The best way to enforce 100% line coverage and Javadoc hygiene in a Java 21 project is by applying canonical Gradle toolchain configurations. This setup applies JaCoCo coverage gates and mandates Javadoc for public APIs via standardized quality rules.

Does this Java code quality setup work with Maven or is it Gradle specific?

This Java code quality setup supports auditing existing Maven or Gradle configurations. However, the canonical quick start configuration specifically provides Gradle Kotlin DSL setup targeting a Java 21 build for strict quality enforcement.

Can I use Spotless for Google Java Format without replacing my team's existing conventions?

Yes, you can use Spotless for Google Java Format. This standardization approach explicitly enforces formatting and hygiene policies while operating safely without replacing your team-owned conventions.

Why do I need JUnit 5 setup for Java static analysis and linting tasks?

JUnit 5 setup is required for Java static analysis tasks to properly wire verification tasks and coverage gates. It establishes the testing framework necessary to validate code quality checks during the build verification process.