xiaohongshu
xiaohongshu
arch-guard
進行代碼重構或新增模組時觸發。確保程式碼符合 Clean Architecture + DDD + CQRS 的層次關係,防止架構腐化。
Full skill instructions
確保程式碼放對位置,嚴格遵守領域驅動設計 (DDD) 與 Clean Architecture 的層次關係。
┌─────────────────────────────────────────────────┐
│ Presentation Layer │
│ (Controllers, Views, DTOs) │
├─────────────────────────────────────────────────┤
│ Application Layer │
│ (Use Cases, Application Services, Commands) │
├─────────────────────────────────────────────────┤
│ Domain Layer │
│ (Entities, Value Objects, Domain Services, │
│ Aggregates, Domain Events, Repositories IF) │
├─────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ (Repository Impl, External Services, DB, MQ) │
└─────────────────────────────────────────────────┘
核心原則:依賴只能向內指向,內層不能知道外層的存在
Presentation → Application → Domain ← Infrastructure
| 禁止情況 | 說明 | 違規範例 |
|---|---|---|
| Domain → Infrastructure | 領域層不能依賴基礎設施 | Domain Entity import JDBC |
| Domain → Application | 領域層不能依賴應用層 | Entity import UseCase |
| Domain → Presentation | 領域層不能依賴展示層 | Entity import Controller |
| Application → Presentation | 應用層不能依賴展示層 | UseCase import DTO |
Domain 層引用資料庫驅動
// ❌ 違規:Domain 層出現 JDBC/JPA 實作
package com.example.domain.entity;
import java.sql.Connection; // 禁止!
import javax.persistence.EntityManager; // 禁止!
Domain 層引用 Spring Framework
// ❌ 違規:Domain 層出現 Spring 註解
package com.example.domain.service;
import org.springframework.stereotype.Service; // 禁止!
import org.springframework.beans.factory.annotation.Autowired; // 禁止!
Domain 層引用外部 HTTP 客戶端
// ❌ 違規:Domain 層直接呼叫外部服務
package com.example.domain.service;
import org.springframework.web.client.RestTemplate; // 禁止!
Application 層包含業務邏輯
Repository 實作暴露在 Domain 層
src/main/java/com/example/
├── presentation/ # 展示層
│ ├── controller/
│ ├── dto/
│ │ ├── request/
│ │ └── response/
│ └── assembler/
│
├── application/ # 應用層
│ ├── command/ # CQRS Command
│ │ └── handler/
│ ├── query/ # CQRS Query
│ │ └── handler/
│ ├── service/ # Application Services
│ └── port/ # 輸出埠口定義
│ ├── inbound/
│ └── outbound/
│
├── domain/ # 領域層 (純 POJO)
│ ├── model/
│ │ ├── aggregate/
│ │ ├── entity/
│ │ └── valueobject/
│ ├── service/ # Domain Services
│ ├── event/ # Domain Events
│ ├── repository/ # Repository 介面
│ └── exception/ # Domain Exceptions
│
└── infrastructure/ # 基礎設施層
├── persistence/
│ ├── repository/ # Repository 實作
│ └── entity/ # JPA/ORM Entities
├── messaging/
├── external/ # 外部服務整合
└── config/ # 技術配置
// domain/service/OrderDomainService.java
package com.example.domain.service;
import org.springframework.stereotype.Service; // ❌
import com.example.infrastructure.repository.JpaOrderRepository; // ❌
@Service // ❌
public class OrderDomainService {
private final JpaOrderRepository repository; // ❌
}
// domain/service/OrderDomainService.java
package com.example.domain.service;
import com.example.domain.repository.OrderRepository; // ✅ 介面
public class OrderDomainService {
private final OrderRepository repository; // ✅ 依賴介面
}
// domain/repository/OrderRepository.java
package com.example.domain.repository;
public interface OrderRepository { // ✅ 純介面
Order findById(OrderId id);
void save(Order order);
}
// infrastructure/persistence/repository/JpaOrderRepository.java
package com.example.infrastructure.persistence.repository;
import org.springframework.stereotype.Repository; // ✅ 在 Infrastructure
import com.example.domain.repository.OrderRepository;
@Repository
public class JpaOrderRepository implements OrderRepository {
// JPA 實作
}
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