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.
npx skills add Luohaothu/everything-codex --skill java-coding-standardsgit clone --depth 1 https://github.com/Luohaothu/everything-codexWrote 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.
[](https://agentmods.dev/skills/luohaothu/everything-codex/java-coding-standards)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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/构建器
- 深度嵌套 → 提前返回
- 魔法数字 → 命名常量
- 静态可变状态 → 优先使用依赖注入
- 静默捕获块 → 记录日志并处理或重新抛出
日志记录
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.
- 1mo ago First seen · 139 lines · 0 tokens per session scan A a7c42f3cfa27
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.
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.
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.
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.
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.
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.
java-coding-standards
Java coding standards for Spring Boot services: naming, immutability, Optional usage, streams, exceptions, generics, and project layout.