java-conventions

java-conventions is a skill for Claude Code from AratKruglik/claude-sdlc. It costs 210 tokens per session (1,908 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: user-invocable in frontmatter.

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

Good fit Use it when implementing or reviewing Java 17+ code, especially records, sealed types, Optional values, pattern matching, and immutable collections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aratkruglik/claude-sdlc/java-conventions
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 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/github.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/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-conventions

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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,908 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.01908
Opus 5.5 $0.00084 $0.00763
Sonnet 5.5 $0.00042 $0.00382
Haiku 4.5 $0.00021 $0.00191

Measured 1mo ago against content hash 957ccd6f3b3c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 252 lines

How it starts

The opening of the file, as written. The whole thing — 252 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 · 252 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. 1mo ago Changed · +2 lines 957ccd6f3b3c
  2. 1mo 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 (53 stars, last pushed 2d ago), licensed MIT. It adds 210 tokens to every session and 1,908 once invoked, about $0.0008 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-08-30.

Related

Other skills, from other repositories

java-affected-tests

Use before opening or updating an OpenMetadata PR that changes Java, a JSON schema, an index mapping, a SQL migration, seed data or a pom — PR CI no longer runs the Java integration tests (they run only in the merge queue) and the JavaUIIT/search-it suites run only nightly, so this selects the unit tests and…

open-metadata/OpenMetadata · 120 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

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