java-coding-standards

java-coding-standards is a skill for Claude Code, Codex from Luohaothu/everything-codex. It costs 0 tokens per session (933 once invoked), scanned A, original, MIT.

A set of Java rules for readable and maintainable Spring Boot code, covering names, immutable data, Optional values, streams, exceptions, generics, and project layout. Spring Boot is a Java framework for building web services and applications.

In plain words
What is it for?
Use it when writing or reviewing Java 17+ Spring Boot services, choosing class and method names, designing data objects, handling missing values, processing collections, or organizing packages.
Why use it?
It reduces inconsistent code and common mistakes in service projects. Shared conventions make code easier to understand, review, extend, and troubleshoot.

Skill for Claude CodeCodex

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

Good fit Use it when writing or reviewing Java 17+ Spring Boot services, choosing class and method names, designing data objects, handling missing values, processing collections, or organizing packages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/luohaothu/everything-codex/java-coding-standards
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 Luohaothu/everything-codex --skill java-coding-standards
Clone the repo
git clone --depth 1 https://github.com/Luohaothu/everything-codex

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/luohaothu/everything-codex/java-coding-standards/github.svg)](https://agentmods.dev/skills/luohaothu/everything-codex/java-coding-standards)
Your own site
<a href="https://agentmods.dev/skills/luohaothu/everything-codex/java-coding-standards"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/java-coding-standards/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-coding-standards

Your own site · 80×15
<a href="https://agentmods.dev/skills/luohaothu/everything-codex/java-coding-standards"><img src="https://agentmods.dev/badge/skills/luohaothu/everything-codex/java-coding-standards.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 933 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.00000 $0.00933
Opus 5.5 $0.00000 $0.00373
Sonnet 5.5 $0.00000 $0.00187
Haiku 4.5 $0.00000 $0.00093

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

Security

Grade A, and why

java-coding-standards 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.

docs/zh-CN/skills/java-coding-standards/SKILL.md · 139 lines

How it starts

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

Java 编码规范

适用于 Spring Boot 服务中可读、可维护的 Java (17+) 代码的规范。

核心原则

  • 清晰优于巧妙
  • 默认不可变;最小化共享可变状态
  • 快速失败并提供有意义的异常
  • 一致的命名和包结构

命名

// ✅ Classes/Records: PascalCase
public class MarketService {}
public record Money(BigDecimal amount, Currency currency) {}

// ✅ Methods/fields: camelCase
private final MarketRepository marketRepository;
public Market findBySlug(String slug) {}

// ✅ Constants: UPPER_SNAKE_CASE
private static final int MAX_PAGE_SIZE = 100;

不可变性

// ✅ Favor records and final fields
public record MarketDto(Long id, String name, MarketStatus status) {}

public class Market {
  private final Long id;
  private final String name;
  // getters only, no setters
}

Optional 使用

// ✅ Return Optional from find* methods
Optional<Market> market = marketRepository.findBySlug(slug);

// ✅ Map/flatMap instead of get()
return market
    .map(MarketResponse::from)
    .orElseThrow(() -> new EntityNotFoundException("Market not found"));

Streams 最佳实践

// ✅ Use streams for transformations, keep pipelines short
List<String> names = markets.stream()
    .map(Market::name)
    .filter(Objects::nonNull)
    .toList();

// ❌ Avoid complex nested streams; prefer loops for clarity

异常

  • 领域错误使用非受检异常;包装技术异常时提供上下文
  • 创建特定领域的异常(例如,MarketNotFoundException)
  • 避免宽泛的 catch (Exception ex),除非在中心位置重新抛出/记录
throw new MarketNotFoundException(slug);

泛型和类型安全

  • 避免原始类型;声明泛型参数
  • 对于可复用的工具类,优先使用有界泛型
public <T extends Identifiable> Map<Long, T> indexById(Collection<T> items) { ... }

项目结构 (Maven/Gradle)

src/main/java/com/example/app/
  config/
  controller/
  service/
  repository/
  domain/
  dto/
  util/
src/main/resources/
  application.yml
src/test/java/... (mirrors main)

格式化和风格

  • 一致地使用 2 或 4 个空格(项目标准)
  • 每个文件一个公共顶级类型
  • 保持方法简短且专注;提取辅助方法
  • 成员顺序:常量、字段、构造函数、公共方法、受保护方法、私有方法

需要避免的代码坏味道

  • 长参数列表 → 使用 DTO/构建器
  • 深度嵌套 → 提前返回
  • 魔法数字 → 命名常量
  • 静态可变状态 → 优先使用依赖注入
  • 静默捕获块 → 记录日志并处理或重新抛出

日志记录

Read the full file on GitHub · 139 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 First seen · 139 lines · 0 tokens per session scan A a7c42f3cfa27

Subscribe to this mod's changes

java-coding-standards is a skill published in the GitHub repository Luohaothu/everything-codex (25 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 933 tokens. 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

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

java-coding-standards

Java coding standards for Spring Boot services: naming, immutability, Optional usage, streams, exceptions, generics, and project layout.

hashgraph-online/awesome-codex-plugins · 35 tokens