microwind/ai-skills/clean-architecture
Claude Code and agent skill by microwind/ai-skills
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
通过依赖规则将系统分为同心圆层次,内层不依赖外层,实现业务逻辑与技术细节的完全分离。
Install
npx vskill@latest install microwind/ai-skills/clean-architectureSKILL.md
清洁架构 (Clean Architecture)
概述
清洁架构由 Robert C. Martin(Uncle Bob)提出,核心是依赖规则:源码依赖只能指向内层。
代码示例
依赖规则
与六边形架构的对比
| 维度 | 清洁架构 | 六边形架构 | |
|---|---|---|---|
| 层次 | 4层同心圆 | 内外两区(核心 + 适配器) | |
| 重点 | 依赖规则 | 端口与适配器 | |
| Entity层 | 独立的最内层 | 包含在核心中 | |
| 本质 | 相同理念,不同表达 | 相同理念,不同表达 |
最佳实践
- Entity 层零依赖 — 纯 Java/Python 对象,不引入任何框架
- Use Case 通过接口访问外部 — Gateway 接口定义在 Use Case 层
- 数据跨层传递用 DTO — 不让 Entity 泄漏到外层
- 框架是细节 — Spring、Django 等都在最外层
与其他DDD概念的关系
总结
核心:依赖只能从外向内,业务逻辑在最内层,不依赖任何技术细节。
实践:Entity → Use Case → Adapter → Framework,每层通过接口与外层通信。
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdomain-driven-design/clean-architecture/SKILL.md
Popularity
- Repository stars
- 51
- Repository forks
- 13
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microwind/ai-skills/clean-architecture)