Agent skill
java-expert
Expert knowledge of Java 25 features including virtual threads, pattern matching, records, sealed classes, value types, and Project Loom/Valhalla features. Use when the user asks about Java programming, Java 25 features, concurrency, performance optimization, or modern Java idioms.
Install this agent skill to your Project
npx add-skill https://github.com/diegopacheco/ai-playground/tree/main/pocs/java-25-spring-boot-4-spring-ai-skills/src/main/resources/.claude/skills/java-expert
SKILL.md
Java 25 Expert Skill
Overview
Provides expert guidance on Java 25 language features and best practices.
Key Java 25 Features
Virtual Threads (Project Loom)
- Use
Thread.ofVirtual().start(runnable)for lightweight concurrency - Virtual threads are ideal for I/O-bound workloads
- Use
Executors.newVirtualThreadPerTaskExecutor()for thread pools
Pattern Matching
- Switch expressions with pattern matching
- Deconstruction patterns for records
- Guarded patterns with
whenclauses
Records
- Immutable data carriers with auto-generated constructors, equals, hashCode, toString
- Custom compact constructors for validation
Sealed Classes
- Restrict class hierarchies with
sealed,permits - Enable exhaustive pattern matching
String Templates (Preview)
- Template processors like
STR."\{value}" - Custom template processors
Best Practices
- Prefer records over plain POJOs for data transfer
- Use sealed interfaces for algebraic data types
- Leverage virtual threads for high-throughput servers
- Use pattern matching to eliminate instanceof casts
Examples
record Point(int x, int y) {}
sealed interface Shape permits Circle, Rectangle {}
record Circle(Point center, double radius) implements Shape {}
record Rectangle(Point topLeft, Point bottomRight) implements Shape {}
String describe(Shape shape) {
return switch (shape) {
case Circle c when c.radius() > 10 -> "Large circle";
case Circle c -> "Small circle";
case Rectangle r -> "Rectangle";
};
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
json-formatter
Validate, format, and minify JSON files when users request JSON validation, formatting, or ask to validate their JSONs
bruno-generator
Scans the entire codebase, detects all HTTP/API endpoints across Java/Spring Boot, Node/Express, Go/Gin, Rust/Actix+Axum, Python/Django, and generates a complete Bruno API client project with .bru files, sample requests, and environments.
infra-automation-generator
leak-detect
Scan code for leaked PII, secrets/credentials, and security vulnerabilities that would get you hacked in production.
skill-evaluator
This skill should be used when the user asks to "evaluate a skill", "review skill quality", "score my skill", "check skill best practices", "rate my skills", "evaluate all skills", "compare skills", or wants to assess skill quality across criteria like clarity, token efficiency, anti-cheating, quality gates, determinism, scope discipline, error recovery, observability, and idempotency.
metrics-report
Scan an entire codebase, discover and run all test types, compute hybrid coverage, evaluate quality, and generate a full metrics report website with trends and charts.
Didn't find tool you were looking for?