java-patterns

java-patterns is a skill for Claude Code, Codex from DVNghiem/FlowDeck. It costs 35 tokens per session (2,963 once invoked), scanned A, original, MIT.

A guide to modern Java 17 and later programming patterns, including records, sealed classes, streams, asynchronous tasks, Spring Boot, and JPA. Spring Boot is a Java framework for web services, while JPA is a standard way to work with databases.

In plain words
What is it for?
Use it when writing or reviewing Java services and libraries, designing APIs or database access, configuring Spring Boot, or setting up tests.
Why use it?
It helps keep Java code current and consistent when creating, reviewing, or troubleshooting production applications.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing Java services and libraries, designing APIs…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dvnghiem/flowdeck/java-patterns
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 DVNghiem/FlowDeck --skill java-patterns
Clone the repo
git clone --depth 1 https://github.com/DVNghiem/FlowDeck

Made for: Claude Code, Codex.

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-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/dvnghiem/flowdeck/java-patterns.svg)](https://agentmods.dev/skills/dvnghiem/flowdeck/java-patterns)
Your own site
<a href="https://agentmods.dev/skills/dvnghiem/flowdeck/java-patterns"><img src="https://agentmods.dev/badge/skills/dvnghiem/flowdeck/java-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,963 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.00035 $0.02963
Opus 5 $0.00017 $0.01482
Sonnet 5 $0.00007 $0.00593
Haiku 4.5 $0.00003 $0.00296

Measured 7d ago against content hash ff15487ec28c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

java-patterns 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 7d ago.

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.

src/skills/java-patterns/SKILL.md · 480 lines

How it starts

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

Java Patterns Skill

Modern Java for production applications. Focuses on Java 17+ features and Spring Boot conventions.

When to Activate

Activate when:

  • Writing new Java services or libraries
  • Reviewing Java code for correctness and modern idiom
  • Designing API layers, service classes, or data access
  • Troubleshooting Spring Boot configuration or JPA queries
  • Setting up testing infrastructure

Modern Java Features (17+)

Records — Immutable Data Carriers

Records eliminate boilerplate for data classes. Use them for DTOs, value objects, and command/query objects.

// Compiler generates constructor, getters, equals, hashCode, toString
public record Point(double x, double y) {}

// Custom constructor for validation
public record EmailAddress(String value) {
    public EmailAddress {
        Objects.requireNonNull(value);
        if (!value.contains("@")) {
            throw new IllegalArgumentException("invalid email: " + value);
        }
        value = value.toLowerCase();
    }
}

// Records can implement interfaces
public record PageRequest(int page, int size) implements Serializable {
    public PageRequest {
        if (page < 0) throw new IllegalArgumentException("page must be >= 0");
        if (size < 1 || size > 100) throw new IllegalArgumentException("size must be 1-100");
    }

    public int offset() { return page * size; }
}

Sealed Classes — Closed Hierarchies

Use sealed classes to model a fixed set of variants. The compiler enforces exhaustive pattern matching.

public sealed interface PaymentResult
    permits PaymentResult.Success, PaymentResult.Declined, PaymentResult.Error {

    record Success(String transactionId, BigDecimal amount) implements PaymentResult {}
    record Declined(String reason) implements PaymentResult {}
    record Error(Throwable cause) implements PaymentResult {}
}

// Pattern matching ensures all cases are handled
String message = switch (result) {
    case PaymentResult.Success s  -> "Charged " + s.amount();
    case PaymentResult.Declined d -> "Declined: " + d.reason();
    case PaymentResult.Error e    -> "Error: " + e.cause().getMessage();
};

Read the full file on GitHub · 480 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. 7d ago First seen · 480 lines · 35 tokens per session scan A ff15487ec28c

Subscribe to this mod's changes

java-patterns is a skill published in the GitHub repository DVNghiem/FlowDeck (24 stars, last pushed 18d ago), licensed MIT. It adds 35 tokens to every session and 2,963 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

enterprise-java

Enterprise Java development skill covering Spring ecosystem, microservices, design patterns, performance optimization, and Java best practices. Use this skill when building enterprise Java applications, working with Spring Boot, implementing microservices, or need guidance on Java architecture and performance tuning.

HK-hub/AgentSkills · 53 tokens

spring-boot-patterns

Spring Boot patterns including stereotype annotations, dependency injection, profiles, configuration properties, and actuator endpoints. Use when the user is building Spring Boot applications, configuring dependency injection, setting up profiles for different environments, using @ConfigurationProperties, or enabling…

VersoXBT/claude-initial-setup · 83 tokens

java-expert

Use this skill when writing or reviewing Java code. Covers modern Java (17+), Spring Boot patterns, JPA/Hibernate, Maven/Gradle, testing with JUnit 5, security patterns, and production-grade enterp...

ApexIQ/skillsmith · 51 tokens

Spring框架分析器

A guide for analyzing Spring applications, which use a Java framework for building server-side enterprise software.

microwind/ai-skills · 41 tokens

Spring Boot应用开发

A guide for building enterprise applications with Spring Boot, a Java framework for server-side software.

microwind/ai-skills · 40 tokens

claudehut-workflow

Use at the start of every session and whenever beginning a coding task in a Java/Spring backend - establishes the ClaudeHut 7-phase agentic workflow, the complexity-tier routing that lets small tasks skip deliberation phases, and the laws that govern which skills and rules must fire. Injected at session start; also…

taipt1504/claudehut · 86 tokens