Claude Code 技能:Acooly 框架开发规范与工作流 | Acooly Framework Development Standards & Workflow
acooly-dev 是一个面向 Acooly 框架 的 Claude Code 开发技能,用于指导 AI 编码助手严格按照 Acooly 官方开发规范进行项目初始化、数据库设计、代码生成、组件集成和测试编写。
- 项目/模块初始化 — 按 Acooly 标准多模块布局创建项目,配置 Maven 父子 POM
- 数据库设计与 DDL — 表命名、必选字段、枚举存储规则、DDL 脚本路径
- Entity / DAO / Service / Controller 生成 — 严格遵循 Acooly 基类继承、注解、命名和分层规范
- OpenAPI 与 Dubbo Facade — Request/Response/ApiService 结构及注解规范
- 组件集成 — 优先使用 Acooly 组件(security、sms、ofile、kafka、scheduler 等)而非自定义实现
- 单元/集成测试 — JUnit 5 + Mockito,Given-When-Then,置于专用 test 模块
- 代码审查 — 检查分层越界、事务缺失、SQL 安全、Controller 业务逻辑等违规项
acooly-dev/
├── SKILL.md # 技能入口:触发条件、工作流、常见任务指南
├── references/
│ └── acooly-rules.md # 完整规范:项目初始化、DDL、分层、代码生成、组件、测试、安全
└── agents/
└── openai.yaml # 技能元数据(多平台兼容)
| 领域 | 规则摘要 |
|---|---|
| 项目结构 | 多模块布局:assemble / common / business / facade / openapi / test |
| 父 POM | com.acooly:acooly-app-dependencies:5.2.1 |
| 数据库 | 表名小写蛇形,必含 id/create_time/update_time;枚举存 varchar(16-32) |
| Entity | 继承 AbstractEntity,Lombok,@ExportModel/@ExportColumn |
| DAO | 继承 EntityMybatisDao<T>,@Mapper |
| Service | 继承 EntityServiceImpl<T, Dao>,简单单表操作;复杂多表事务入 TransService |
| Controller | 继承 AbstractJsonEntityController,禁止写入业务逻辑 |
| 事务 | 手写代码 @Transactional(rollbackFor = Exception.class);生成代码 rollbackFor = Throwable.class |
| 配置 | .properties 格式,数据库用 acooly.ds.*,组件开启开关 acooly.xxx.enable |
| 依赖注入 | 构造器注入 + @RequiredArgsConstructor,禁止 @Autowired 字段注入 |
| 枚举 | 实现 Messageable,禁止 Lombok @Getter/@AllArgsConstructor;读取时做空安全 |
| 测试 | 仅在 test 模块,JUnit 5 + Mockito,方法命名 {method}_{scenario}_{expected} |
| 安全 | 参数化 SQL、输入校验 @Valid、禁止日志打印敏感数据 |
在 Claude Code 中 skill 会自动按任务类型触发。也可手动调用:
/acooly-dev
acooly-dev is a Claude Code skill for the Acooly Framework, guiding AI coding assistants to follow official Acooly development standards for project initialization, database design, code generation, component integration, and testing.
- Project/Module Initialization — Multi-module layout per Acooly conventions, Maven parent/child POM setup
- Database Design & DDL — Table naming, mandatory columns, enum storage, DDL script placement
- Entity / DAO / Service / Controller Generation — Strict adherence to Acooly base classes, annotations, naming, and layering
- OpenAPI & Dubbo Facade — Request/Response/ApiService structure and annotation rules
- Component Integration — Prefer Acooly components (security, SMS, file, Kafka, scheduler, etc.) over custom implementations
- Unit & Integration Testing — JUnit 5 + Mockito, Given-When-Then, dedicated
testmodule - Code Review — Detect layering violations, missing transactions, unsafe SQL, business logic in controllers
acooly-dev/
├── SKILL.md # Skill entry: triggers, workflow, common task guides
├── references/
│ └── acooly-rules.md # Full specification: init, DDL, layers, codegen, components, tests, security
└── agents/
└── openai.yaml # Skill metadata (multi-platform compatible)
| Area | Rule Summary |
|---|---|
| Project Structure | Multi-module: assemble / common / business / facade / openapi / test |
| Parent POM | com.acooly:acooly-app-dependencies:5.2.1 |
| Database | lowercase snake_case tables; mandatory id/create_time/update_time; enums as varchar(16-32) |
| Entity | Extends AbstractEntity, Lombok, @ExportModel/@ExportColumn |
| DAO | Extends EntityMybatisDao<T>, @Mapper |
| Service | Extends EntityServiceImpl<T, Dao>; complex multi-table logic in TransService |
| Controller | Extends AbstractJsonEntityController; no business logic allowed |
| Transactions | Hand-written: @Transactional(rollbackFor = Exception.class); generated: rollbackFor = Throwable.class |
| Configuration | .properties format, acooly.ds.* for DB, acooly.xxx.enable for components |
| DI | Constructor injection + @RequiredArgsConstructor; no @Autowired field injection |
| Enums | Implement Messageable; no Lombok @Getter/@AllArgsConstructor; null-safe reads |
| Testing | test module only, JUnit 5 + Mockito, {method}_{scenario}_{expected} naming |
| Security | Parameterized SQL, @Valid input validation, no sensitive data in logs |
The skill triggers automatically based on task type in Claude Code, or manually:
/acooly-dev
MIT