with one click
add-domain
创建新业务领域模块骨架(Model→DAL→Converter→Logic→Wire)
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
创建新业务领域模块骨架(Model→DAL→Converter→Logic→Wire)
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 | add-domain |
| description | 创建新业务领域模块骨架(Model→DAL→Converter→Logic→Wire) |
| argument-hint | <domain-name> |
为 RPC 服务创建完整的业务领域目录结构和骨架代码,并集成到三个聚合接口。
用户输入: $ARGUMENTS(领域名称,例如 notification、audit)
根据用户输入 $ARGUMENTS,确认:
创建 rpc/identity_srv/models/<domain>.go:
gorm:"primaryKey" 等标准标签创建 rpc/identity_srv/biz/dal/<domain>/ 目录:
接口文件 <entity>_interface.go
biz/dal/user/user_profile_interface.go<Entity>Repository(无 I 前缀)实现文件 <entity>_repository.go
biz/dal/user/user_profile_repository.go<Entity>RepositoryImpl*gorm.DB 作为依赖errno.WrapDatabaseError()聚合注册:在 biz/dal/dal.go 中
<Entity>() <Entity>Repository 方法biz/dal/dal_impl.go 中添加对应实现创建 rpc/identity_srv/biz/converter/<domain>/ 目录:
接口文件 <entity>.go
biz/converter/user/user_profile.go<Entity>Converter实现文件 <entity>_impl.go
biz/converter/user/user_profile_impl.go<Entity>ConverterImpl聚合注册:更新 biz/converter/converter.go
创建 rpc/identity_srv/biz/logic/<domain>/ 目录:
接口文件 <entity>_logic.go
biz/logic/user/user_profile_logic.go<Entity>Logic实现文件 <entity>_logic_impl.go
biz/logic/user/user_profile_logic_impl.go<Entity>LogicImpl聚合注册:更新 biz/logic/logic.go,嵌入新领域接口
rpc/identity_srv/wire/provider.go 添加新领域的 Providercd rpc/identity_srv/wire && wirecd rpc/identity_srv && go build ./...
cd rpc/identity_srv && go vet ./...
确认编译通过,三个聚合接口(dal.go、converter.go、logic.go)均已正确集成。
创建完成后,列出所有新建和修改的文件:
docs/00-项目概览/架构设计.md 和 docs/02-开发规范/开发指南.md 了解架构和开发规范I 前缀,实现加 Impl 后缀A-BB-CCC 格式在 pkg/errno/ 中定义新领域错误码根据错误信息进行分类诊断,定位根因并给出修复方案
添加新 HTTP 端点(IDL→网关层全流程)
端到端添加新 RPC 接口(IDL→全层实现)
代码质量检查(编译、Lint、测试覆盖率、架构合规)
执行代码生成(Kitex/Hertz/Wire,支持自动检测)
API 网关日志编写规范。在域服务、中间件、基础设施层编写日志代码时自动加载。