/java-skills:java-development-manualfrom java-skills
Enforces Alibaba Java Development Manual (Songshan Edition) standards across 7 dimensions: coding conventions, exception/logging, unit testing, security, MySQL, project structure, and design.
Ships in java-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
本手册基于阿里巴巴Java开发手册(嵩山版),将规约分为7个维度。规约按约束力强弱分为:
| 级别 | 含义 | 说明 |
|---|---|---|
| 【强制】 | 必须遵守 | 违反可能导致严重问题 |
| 【推荐】 | 建议遵守 | 提升代码质量和可维护性 |
| 【参考】 | 可选择性采纳 | 根据实际情况判断 |
根据需求选择对应章节的详细规约:
| 章节 | 适用场景 | 详细文档 |
|---|---|---|
| 编程规约 | 命名、格式、OOP、并发、集合处理 | coding-convention.md |
| 异常日志 | 错误码、异常处理、日志规范 | exception-log.md |
| 单元测试 | 测试用例、覆盖率、Mock | unit-test.md |
| 安全规约 | SQL注入、XSS、CSRF、脱敏 | security.md |
| MySQL数据库 | 建表、索引、SQL、ORM | mysql.md |
| 工程结构 | 分层架构、依赖管理、服务器 | project-structure.md |
| 设计规约 | UML、设计模式、设计原则 | design.md |
// 类名:UpperCamelCase
public class UserService { }
public class UserDO { } // DO/DTO/VO例外
// 方法名/变量:lowerCamelCase
private String userName;
public void getUserById() { }
// 常量:全大写+下划线
public static final int MAX_RETRY_COUNT = 3;
// 包名:全小写
package com.company.project.service;
| 禁止 | 原因 |
|---|---|
| 拼音命名 | 可读性差 |
| 魔法值 | 难以维护 |
SELECT * | 性能和可维护性 |
| Executors创建线程池 | 可能OOM |
| 字符串拼接SQL | 注入风险 |
| finally中return | 丢失try返回值 |
| foreach中remove | ConcurrentModificationException |
| 必须 | 原因 |
|---|---|
| 覆写方法加@Override | 避免签名错误 |
| 表必备三字段 | id, create_time, update_time |
| 敏感数据脱敏 | 隐私保护 |
| 参数校验 | 安全防护 |
| ThreadLocal回收 | 避免内存泄漏 |
| 日志用占位符 | 性能优化 |
// 正确的异常处理
try {
// 业务逻辑
} catch (SpecificException e) {
logger.error("操作失败, 参数: {}", params, e);
throw new BusinessException("用户友好提示", e);
} finally {
// 资源关闭(JDK7+ try-with-resources)
}
-- 建表必备
CREATE TABLE example (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- 索引命名
-- 主键: pk_字段名
-- 唯一: uk_字段名
-- 普通: idx_字段名
// 线程池创建
ThreadPoolExecutor executor = new ThreadPoolExecutor(
corePoolSize,
maximumPoolSize,
keepAliveTime,
TimeUnit.SECONDS,
new LinkedBlockingQueue<>(queueCapacity),
new ThreadFactory() {
private AtomicInteger counter = new AtomicInteger(1);
public Thread newThread(Runnable r) {
return new Thread(r, "worker-" + counter.getAndIncrement());
}
},
new ThreadPoolExecutor.CallerRunsPolicy()
);
// ThreadLocal使用
try {
threadLocal.set(value);
// 业务逻辑
} finally {
threadLocal.remove(); // 必须回收
}
_meta.json (opens in a new tab)agents/openai.yaml (opens in a new tab)references/coding-convention.md (opens in a new tab)references/design.md (opens in a new tab)references/exception-log.md (opens in a new tab)references/mysql.md (opens in a new tab)references/project-structure.md (opens in a new tab)references/security.md (opens in a new tab)references/unit-test.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (full-stack-skills/java-skills) — no native marketplace selected
npx claudepluginhub p/full-statck-skills-java-skills39 skills in this plugin
/caffeine-patternsCaffeine JVM 本地缓存技能。覆盖本地缓存 vs 远程缓存(Redis)选择决策树、expireAfterWrite vs expireAfterAccess vs refreshAfterWrite 三种过期策略对比与组合规则(refresh < expire)、CacheLoader加载与reload异步刷新模式、Spring Cache @Cacheable集成、maximumSize驱逐策略、recordStats缓存统计。 纠正 LLM:用 ConcurrentHashMap+手动过期、所有缓存走Redis、refreshAfterWrite > expireAfterWrite导致永远不刷新、CacheLoader返回null导致缓存穿透。/commons-patternsApache Commons 最佳实践模式。从官方文档提炼,覆盖 Commons Lang3(StringUtils千面判空/isEmpty vs isBlank/Validate抛NullPointerException迁移)、Commons IO(IOUtils.toString大文件陷阱/FileUtils.lineIterator逐行读模式/FilenameUtils.normalize路径规范化)、Commons Collections4(CollectionUtils.union/intersection/subtract集合运算)。 纠正 LLM 误用:混淆 StringUtils.isBlank vs isEmpty、IOUtils.toString 读大文件OOM、不知道 LineIterator 逐行读模式、用 lang 而非 lang3 包名。/