java-coding-standards

Enforces Java 17+ coding standards for Spring Boot services covering naming, immutability, and exceptions.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill java-coding-standards-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-coding-standards
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/java-coding-standards
Command: npx skills add https://github.com/ibytechaos/claude --skill java-coding-standards-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Java codebases in Spring Boot projects often drift into inconsistent naming, mutable state, poor Optional usage, and unclear exception handling, making reviews slow and maintenance costly. This Skill provides a concrete, example-driven standards reference so code is written and reviewed against one consistent set of rules. ## Core Features & Use Cases - Naming and Structure Conventions: Defines PascalCase classes, camelCase methods, UPPER_SNAKE_CASE constants, and a standard Maven/Gradle package layout (config, controller, service, repository, domain, dto). - Modern Java Patterns: Covers records, immutability by default, Optional map/orElseThrow flows, stream pipeline best practices, and bounded generics for type safety. - Error Handling and Observability: Prescribes domain-specific unchecked exceptions, SLF4J logging patterns, null handling with Bean Validation, and JUnit 5 + AssertJ + Mockito testing expectations. - Use Case: While reviewing a pull request that uses raw types, setter-heavy entities, and a broad catch block, apply this Skill to rewrite the code with records, Optional-based repository access, and a MarketNotFoundException. ## Quick Start Review my Spring Boot service class against the Java coding standards and rewrite any violations.

Frequently Asked Questions about java-coding-standards

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

FAQPage Schema
How do I enforce coding standards in a Spring Boot project?

Apply a written standards guide covering naming, immutability, Optional usage, exceptions, and package layout, then check code against it during reviews. This Skill provides concrete Java 17+ examples for each rule so reviewers can cite specific patterns.

When should I use Optional in Java methods?

Return Optional from finder methods like repository lookups, and consume it with map, flatMap, or orElseThrow instead of calling get(). Avoid Optional for fields or parameters; use it mainly as a return type to signal possible absence.

Does this standard support Java 17 features like records and sealed classes?

Yes, the standards target Java 17+ and explicitly cover records for immutable DTOs, sealed classes, and pattern matching. Records are recommended as the default for data carriers such as DTOs and value objects.

Should I use checked or unchecked exceptions for domain errors?

Use unchecked exceptions for domain errors, creating specific types like MarketNotFoundException rather than broad catches. Wrap technical exceptions with context and avoid catch (Exception ex) unless logging centrally or rethrowing.

What testing libraries does this Java standard recommend?

The standard recommends JUnit 5 with AssertJ for fluent assertions and Mockito for mocking, avoiding partial mocks where possible. Tests should be deterministic with no hidden sleeps.