←News detail

Shao MengUpdated Oct 27 13:30

Uncle Bob open-sources ub-mode Skills, setting three disciplines for coding agents

English text is being prepared.

AI summary

Uncle Bob, author of Clean Code, has open-sourced Skills "ub-mode", organizing Clean Code and TDD discipline into a three-stage workflow for coding agents: first make the change run, then make it right using CRAP, structural duplication, and mutation testing, and finally wrap up with logging, small commits, and context hygiene. The second stage comes with tool gates such as crapper, dryer, and mutator; for example, CRAP must be below 10, and structural duplication reaching 0.8 must be eliminated. There is also uml-viewer for viewing components, coverage, CRAP, mutation scores, and dependency direction.

Why read this

AI score 60

Breaks Clean Code and TDD discipline into three executable agent workflows, and provides machine-quantifiable gates such as CRAP, duplication rate, and mutation testing.

Topics

Tags

Body

Uncle Bob 给 Agent 的精简纪律 Skills:先跑通,再做对,再养成习惯

Clean Code 作者 @unclebobmartin 开源的 Skills「ub-mode」,把经典 Clean Code / TDD 纪律沉淀为三段给 coding agent 用:先让它 work,再用 CRAP / 重复 / 变异测试做对,最后用日志、小提交和上下文卫生收尾;原则来自人,门槛尽量可机器量。

开源地址:https://t.co/z9kNNIX9Vm

# 三段流程(每次改动都走)

1. First Make it Work 懒惰协议(一处决策、最小改动)、先定数据形状、先写会失败的测试、从第一性原理重设计而不是往旧设计上打补丁、两个同前提的修法都撞同一道闸时先质疑前提、先减再加、瞄准可验收的终态、难活先做「杠杆」工具。架构侧:领域结构让非法状态不可表示、边界校验、类型不闭嘴、幂等、共享可变状态先拆开。

2. Then Make it Right 修根因而不是挡崩溃;工作切成可验收的小单元;测行为不测实现。然后上工具闸门: · crapper:圈复杂度 + 覆盖 → CRAP < 10 · dryer:结构重复 ≥ 0.8 要消 · mutator:补未覆盖、杀幸存变异体、删死代码 · 重构:先钉住行为 → 改结构 → 证明行为未变 (另有 uml-viewer 看组件、覆盖、CRAP、变异分与依赖方向。)

3. Practice 行动+理由记日志并在结束时汇报;主线程上下文要小;worktree 清理;小而有序的 commit(写清为什么、改了什么、怎么证明),最后再推主线。

Source

Shao Meng