xiaohongshu
xiaohongshu
ddd-architect
Ensure code follows DDD architecture and DAL separation for both frontend and backend. Triggers: DDD, arch, 架構, 新功能, 新模組, new feature, scaffold, 骨架, domain, layer, 分層, structure, 結構, backend, frontend, React, Vue, Python, TypeScript, 前端, 後端, component, 元件.
Full skill instructions
確保前後端程式碼遵循 DDD 架構與 DAL 分離原則。
當建立新功能時,自動生成 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
| 層級 | 職責 | 可依賴 |
|---|---|---|
| Domain | 業務規則、Entity、Value Object | 無外部依賴 |
| Application | Use Case、DTO、編排 | Domain |
| Infrastructure | Repository 實作、外部 API | Domain |
| Presentation | API、CLI、UI | Application |
「新增 User 管理功能 (React)」
生成:
src/
├── domain/
│ ├── models/
│ │ └── User.ts # Entity 類型定義
│ ├── types/
│ │ └── UserTypes.ts # Value Object 類型
│ └── rules/
│ └── userValidation.ts # 純業務規則(無框架依賴)
│
├── application/
│ ├── hooks/
│ │ └── useUser.ts # 業務邏輯 Hook
│ ├── stores/
│ │ └── userStore.ts # 狀態管理 (Zustand/Redux)
│ └── services/
│ └── UserService.ts # 應用服務(編排)
│
├── infrastructure/
│ ├── api/
│ │ └── userApi.ts # API Client (fetch/axios)
│ ├── storage/
│ │ └── userStorage.ts # LocalStorage/SessionStorage
│ └── adapters/
│ └── userAdapter.ts # API Response → Domain Model
│
└── presentation/
├── components/
│ └── UserCard.tsx # UI 元件
├── pages/
│ └── UserListPage.tsx # 頁面
└── layouts/
└── UserLayout.tsx # 佈局
「新增 Product 管理功能 (Vue)」
生成:
src/
├── domain/
│ ├── models/
│ │ └── Product.ts
│ ├── types/
│ │ └── ProductTypes.ts
│ └── rules/
│ └── productValidation.ts
│
├── application/
│ ├── composables/
│ │ └── useProduct.ts # Composition API
│ ├── stores/
│ │ └── productStore.ts # Pinia Store
│ └── services/
│ └── ProductService.ts
│
├── infrastructure/
│ ├── api/
│ │ └── productApi.ts
│ └── adapters/
│ └── productAdapter.ts
│
└── presentation/
├── components/
│ └── ProductCard.vue
├── views/
│ └── ProductListView.vue
└── layouts/
└── ProductLayout.vue
| 層級 | React | Vue 3 | 職責 |
|---|---|---|---|
| Domain | models/, types/, rules/ | 同左 | 純 TypeScript,無框架 |
| Application | hooks/, stores/ | composables/, stores/ | 業務邏輯封裝 |
| Infrastructure | api/, adapters/ | 同左 | 外部服務對接 |
| Presentation | components/, pages/ | components/, views/ | UI 元件 |
偵測並警告:
偵測並警告:
✅ Presentation → Application → Domain
✅ Infrastructure → Domain (實作介面)
❌ Domain → Infrastructure
❌ Domain → Application
❌ Domain → React/Vue/框架
🏗️ DDD 架構檢查 (Backend)
✅ 依賴方向正確
✅ DAL 正確分離
⚠️ 警告:
- src/Domain/Services/UserService.py:15
導入了 Infrastructure 模組
建議:
將資料庫操作移至 Repository
🏗️ DDD 架構檢查 (Frontend - React)
✅ Domain 層無框架依賴
✅ API 呼叫正確封裝於 infrastructure/
⚠️ 警告:
- src/presentation/components/UserCard.tsx:23
直接呼叫 fetch(),應使用 useUser hook
建議:
將 API 呼叫移至 src/application/hooks/useUser.ts
「建立後端 Order 領域」 → 生成 Python DDD 結構
「建立前端 User 功能」 → 詢問 React/Vue,生成對應結構
「架構檢查」 → 掃描全專案違規
「前端架構檢查」 → 僅掃描前端
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience