java-modern

java-modern is a skill for Claude Code from piomin/claude-ai-spring-boot. It costs 46 tokens per session (1,957 once invoked), scanned A, original, Apache-2.0.

Guidance for using newer Java features from Java 21 and later, especially in Spring Boot applications. Java is a programming language, and Spring Boot is a framework for building Java services and web applications.

In plain words
What is it for?
Use it when building or updating Spring Boot applications, or when working with Java records, configuration objects, virtual threads, pattern matching, or related Java 21 features.
Why use it?
It helps developers modernize Java code or choose current language features instead of relying on older patterns. The covered features include records, sealed classes, pattern matching, virtual threads, and text blocks.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

Part of the spring-boot-plugin plugin — 7 skills, 6 agents shipped together

Good fit Use it when building or updating Spring Boot applications, or when working with Java records, configuration objects, virtual threads, pattern matching, or related Java 21 features.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/piomin/claude-ai-spring-boot/java-modern
About the project

piomin/claude-ai-spring-boot is a starter template for creating Spring Boot applications with Claude Code. Developers clone it as a structured foundation when using Claude Code to generate Spring Boot projects.

piomin/claude-ai-spring-boot · 1,347 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add piomin/claude-ai-spring-boot --skill java-modern
Clone the repo
git clone --depth 1 https://github.com/piomin/claude-ai-spring-boot

Made for: Claude Code.

Or install spring-boot-plugin, the plugin that ships this one along with the rest of its 7 skills, 6 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for java-modern

README.md
[![agentmods](https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/java-modern/github.svg)](https://agentmods.dev/skills/piomin/claude-ai-spring-boot/java-modern)
Your own site
<a href="https://agentmods.dev/skills/piomin/claude-ai-spring-boot/java-modern"><img src="https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/java-modern/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for java-modern

Your own site · 80×15
<a href="https://agentmods.dev/skills/piomin/claude-ai-spring-boot/java-modern"><img src="https://agentmods.dev/badge/skills/piomin/claude-ai-spring-boot/java-modern.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,957 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00046 $0.01957
Opus 5.5 $0.00018 $0.00783
Sonnet 5.5 $0.00009 $0.00391
Haiku 4.5 $0.00005 $0.00196

Measured today against content hash edac66cf7bd1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

java-modern scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/java-modern/SKILL.md · 320 lines

How it starts

The opening of the file, as written. The whole thing — 320 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Java Modern Skill

Java 21+ language features and how to use them in Spring Boot applications.

When to Use

  • Building new Spring Boot 4.x applications (default to modern features)
  • Modernizing/refactoring existing Java code
  • User asks about records, sealed classes, pattern matching, virtual threads

Records (Java 16+)

DTOs

// ✅ Records for request/response DTOs
public record ProductRequest(
    @NotBlank String name,
    @DecimalMin("0.0") BigDecimal price
) {}

public record ProductResponse(
    Long id,
    String name,
    BigDecimal price,
    LocalDateTime createdAt
) {
    public static ProductResponse from(Product entity) {
        return new ProductResponse(
            entity.getId(),
            entity.getName(),
            entity.getPrice(),
            entity.getCreatedAt()
        );
    }
}

Configuration Properties

// ✅ Records for config properties (Spring Boot 4.x)
@ConfigurationProperties(prefix = "app.notification")
public record NotificationProperties(
    boolean enabled,
    String fromEmail,
    Duration timeout,
    Retry retry
) {
    public record Retry(int maxAttempts, Duration delay) {}
}

When NOT to use records

  • JPA entities (Hibernate needs mutable objects, no-arg constructor)
  • Classes that need inheritance
  • Objects with mutable state

Sealed Classes (Java 17+)

Domain Modeling

// ✅ Restrict payment types at compile time
public sealed interface PaymentResult
    permits PaymentSuccess, PaymentFailure, PaymentPending {
}

public record PaymentSuccess(String transactionId, BigDecimal amount)
    implements PaymentResult {}

public record PaymentFailure(String errorCode, String message)
    implements PaymentResult {}

public record PaymentPending(String referenceId)
    implements PaymentResult {}

// Usage in service
public PaymentResult processPayment(PaymentRequest request) {
    try {
        String txId = gateway.charge(request);
        return new PaymentSuccess(txId, request.amount());
    } catch (InsufficientFundsException e) {
        return new PaymentFailure("INSUFFICIENT_FUNDS", e.getMessage());
    }
}

Read the full file on GitHub · 320 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 320 lines · 46 tokens per session scan A edac66cf7bd1

Subscribe to this mod's changes

java-modern is a skill published in the GitHub repository piomin/claude-ai-spring-boot (1,347 stars, last pushed yesterday), licensed Apache-2.0. It adds 46 tokens to every session and 1,957 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-17.

Related

Other skills, from other repositories

geoserver-cloud

Use when deploying GeoServer on Kubernetes as cloud-native microservices with auto-scaling, service discovery, and centralized configuration. GeoServer Cloud: break monolithic GeoServer into independently scalable WMS/WFS/WCS services.

znlgis/opengis-skills · 49 tokens

wxjava-api-contributor

A contributor guide for adding or maintaining official WeChat API support in WxJava, a Java software development kit. It covers services, request and response data objects, data conversion, HTTP handling, starter configuration, and regression tests.

binarywang/WxJava · 68 tokens

azure-communication-callautomation-java

Build call automation workflows with Azure Communication Services Call Automation Java SDK. Use when implementing IVR systems, call routing, call recording, DTMF recognition, text-to-speech, or AI-powered call flows.

microsoft/skills · 49 tokens

azure-communication-chat-java

Build real-time chat applications with Azure Communication Services Chat Java SDK. Use when implementing chat threads, messaging, participants, read receipts, typing notifications, or real-time chat features.

microsoft/skills · 41 tokens

azure-communication-common-java

Azure Communication Services common utilities for Java. Use when working with CommunicationTokenCredential, user identifiers, token refresh, or shared authentication across ACS services.

microsoft/skills · 35 tokens

azure-communication-sms-java

Send SMS messages with Azure Communication Services SMS Java SDK. Use when implementing SMS notifications, alerts, OTP delivery, bulk messaging, or delivery reports.

microsoft/skills · 36 tokens