cleanddd-dotnet-coding
Installation
SKILL.md
使用时机
- 在本仓库编写/修改业务功能、命令、查询、端点、集成事件、仓储、实体配置或相关测试时加载。
前置输入
- 建模设计:已完成 CleanDDD 需求分析与建模,获得聚合、命令、查询、事件等设计文档。
开始前快速检查
- 是否已有 cleanddd-modeling 的聚合/命令/事件/API 端点(Endpoints)清单,缺失先补齐。
- 确认聚合边界与不变式;命名统一 PascalCase,枚举固定拼写。
- 约定:命令处理器不显式 SaveChanges;跨聚合交互用领域事件/集成事件,禁直接跨聚合更新。
通用原则
- 优先用主构造函数,所有 IO/仓储/EF 调用使用 async/await 并传递 CancellationToken。
- 严格分层:Web → Infrastructure → Domain;聚合与实体发布领域事件,命令处理器不显式 SaveChanges。
- 强类型 ID 由 EF 值生成器提供;构造函数不设置 ID,直接使用类型实例,避免 .Value。
- 业务异常使用 KnownException;FastEndpoints 用特性配置,不使用 Configure();IMediator 构造注入,使用 Send.OkAsync/CreatedAsync/NoContentAsync 与 .AsResponseData()。
Related skills
More from netcorepal/cleanddd-skills
cleanddd-requirements-analysis
需求澄清与拆解,识别干系人并将需求条目标注所属对象与业务实体;仅产出结构化需求描述,不做建模定义,可作为后续建模输入
33cleanddd-dotnet-init
初始化 CleanDDD dotnet 项目(netcorepal-web 模板);在创建新项目或为客户演示快速拉起解决方案时使用,可直接调用 dotnet new 或包装脚本
18cleanddd-modeling
基于 cleanddd-requirements-analysis 结果,输出符合 CleanDDD 的聚合、命令、事件、查询、API 端点(Endpoints)、定时任务模型;用于从已拆解的需求快速得到建模蓝图
16skill-creator
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
11