返回 Skill 列表
extension
分类: 开发与工程无需 API Key

clean-architecture

Robert C. Martin的书籍中的清洁架构原则和最佳实践。在设计软件系统、审查代码结构或重构应用程序以实现更好的关注点分离时,应使用此技能。当任务涉及层次、边界、依赖方向、实体、用例或系统架构时触发。

person作者: jakexiaohubgithub

Clean Architecture Best Practices

Comprehensive guide to Clean Architecture principles for designing maintainable, testable software systems. Based on Robert C. Martin's "Clean Architecture: A Craftsman's Guide to Software Structure and Design." Contains 42 rules across 8 categories, prioritized by architectural impact.

When to Apply

Reference these guidelines when:

  • Designing new software systems or modules
  • Structuring dependencies between layers
  • Defining boundaries between business logic and infrastructure
  • Reviewing code for architectural violations
  • Refactoring coupled systems toward cleaner structure

Rule Categories by Priority

| Priority | Category | Impact | Prefix | |----------|----------|--------|--------| | 1 | Dependency Direction | CRITICAL | dep- | | 2 | Entity Design | CRITICAL | entity- | | 3 | Use Case Isolation | HIGH | usecase- | | 4 | Component Cohesion | HIGH | comp- | | 5 | Boundary Definition | MEDIUM-HIGH | bound- | | 6 | Interface Adapters | MEDIUM | adapt- | | 7 | Framework Isolation | MEDIUM | frame- | | 8 | Testing Architecture | LOW-MEDIUM | test- |

Quick Reference

1. Dependency Direction (CRITICAL)

2. Entity Design (CRITICAL)

3. Use Case Isolation (HIGH)

4. Component Cohesion (HIGH)

5. Boundary Definition (MEDIUM-HIGH)

6. Interface Adapters (MEDIUM)

7. Framework Isolation (MEDIUM)

8. Testing Architecture (LOW-MEDIUM)

How to Use

Read individual reference files for detailed explanations and code examples:

Reference Files

| File | Description | |------|-------------| | references/_sections.md | Category definitions and ordering | | assets/templates/_template.md | Template for new rules | | metadata.json | Version and reference information |