uncle-bob-craft
它能做什么
这个工具可以帮你依据良好的编程实践原则来审查和编写代码。它会检查代码组织是否清晰、是否容易理解,以及是否符合架构和专业规范。
适用场景
- ✓审查别人写的代码时。
- ✓编写或修改已有代码时。
- ✓讨论软件项目的整体结构时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/uncle-bob-craft/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请审查这段代码,看它是否遵循了 Clean Architecture 和 The Clean Coder 的原则。”
每周 5 个新技能,1 分钟读完。
工作原理
它会分析代码的结构、各部分之间的连接方式,以及它们是否遵循良好的组织和专业规范。它会在不改变核心功能的前提下提出改进建议。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Uncle Bob Craft
Apply Robert C. Martin (Uncle Bob) criteria for code review and production: Clean Code, Clean Architecture, The Clean Coder, Clean Agile, and design-pattern discipline. This skill is complementary to the existing @clean-code skill (which focuses on the Clean Code book) and to your project's linter/formatter—it does not replace them.
Overview
This skill aggregates principles from Uncle Bob's body of work for reviewing and writing code: naming and functions (via @clean-code), architecture and boundaries (Clean Architecture), professionalism and estimation (The Clean Coder), agile values and practices (Clean Agile), and design-pattern use vs misuse. Use it to evaluate structure, dependencies, SOLID in context, code smells, and professional practices. It provides craft and design criteria only—not syntax or style enforcement, which remain the responsibility of your linter and formatter.
When to Use This Skill
- Code review: Apply Dependency Rule, boundaries, SOLID, and smell heuristics; suggest concrete refactors.
- Refactoring: Decide what to extract, where to draw boundaries, and whether a design pattern is justified.
- Architecture discussion: Check layer boundaries, dependency direction, and separation of concerns.
- Design patterns: Assess correct use vs cargo-cult or overuse before introducing a pattern.
- Estimation and professionalism: Apply Clean Coder ideas (saying no, sustainable pace, three-point estimates).
- Agile practices: Reference Clean Agile (Iron Cross, TDD, refactoring, pair programming) when discussing process.
- Do not use to replace or override the project's linter, formatter, or automated tests.
Aggregators by Source
| Source | Focus | Where to go |
|---|---|---|
| Clean Code | Names, functions, comments, formatting, tests, classes, smells | Use @clean-code for detail; this skill references it for review/production. |
| Clean Architecture | Dependency Rule, layers, boundaries, SOLID in architecture | See reference.md and references/clean-architecture.md. |
| The Clean Coder | Professionalism, estimation, saying no, sustainable pace | See reference.md and references/clean-coder.md. |
| Clean Agile | Values, Iron Cross, TDD, refactoring, pair programming | See reference.md and references/clean-agile.md. |
| Design patterns | When to use, misuse, cargo cult | See reference.md and references/design-patterns.md. |
Design Patterns: Use vs Misuse
- Use patterns when they solve a real design problem (e.g., variation in behavior, lifecycle, or cross-cutting concern), not to look "enterprise."
- Avoid cargo cult: Do not add Factory/Strategy/Repository just because the codebase "should" have them; add them when duplication or rigidity justifies the abstraction.
- Signs of misuse: Pattern name in every class name, layers that only delegate without logic, patterns that make simple code harder to follow.
- Rule of thumb: Introduce a pattern when you feel the third duplication or the second reason to change; name the pattern in code or docs so intent is clear.
Smells and Heuristics (Summary)
| Smell / Heuristic | Meaning |
|---|---|
| Rigidity | Small change forces many edits. |
| Fragility | Changes break unrelated areas. |
| Immobility | Hard to reuse in another context. |
| Viscosity | Easy to hack, hard to do the right thing. |
| Needless complexity | Speculative or unused abstraction. |
| Needless repetition | DRY violated; same idea in multiple places. |
| Opacity | Code is hard to understand. |
Full lists (including heuristics C1–T9-style) are in reference.md. Use these in review to name issues and suggest refactors (extract, move dependency, introduce boundary).
Review vs Production
| Context | Apply |
|---|---|
| Code review | Dependency Rule and boundaries; SOLID in context; list smells; suggest one or two concrete refactors (e.g., extract function, invert dependency); check tests and professionalism (tests present, no obvious pressure hacks). |
…
常见问题
什么是代码“坏味道”?
指代码中可能存在问题或难以维护的迹象,比如僵化(改一个小地方就引发很多问题)或脆弱(修改后导致不相关的部分出错)。
什么是“依赖规则”?
这是一条架构原则,指最核心的代码(业务规则)不应依赖外部细节(比如数据库或图形界面)。
我需要用这个工具来替代代码格式化工具吗?
不需要,它是对格式化工具的补充。它关注的是组织结构和架构,而格式化工具负责代码的外观和风格。
详情
作者的原始描述
Use when performing code review, writing or refactoring code, or discussing architecture; complements clean-code and does not replace project linter/formatter.
热度
- GitHub 星标
- 48k
- 排名
- #6053
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。