java-expert

Provide expert guidance on modern Java 21+ development with virtual threads and performance tuning.

3|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/kinhluan/rules-quarkus-skills --skill java-expert-kinhluan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: java-expert
Source: https://github.com/kinhluan/rules-quarkus-skills/tree/main/.agent-skills/java-expert
Command: npx skills add https://github.com/kinhluan/rules-quarkus-skills --skill java-expert-kinhluan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides expert guidance on developing high-performance, modern Java applications, focusing on Java 21+ features like Virtual Threads and idiomatic clean code practices.

Core Features & Use Cases

  • Modern Java (21+): Leverage var, Records, Pattern Matching, and Sealed Classes.
  • Concurrency: Utilize Virtual Threads for efficient I/O-bound tasks.
  • Architectural Patterns: Implement Hexagonal/Clean Architecture and optimize for performance with G1GC/ZGC and JFR.
  • Testing: Employ JUnit 5, AssertJ, Mockito, ArchUnit, and Testcontainers.

Quick Start

Use the java-expert skill to refactor a Java method to use virtual threads for improved concurrency.

Frequently Asked Questions about java-expert

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

FAQPage Schema
How do I use virtual threads in Java 21 for I/O-bound tasks?

Virtual threads in Java 21 enable high-throughput concurrency for I/O-bound tasks by allowing lightweight thread creation. You can refactor existing methods to replace platform threads, improving application scalability without changing APIs.

What is the best way to tune JVM performance with G1GC and ZGC?

Tuning JVM performance with G1GC or ZGC involves optimizing memory management and garbage collection to reduce latency. You can use Java Flight Recorder (JFR) to analyze runtime behavior and identify bottlenecks for targeted optimizations.

How do I implement Hexagonal Architecture in modern Java applications?

Hexagonal Architecture in Java isolates core business logic from external interfaces using ports and adapters. Implementing this pattern with modern Java features like Records and Sealed Classes ensures clean, maintainable, and testable code structures.

Can I use JUnit 5 and Testcontainers for integration testing in Java?

JUnit 5 combined with Testcontainers supports automated integration testing by managing Docker containers for your test environments. AssertJ and Mockito further enhance test reliability by providing fluent assertions and mock management.

Does Java 21 pattern matching work well with sealed classes?

Java 21 pattern matching works seamlessly with sealed classes to enable exhaustive switch expressions. This combination allows the compiler to verify all possible cases are covered, reducing runtime errors and ensuring robust domain modeling.

When should I not use virtual threads for concurrency?

Avoid virtual threads for CPU-bound computations where platform threads are more efficient, as virtual threads optimize blocking I/O operations. Heavy synchronization or long-held monitors can also negate their performance benefits.