java
Use when: write or review modern, idiomatic Java with immutability, clear types, and clean structure.
来源信息
- 仓库
- kimtth/agent-skill-100-lines-or-less
- 最近来源活动
- 2026年6月26日 02:15
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 2
- Forks
- 0
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
正在显示 SKILL.md
SKILL.md
来源说明 · 只读预览- name
- java
- description
- Use when: write or review modern, idiomatic Java with immutability, clear types, and clean structure.
Goal: modern Java that is immutable by default, null-safe, and testable.
Use for:
- new classes, services, or APIs in Java
- reviewing structure, immutability, and error handling
- modernizing verbose or legacy patterns
Workflow:
1. Model immutable data with records and final fields.
2. Use Optional for absence; avoid returning null.
3. Prefer the Streams API for transformations over manual loops.
4. Throw specific exceptions; never swallow them silently.
5. Manage resources with try-with-resources.
6. Verify with JUnit, a static analyzer, and the formatter.
Idioms:
- records for immutable value types
- Optional return types instead of null
- switch expressions and pattern matching
- var for obvious local types
- dependency injection over static singletons
Rules:
- do not return or pass null; use Optional or explicit checks
- close resources with try-with-resources, not manual finally
- keep classes focused; favor composition over inheritance
- program to interfaces for testability
在 GitHub 查看