java-excellence

Write modern Java 17+ code with records, sealed classes, and virtual threads.

5|1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill java-excellence
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-excellence
Source: https://github.com/roanbrasil/engineer-grade-agent-skills/tree/main/skills/java-excellence
Command: npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill java-excellence

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the common pain point of writing verbose, legacy Java code that ignores modern 17+ language features, Effective Java principles, and production best practices, which leads to unnecessary boilerplate, avoidable bugs, and hard-to-maintain codebases.

Core Features & Use Cases

  • Modern Java Feature Guidance: Clear examples and best practices for records, sealed classes, pattern matching, text blocks, virtual threads, streams, and Optional to reduce boilerplate and improve type safety.
  • Production-Grade Patterns: Concurrency best practices (virtual threads, CompletableFuture, Java Memory Model rules), JVM tuning for containerized deployments, and correct collection usage for high-performance, scalable services.
  • Effective Java Principle Application: Actionable rules for composition over inheritance, immutability, null safety, and test writing with JUnit 5 and AssertJ to write robust, maintainable code.
  • Use Case Example: When building a high-throughput microservice, use this Skill to implement virtual thread-based I/O handling, define immutable domain models with records and sealed classes, and apply correct G1GC or ZGC flags for container environments to reduce latency and memory overhead.

Quick Start

Use the java-excellence skill to refactor your existing legacy Java user service to use modern records, sealed classes, and virtual threads for improved readability and performance.

Frequently Asked Questions about java-excellence

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

FAQPage Schema
How do I write idiomatic Java 17+ code using records and sealed classes?

To write idiomatic Java 17+ code, use records for immutable data carriers and sealed classes for restricted hierarchies. This approach eliminates legacy boilerplate, enforces domain modeling type safety, and improves long-term maintainability.

What is the best way to handle concurrency with virtual threads in modern Java?

The best way to handle concurrency with virtual threads is applying correct Java Memory Model rules and CompletableFuture patterns. This enables high-throughput I/O handling for microservices, reducing latency and memory overhead in production.

How do I apply Effective Java principles to reduce boilerplate and bugs?

Apply Effective Java principles by favoring composition over inheritance, enforcing minimal mutability, and ensuring null safety. This produces robust, production-grade code by preventing common bugs and reducing unnecessary boilerplate.

Does this approach work for JVM tuning in containerized deployments?

Yes, this approach works for JVM tuning in containerized deployments by applying correct G1GC or ZGC flags. This optimizes memory usage and reduces latency for scalable services running within container environments.

How do I write unit tests with JUnit 5 and AssertJ for robust Java code?

Write unit tests with JUnit 5 and AssertJ to verify type-safe code and correct concurrency patterns. This testing strategy ensures your modern Java 17+ features function correctly and maintain robust production behavior.