with one click
cola-naming
在 COLA 架构项目中,指导新类、接口、方法的命名,确保符合项目已有的命名约定。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
在 COLA 架构项目中,指导新类、接口、方法的命名,确保符合项目已有的命名约定。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
| name | cola-naming |
| displayName | COLA 命名规范指导 |
| description | 在 COLA 架构项目中,指导新类、接口、方法的命名,确保符合项目已有的命名约定。 |
| triggers | ["命名规范","类命名","COLA命名"] |
| autoTrigger | false |
| version | 1.0.2 |
当用户需要在 COLA 架构项目中创建新类、接口或方法时,指导其使用正确的命名约定,与项目已有风格保持一致。
在执行本 skill 之前,先检查项目的技术栈声明:
AGENTS.md 文件techStack 字段或"技术栈"章节cola-java:继续执行本 skillcola-java:跳过本 skill,不应用 COLA 命名规范AGENTS.md 不存在:跳过本 skill,建议用户先执行 /init| 层级 | 类型 | 命名规则 | 路径/说明 | 示例 |
|---|---|---|---|---|
| adapter | API Controller | XxxApiController | controller/api/模块名/,URL /api/ | AiTitleBuildApiController |
| adapter | 页面 Controller | XxxController | controller/web/模块名/,URL /web/ | AmazonStockBlackController |
| adapter | 内部服务入口 | XxxCenterController | controller/center/模块名/,URL /center/ | AmazonFbaStockOutViewController |
| adapter | MQ 消费者 | XxxConsumer | consumer/模块名/ | AdjustPriceStrategyConsumer |
| adapter | 定时任务 | XxxScheduler | scheduler/模块名/ | InventorySyncScheduler |
| application | 命令执行器 | XxxCmdExe | executor/模块名/cmd/ | AdjustPriceBatchCmdExe |
| application | 查询执行器 | XxxQryExe | executor/模块名/qry/ | FbaAsinDataQryExe |
| application | 服务编排 | XxxService | service/模块名/ | OrderService |
| infrastructure | Gateway 接口 | IXxxGateway | gateway/模块名/ | IAdjustPriceStrategyGateway |
| infrastructure | Gateway 实现 | XxxGateway | gateway/模块名/impl/ | AdjustPriceStrategyGateway |
| infrastructure | MyBatis Mapper | IXxxRepository | repository/模块名/ | IOrderRepository |
| infrastructure | 数据对象 | XxxDO | dataobject/模块名/ | OrderDO |
| infrastructure | 转换器 | XxxConvertor | convertor/模块名/ | OrderConvertor |
| client | API 接口 | IXxxApi | 模块名/api/ | IAmazonFbaVineReasonsApi |
| client | 命令 DTO | XxxCmd / XxxQry | 模块名/command/ | AmazonFbaVineReasonsAddCmd |
| client | 返回 DTO | XxxDTO | 模块名/dto/ | AmazonFbaVineReasonsDTO |
@author,只读取全局用户配置 ~/.cursor/coding-exoskeleton/user-config.json;修改已有类时不新增或改写作者注释在编码阶段,当需要创建新类时,参照以上规则确定命名。如果现有项目中有偏差(已有类名不符合规范),以项目已有风格为准,保持一致性。
在后端项目中设计或修改接口、DTO、错误码、鉴权、幂等、分页、批量操作和前后端联调契约时使用。适用于后端 profile,输出清晰的接口边界、兼容风险和验证路径。
将后端技术方案拆解为接口、应用服务、领域/业务逻辑、数据访问、消息/定时任务、迁移脚本和测试任务时使用。用于补充通用 implementation-planning 的后端归组口径。
分析后端接口、数据库访问、RPC/HTTP 调用、批处理、消息消费、事务和缓存相关性能风险时使用。强调证据、数据规模、低风险优化和回滚方案。
前端接入接口、修复提交失败、核对列表/详情/保存字段、处理类型漂移或空值风险时使用。输出契约不一致点、收敛方案和回归建议。
排查并修复前端渲染、状态、表单、表格、路由、API 映射、异步时序和性能回归问题时使用。要求可复现、可定位、可验证、最小修复。
在既有前端项目中新增或扩展页面、表单、列表、弹窗、批量操作、导入导出和权限交互时使用。强调先理解调用链、复用现有结构、最小改动落地。