unclebob/ub-mode:5.2k stars 的 agent skill,把 Robert C. Martin 的软件工程准则做成可执行的质量门禁
unclebob/ub-mode 是 Clean Architecture 作者 Robert C. Martin 在 2026-10-25 新建的 agent skill 仓库,5,256 stars / 290 forks / 仅 4 次提交 / 2 个文件(README.md + SKILL.md,共约 6KB),本体不含任何代码,而是一套写给 AI 编码 agent 的行为准则。它把工程实践拆成三层——First Make it Work(Laziness Protocol、TDD、Subtract Before You Add、Idempotent Operations、Separate Before Serializing Shared State 等 13 条)、Then Make it Right(Fix Root Causes、Test Behavior Not Implementation、CRAP<10、重复度<0.8、变异测试、Crapper/Dryer/Mutator 三件套、Refactoring 等 8 条)、Practice(Keep a Log、Guard the Context Window、Worktree Cleanup、小步 commit push 等 4 条)。真正的执行力来自四个确定性 companion 工具:unclebob/crapper(146 stars,Python,0BSD)用 CRAP = CC² × (1-coverage)³ + CC 公式给 6 种语言算圈复杂度与覆盖率并写 .metrics/crap.edn;unclebob/dryer(70 stars,0BSD)用 Jaccard 结构指纹找重复代码,默认阈值 0.82;unclebob/mutator(87 stars,0BSD)对 6 种语言做变异测试并输出 killed/survived/uncovered;unclebob/uml-viewer(474 stars,Clojure)作为活的 UML 类图查看器把 namespace 当 component,按 Clean Architecture 依赖规则染色并与 agent 双向联动做 what-if 改架构。整个方案的设计哲学是「原则写给人看,数字交给工具判定」,用可测量的门禁替代 AI 自我声明的「我已经重构好了」。