Ddd architect

From u9401066/pubmed-search-mcp · View interactive version

Ddd architect is an AI agent skill from the GitHub repository u9401066/pubmed-search-mcp. Ensure code follows DDD architecture and DAL separation principles. Triggers: DDD, arch, 架構, 新功能, 新模組, new feature, scaffold, 骨架, domain.

How to use this skill

Skill file

DDD 架構輔助技能

描述

確保程式碼遵循 DDD 架構與 DAL 分離原則。

觸發條件

法規依據

功能

1. 新功能腳手架

當建立新功能時,自動生成 DDD 結構:

「新增 Order 領域」

生成:
src/
├── Domain/
│   ├── Entities/Order.py
│   ├── ValueObjects/OrderId.py
│   ├── Aggregates/OrderAggregate.py
│   └── Repositories/IOrderRepository.py
├── Application/
│   ├── UseCases/CreateOrder.py
│   └── DTOs/OrderDTO.py
└── Infrastructure/
    └── Persistence/Repositories/OrderRepository.py

2. 架構違規檢查

偵測並警告:

3. 依賴方向驗證

✅ Presentation → Application → Domain
✅ Infrastructure → Domain (實作介面)
❌ Domain → Infrastructure
❌ Domain → Application

輸出格式

🏗️ DDD 架構檢查

✅ 依賴方向正確
✅ DAL 正確分離
⚠️ 警告:
  - src/Domain/Services/UserService.py:15
    導入了 Infrastructure 模組

建議:
  將資料庫操作移至 Repository
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.