Cleanddd Dotnet Coding
在 CleanDDD 项目中落地已建模的需求(聚合/命令/查询/API 端点(Endpoints)/事件/仓储/配置/测试)的编码指南;用于编写或修改业务功能、端点与数据访问时
Install
npx skills add zhouda1fu/Ncp.Admin --skill cleanddd-dotnet-codinggit clone --depth 1 https://github.com/zhouda1fu/Ncp.Admin.git /tmp/Ncp.Admin
mkdir -p ~/.claude/skills
cp -r /tmp/Ncp.Admin/.cursor/skills/cleanddd-dotnet-coding ~/.claude/skills/cleanddd-dotnet-codingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the 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()` 内配置路由、`Tags`、`AuthSchemes`、`Permissions`、`Description` 等。IMediator 构造注入,使用 Send.OkAsync/CreatedAsync/NoContentAsync 与 .AsResponseData()。
## 推荐工作流
1) 聚合与实体 → 2) 领域事件 → 3) 仓储与实体配置 → 4) 命令+验证器+处理器 → 5) 查询+验证器+处理器 → 6) API 端点(Endpoints) → 7) 领域事件处理器 → 8) 集成事件/转换器/处理器 → 9) 测试。
## 目录结构
- Domain:src/ProjectName.Domain/(AggregatesModel/{Aggregate}Aggregate,DomainEvents)。
- Infrastructure:src/ProjectName.Infrastructure/(Repositories,EntityConfigurations,ApplicationDbContext)。
- Web:src/ProjectName.Web/Application/(Commands,Queries,DomainEventHandlers,IntegrationEvents,IntegrationEventConverters,IntegrationEventHandlers);Endpoints。
- Tests:test/* 对应各层。
## 统一命名与放置约定
- 命名风格:全部使用 PascalCase;record/class/接口按 .NET 惯例;事件使用过去式。
- 强类型 ID:命名为 {Entity}Id,定义为 `public partial record`,与实体/聚合同文件。
- 文件命名:
- 命令:{Action}{Entity}Command.cs;同文件包含验证器与处理器。
- 查询:{Action}{Entity}Query.cs;同文件包含响应/DTO、验证器与处理器。
- 端点:{Action}{Entity}Endpoint.cs;每文件一个端点。Details
- Skill name
cleanddd-dotnet-coding- Repository
- zhouda1fu/Ncp.Admin
- Path
.cursor/skills/cleanddd-dotnet-coding/SKILL.md- Repo updated
- 23 June 2026
FAQ
What does the Cleanddd Dotnet Coding skill do?
在 CleanDDD 项目中落地已建模的需求(聚合/命令/查询/API 端点(Endpoints)/事件/仓储/配置/测试)的编码指南;用于编写或修改业务功能、端点与数据访问时
How do I install the Cleanddd Dotnet Coding skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add zhouda1fu/Ncp.Admin --skill cleanddd-dotnet-coding. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Cleanddd Dotnet Coding popular?
It lives in zhouda1fu/Ncp.Admin, which has 49 GitHub stars and 12 forks.
Related skills
Cleanddd Coach
49zhouda1fu/Ncp.Admin
交互式 CleanDDD 教练技能,循序讲解并与用户互动练习 CleanDDD 核心原则与方法;包含微课、测验与检查清单,可承接到需求分析/建模/代码实现技能
Cleanddd Dotnet Init
49zhouda1fu/Ncp.Admin
初始化 CleanDDD dotnet 项目(netcorepal-web 模板);在创建新项目或为客户演示快速拉起解决方案时使用,可直接调用 dotnet new 或包装脚本
Cleanddd Modeling
49zhouda1fu/Ncp.Admin
基于 cleanddd-requirements-analysis 结果,输出符合 CleanDDD 的聚合、命令、事件、查询、API 端点(Endpoints)、定时任务模型;用于从已拆解的需求快速得到建模蓝图
Codex
38sypsyp97/claude-skill-codex
Executes OpenAI Codex CLI for code analysis, refactoring, and automated editing. Activates when users mention codex commands, code review requests, or automated code transformations requiring advanced reasoning models.
Weather
44iamclancyliang/nanobot-eino
Get current weather and forecasts (no API key required).
Abm 1 to Many
79LeadMagic/gtm-skills
Runs programmatic 1-to-many ABM for 50-200+ accounts: automated personalization, scaled outbound, intent-based targeting, and lookalike expansion. Use when ABM coverage must grow without adding headcount or when the user wants automated account-based outreach. Triggers on: "1-to-many ABM", "programmatic ABM", "scaled ABM", "automated ABM".
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.