Uncle Bob open-sources ub-mode Skills, setting three disciplines for coding agents
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
Body · AI translation
Uncle Bob's condensed discipline Skills for Agents: first make it work, then make it right, then build habits
Clean Code author @unclebobmartin has open-sourced the Skills "ub-mode", distilling classic Clean Code / TDD discipline into three stages for coding agents: first make it work, then make it right using CRAP / duplication / mutation testing, and finally wrap up with logging, small commits, and context hygiene; the principles come from humans, and the thresholds are made as machine-measurable as possible.
Open-source address: https://t.co/z9kNNIX9Vm
# Three-stage process (follow for every change)
1. First Make it Work Lazy protocol (one decision point, minimal change), define the data shape first, write the failing test first, redesign from first principles instead of patching the old design, when two fixes with the same premise both hit the same gate, question the premise first, subtract before adding, aim for an acceptable end state, and for hard work build the "leverage" tool first. Architecture side: make illegal states unrepresentable in the domain structure, validate at boundaries, don't let types stay silent, be idempotent, and split apart shared mutable state first.
2. Then Make it Right Fix the root cause instead of blocking the crash; cut work into acceptable small units; test behavior, not implementation. Then apply the tool gates: · crapper: cyclomatic complexity + coverage → CRAP < 10 · dryer: structural duplication ≥ 0.8 must be eliminated · mutator: fill uncovered gaps, kill surviving mutants, delete dead code · refactoring: pin down behavior first → change structure → prove behavior is unchanged (There is also uml-viewer to inspect components, coverage, CRAP, mutation score, and dependency direction.)
3. Practice Log actions + reasons and report them at the end; keep the main-thread context small; clean up worktrees; make small, ordered commits (clearly state why, what changed, and how it was proven), and only then push to main.