ub-mode: Uncle Bob's Skill for Disciplined AI Coding

By Indie Kings | October 29, 2026

Updated October 29, 2026: unclebob/ub-mode is a 4 kilobyte repository containing one skill file that tells coding agents how to write software the way Robert C. Martin has argued software should be written. It was created on October 25, 2026, has 3,668 stars and 189 forks from a single contributor, and it has no license, which means the rules are readable but not formally reusable.

Source code displayed on a computer screen

Image: source code on a screen, via Wikimedia Commons.

Three phases and a lot of rules

The file is short enough to read in a sitting, which is the point. It organizes its guidance into three phases. First make it work covers what the README calls a laziness protocol, foundational thinking, test driven development, redesign from first principles, attacking the premise, subtracting before adding, outcome oriented execution, building the lever, and architecture rules around modeling the domain, boundary discipline, type system discipline, idempotent operations and separating shared state before serializing it.

Then make it right is the cleanup phase: fix root causes, sequence work into verifiable units, test behavior rather than implementation, run the quality tools, and refactor. Practice is the working habits layer: keep a log, guard the context window, clean up worktrees, and commit and push in small ordered commits. The README notes that the skill is loosely based on poteto's rules, known as poteto-mode or pstack, reduced and then paired with deterministic tooling.

That lineage is worth naming because it explains the shape. poteto's rules circulated as a compact set of instructions for getting better output from coding agents, and the common failure of such documents is that they grow into unreadable manifestos as every contributor adds a favorite principle. ub-mode goes the other way: it compresses the rules and moves the enforcement into separate programs. The prose says what good looks like, and the tools decide whether the code meets it.

Quality gates instead of advice

The three companion tools are the substance of the idea. Crapper computes the CRAP metric, change risk anti patterns, which combines cyclomatic complexity with test coverage, and the rule is that a method must score below 10. Dryer measures duplication and enforces a threshold below 0.8. Mutator runs mutation testing: it changes the code in small ways, checks whether the tests notice, and reports survived mutants, which are the cases where a test exists but does not actually assert anything useful. The instruction is to cover the uncovered, kill the survivors and delete dead code.

This is the part that separates ub-mode from a prompt full of adjectives. Asking a model to write clean code produces code that reads clean, which is not the same thing. A complexity ceiling, a duplication score and a mutation report are measurements, and a model can be told to run them and fix what fails. The loop is mechanical: generate, measure, repair, repeat. It also caps the amount of damage a single agent turn can do, because a change that pushes a method over the CRAP threshold fails visibly instead of being buried in a long diff.

The architectural rules have the same intent at a different scale. Boundary discipline and type system discipline are about making illegal states hard to represent, and the instruction to separate before serializing shared state is a direct warning about a common concurrent design mistake. None of these are novel ideas; they are the standard arguments from clean code literature, restated for a reader that is a language model rather than a junior developer. What is new is packaging them as an installable skill with a numeric pass condition attached.

What a 4 KB repo can and cannot do

Four kilobytes is smaller than most README files. The repository contains a skill definition and a short explanation, and that is all. There is no harness, no installer script, no test suite and no license. The companion tools live in their own repositories under the same account, and the user is expected to install them separately. That minimalism is why the project spread quickly: it is a file you can read in five minutes and drop into an agent's context without a dependency tree.

The missing license is the practical problem. Without one, default copyright applies, so the text cannot be legally reused, modified or redistributed in the usual open source sense, even though GitHub makes it trivially forkable. For individual use inside an agent session that is a gray area most people will ignore, but anyone packaging ub-mode into a product, a course or a company template needs permission first. A one line license would fix it, and its absence is the clearest sign that this is a personal artifact published in a hurry rather than a maintained project.

There is also a category question. A skill file is not a linter. It cannot enforce anything by itself, and its effect depends entirely on whether the agent reads it, remembers it across a long session and chooses to comply. The deterministic tools help because they produce output the agent must confront, but the agent still has to run them. That is the same trust problem as every prompt based workflow: the instructions are a strong prior, not a guarantee. Anyone expecting ub-mode to make an unreliable model reliable will be disappointed, and anyone using it to give a capable model better defaults will get real value.

Project card

ItemDetail
Repositoryunclebob/ub-mode on GitHub
What it isAn agent skill for disciplined software engineering, packaged as one file
CreatedOctober 25, 2026
SizeAbout 4 KB, single SKILL.md
StructureFirst make it work, then make it right, then practice
Quality gatesCRAP below 10, duplication below 0.8, mutation testing survivors
Companion toolsCrapper, Dryer and Mutator, installed separately
LineageLoosely based on poteto's rules, reduced and paired with tooling
LicenseNone declared
Scale3,668 stars, 189 forks, 1 contributor, 5 open issues

FAQ

What is ub-mode?
A single skill file for AI coding agents that states a disciplined workflow and points at three tools that measure whether the resulting code passes.

Who made it?
The GitHub account unclebob, the account of Robert C. Martin, who has written extensively about clean code and software craftsmanship.

Does it include the tools?
No. Crapper, Dryer and Mutator are separate repositories and have to be installed alongside the skill.

Can I reuse it in my own project?
Not without permission. The repository declares no license, so default copyright applies despite the code being publicly visible.

What is the CRAP threshold?
A score below 10, combining cyclomatic complexity with test coverage so that complex, poorly tested methods fail.

Will it make an AI write perfect code?
No. It shifts the default toward smaller, tested changes and gives the agent measurable checks, but compliance still depends on the agent running them.

Bottom Line

ub-mode is a good idea executed as a leaflet: four kilobytes of principles plus a pointer to three measurement tools, published without a license and without an installer. The principles are not new, but the framing is useful, because it turns a style argument into a pass or fail condition an agent can act on. The mutation testing step is the strongest part, since it targets the exact failure mode of AI written tests, which is a test that runs and asserts nothing. Use it as a checklist for a capable model, install the three tools yourself, and ask the author for a license before you ship it inside anything.

Sources

  • GitHub unclebob/ub-mode README and SKILL.md description, three phases, quality gates and companion tools, accessed October 29, 2026
  • GitHub API metadata for unclebob/ub-mode, stars, forks, contributors, size and creation date, accessed October 29, 2026
  • Repository license field, checked October 29, 2026, which reports no license

Related: Dear ImGui 1.93.0: The ImDrawList Overhaul Rewrites Line Rendering | Deadcell Framework: A Pinned Imgui 1.89.5 Snapshot for a DX11 Menu

Share