java-conventions

java-conventions is a skill for Claude Code from AratKruglik/claude-sdlc. It costs 210 tokens per session (1,894 once invoked), scanned A, original, MIT.

A set of modern Java 17-or-newer coding conventions for any Java project, covering data types, null handling, collections, streams, packages, and code organisation.

In plain words
What is it for?
Use it when implementing or reviewing Java 17+ code, especially records, sealed types, Optional values, pattern matching, and immutable collections.
Why use it?
It helps keep Java code readable and reduces common bugs caused by mutable data, null values, or inconsistent structure.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the java-foundation plugin — 3 skills shipped together

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.

agentmods
npx agentmods add skills/aratkruglik/claude-sdlc/java-conventions
Any agent
npx skills add AratKruglik/claude-sdlc --skill java-conventions
Clone the repo
git clone --depth 1 https://github.com/AratKruglik/claude-sdlc

Made for: Claude Code.

Or install java-foundation, the plugin that ships this one along with the rest of its 3 skills.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/java-conventions.svg)](https://agentmods.dev/skills/aratkruglik/claude-sdlc/java-conventions)
Your own site
<a href="https://agentmods.dev/skills/aratkruglik/claude-sdlc/java-conventions"><img src="https://agentmods.dev/badge/skills/aratkruglik/claude-sdlc/java-conventions.svg" alt="Measured on agentmods" height="20"></a>
Per session 210 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,894 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00210 $0.01894
Opus 5 $0.00105 $0.00947
Sonnet 5 $0.00042 $0.00379
Haiku 4.5 $0.00021 $0.00189

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

Security

Grade A, and why

java-conventions 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 6d 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.

plugins/java-foundation/skills/java-conventions/SKILL.md · 250 lines

How it starts

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

Java Conventions (stack-agnostic, Java 17+)

This skill encodes idioms that reduce bugs and improve readability in any Java codebase. Apply alongside the active framework plugin's conventions skill (e.g., spring-boot-plugin:spring-conventions).

Detection

Project is Java 17+ when:

  • pom.xml has <java.version>17</java.version> or <maven.compiler.source>17</maven.compiler.source> (or higher).
  • build.gradle / build.gradle.kts has sourceCompatibility = JavaVersion.VERSION_17 (or higher).

Read the build file first to learn the target Java version.

Records — prefer for value objects

Use records for immutable data carriers. They auto-generate constructor, equals, hashCode, toString.

// Prefer
public record Money(BigDecimal amount, Currency currency) {
    public Money {
        Objects.requireNonNull(amount, "amount");
        Objects.requireNonNull(currency, "currency");
        if (amount.compareTo(BigDecimal.ZERO) < 0) {
            throw new IllegalArgumentException("amount must be non-negative");
        }
    }

    public Money add(Money other) {
        if (!this.currency.equals(other.currency)) {
            throw new IllegalArgumentException("Currency mismatch");
        }
        return new Money(this.amount.add(other.amount), this.currency);
    }
}

// Avoid — a plain class with no behaviour
public class Money {
    private final BigDecimal amount;
    private final Currency currency;
    // ... boilerplate constructor, getters, equals, hashCode, toString
}

Compact constructor (without parameter list) is for validation only — do not assign fields there (the canonical constructor does that).

Sealed types — model closed hierarchies

public sealed interface Shape permits Circle, Rectangle, Triangle {}

public record Circle(double radius) implements Shape {}
public record Rectangle(double width, double height) implements Shape {}
public record Triangle(double base, double height) implements Shape {}

double area(Shape shape) {
    return switch (shape) {
        case Circle c    -> Math.PI * c.radius() * c.radius();
        case Rectangle r -> r.width() * r.height();
        case Triangle t  -> 0.5 * t.base() * t.height();
    };
}

Read the full file on GitHub · 250 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. 6d ago First seen · 250 lines · 210 tokens per session scan A 573e40b7b50a

Subscribe to this mod's changes

java-conventions is a skill published in the GitHub repository AratKruglik/claude-sdlc (32 stars, last pushed yesterday), licensed MIT. It adds 210 tokens to every session and 1,894 once invoked, about $0.0011 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

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-security-keyvault-secrets-java

Azure Key Vault Secrets Java SDK for secret management. Use when storing, retrieving, or managing passwords, API keys, connection strings, or other sensitive configuration data.

microsoft/skills · 40 tokens

azure-ai-anomalydetector-java

Build anomaly detection applications with Azure AI Anomaly Detector SDK for Java. Use when implementing univariate/multivariate anomaly detection, time-series analysis, or AI-powered monitoring.

microsoft/skills · 43 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

union-type-wrappers

Add typed getters and setters over BinaryData properties that represent TypeSpec union types in generated Java models. Use when generated classes expose BinaryData for union-typed fields and you need ergonomic, type-safe accessors instead.

Azure/azure-sdk-for-java · 49 tokens

azure-ai-agents-persistent-java

Azure AI Agents Persistent SDK for Java. Low-level SDK for creating and managing AI agents with threads, messages, runs, and tools. Triggers: "PersistentAgentsClient", "persistent agents java", "agent threads java", "agent runs java", "streaming agents java".

microsoft/skills · 63 tokens