/backend:domain-modelfrom backend
領域實體(Entity)定義:欄位與資料表映射、legacy 欄位名映射、驗證規則、型別對照、主表不可動時的擴充表策略。附 .NET(EF Core)附錄。Use when 建立新資料庫 Entity、定義 Domain Model、映射舊資料庫欄位、擴充表、entity mapping、data annotation、ef core entity。
Ships in backend. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
先看專案的 *.csproj(EF Core)、go.mod、pyproject.toml、package.json(ORM schema)、pom.xml、migration 目錄、既有 Entity 目錄,對照下表載入附錄,並在回報第一行寫「附錄:<檔名>」。
| 偵測到 | 附錄 |
|---|---|
*.csproj/*.sln(.NET) | ${CLAUDE_PLUGIN_ROOT}/references/stacks/dotnet.md(共用)+ references/dotnet.md(Data Annotations、legacy 欄位映射、Ext 表) |
go.mod、pyproject.toml、node 後端的 package.json、pom.xml 等 | 目前沒有附錄,走下方退路 |
沒有對應附錄:照本 skill 的通用方法,加上專案既有程式的寫法(先找 2–3 個同類檔當樣板;有裝 workspace 就照 workspace:convention-first(可選))。做完問使用者要不要把這次的寫法整理成新附錄 references/stacks/<stack>.md,回報寫「附錄:無(照既有程式)」。
OrderId ↔ 欄位 ORDER_NO)。Order(訂單)示範,實作時換成實際實體名。| 資料特性 | 做法 |
|---|---|
| 字串 | 明確長度;非 Unicode 欄位(varchar)要標示,避免隱性轉換拖慢索引 |
| 金額/數量 | 定點小數並明寫精度(如 18,2),不用浮點 |
| 日期時間 | 可為空與否要和欄位一致;明寫資料庫型別 |
| 布林 | 對應 bit/boolean;刪除標記用布林旗標 |
| 版本戳(rowversion/timestamp) | 位元組陣列,作樂觀鎖 |
舊系統主表不可新增欄位(避免影響舊程式或跨系統相依)時,新欄位放對應擴充表(如 OrderExt),與主表 1:1 主鍵相對。
若新欄位需同時被主表 DTO 接收(API binding):
I{Entity}ExtRepository;禁止在 Handler 直接注入 DbContext 操作 Ext 表。Domain/Entities/
├── {ModuleA}/ # 模組實體
├── {ModuleB}/
└── dbo/ # 舊系統原生資料表(保留 legacy 命名)
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kerryhuang/plugharbor --plugin backend7 skills in this plugin
/api-endpoint對外 API 端點開發:標準 CRUD 端點、版本控制、回應模型與狀態碼、分頁契約、Request 驗證。附 .NET(ASP.NET Core Controller)附錄。Use when 建立新 API Controller、新增 REST 端點、實作 API versioning、api endpoint、webapi controller、crud controller、REST API。/background-job背景作業與排程開發:Job 類別設計、DI 註冊、排程類型(固定 Cron、延遲、自動重排)、冪等與失敗處理。附 .NET(Hangfire)附錄。Use when 建立新背景作業、設定排程、需要 Job 開發範本、background job、recurring job、hangfire job、cron、排程作業。/cqrsCQRS 用例拆分:Command/Query Handler、Notification 事件、交易管線、分頁查詢與回傳規則。附 .NET(MediatR)附錄。Use when 新增 Handler、實作 CRUD 操作、cqrs、command handler、query handler、mediator、notification、交易管線、transaction behavior。Other plugins' skills for the same job