ddd-clean-architecture by teachingai/full-stack-skills
npx skills add https://github.com/teachingai/full-stack-skills --skill ddd-clean-architecture当用户希望实现以下目标时,请使用此技能:
com.example.app/
├── entity/ # 实体 — 业务规则,无依赖
├── usecase/ # 用例 — 应用逻辑,仅依赖实体
│ ├── port/ # 输入/输出端口接口
│ └── interactor/ # 用例实现
├── adapter/ # 接口适配器 — 展示器、网关
│ ├── controller/ # Web 控制器
│ ├── presenter/ # 响应格式化
│ └── gateway/ # 网关实现
└── framework/ # 框架 — 数据库、Web 服务器、外部 API
├── web/
└── persistence/
// Use case port (input boundary)
public interface CreateOrderUseCase {
OrderOutput execute(CreateOrderInput input);
}
// Use case interactor
public class CreateOrderInteractor implements CreateOrderUseCase {
private final OrderGateway orderGateway;
private final PaymentGateway paymentGateway;
public CreateOrderInteractor(OrderGateway orderGateway, PaymentGateway paymentGateway) {
this.orderGateway = orderGateway;
this.paymentGateway = paymentGateway;
}
@Override
public OrderOutput execute(CreateOrderInput input) {
Order order = Order.create(input.getItems());
paymentGateway.charge(order.totalAmount());
orderGateway.save(order);
return OrderOutput.from(order);
}
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
public interface OrderGateway {
void save(Order order);
Optional<Order> findById(String id);
}
clean architecture, dependency rule, use case, entity, interface adapter, gateway, layer separation, DDD, testability
每周安装量
83
代码仓库
GitHub 星标数
248
首次出现
Jan 24, 2026
安全审计
安装于
opencode72
gemini-cli71
codex70
github-copilot65
amp57
kimi-cli56
Use this skill whenever the user wants to:
com.example.app/
├── entity/ # Entities — business rules, no dependencies
├── usecase/ # Use Cases — application logic, depends only on entity
│ ├── port/ # Input/output port interfaces
│ └── interactor/ # Use case implementations
├── adapter/ # Interface Adapters — presenters, gateways
│ ├── controller/ # Web controllers
│ ├── presenter/ # Response formatting
│ └── gateway/ # Gateway implementations
└── framework/ # Frameworks — DB, web server, external APIs
├── web/
└── persistence/
// Use case port (input boundary)
public interface CreateOrderUseCase {
OrderOutput execute(CreateOrderInput input);
}
// Use case interactor
public class CreateOrderInteractor implements CreateOrderUseCase {
private final OrderGateway orderGateway;
private final PaymentGateway paymentGateway;
public CreateOrderInteractor(OrderGateway orderGateway, PaymentGateway paymentGateway) {
this.orderGateway = orderGateway;
this.paymentGateway = paymentGateway;
}
@Override
public OrderOutput execute(CreateOrderInput input) {
Order order = Order.create(input.getItems());
paymentGateway.charge(order.totalAmount());
orderGateway.save(order);
return OrderOutput.from(order);
}
}
public interface OrderGateway {
void save(Order order);
Optional<Order> findById(String id);
}
clean architecture, dependency rule, use case, entity, interface adapter, gateway, layer separation, DDD, testability
Weekly Installs
83
Repository
GitHub Stars
248
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode72
gemini-cli71
codex70
github-copilot65
amp57
kimi-cli56
站立会议模板:敏捷开发每日站会指南与工具(含远程团队异步模板)
10,500 周安装
社交媒体内容多平台适配器 - AI内容重制工具,一键优化Twitter/LinkedIn/Instagram/Facebook/TikTok
148 周安装
Rust Trait 探索器 - 快速查找 trait 实现与多态设计分析工具
232 周安装
阿里云轻量应用服务器SWAS-OPEN API管理指南:实例、磁盘、快照、镜像、防火墙
265 周安装
阿里云AIRec智能推荐管理技能 - 使用OpenAPI/SDK管理AI推荐引擎
265 周安装
阿里云文档API质量评审工具 - 自动化产品文档与OpenAPI评审报告生成
266 周安装
阿里云文档智能DocMind Node.js SDK使用教程:异步提取文档结构、文本和布局
266 周安装