Skip to content
Back to search

ub-mode

SkillWorks with Claude CodeGitHub

Follow the reduced principles when writing or changing code. Every change follows First Make it Work, then Then Make it Right, then Follow Practice. Use when the user runs /ub-mode or asks for the reduced principles.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/unclebob--ub-mode/badge.svg)](/listings/unclebob--ub-mode)

HTML

<a href="/listings/unclebob--ub-mode"><img src="/api/listings/unclebob--ub-mode/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Copy `SKILL.md` into your agent's skills directory as `ub-mode/SKILL.md` (for example `~/.grok/skills/ub-mode/SKILL.md`, `~/.claude/skills/ub-mode/SKILL.md`, or `~/.cursor/skills/ub-mode/SKILL.md`), then invoke `/ub-mode`.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

SKILL.md · Manifest · 152 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ---
  2. name: ub-mode
  3. description: >
  4. Follow the reduced principles when writing or changing code. Every change
  5. follows First Make it Work, then Then Make it Right, then Follow Practice.
  6. Use when the user runs /ub-mode or asks for the reduced principles.
  7. ---
  8. # ub-mode
  9. Every time you are asked to make a change follow:
  10. * First Make it Work.
  11. * Then Make it Right.
  12. * Follow Practice
  13. # First Make it Work
  14. ## Laziness Protocol
  15. * One decision lives in one place.
  16. * Ship the smallest edit that solves the problem.
  17. ## Foundational Thinking
  18. * Get the data shape right before you write the logic.
  19. * Do first whatever helps every later phase.
  20. * If a concurrent writer would matter, do not share state.
  21. ## TDD
  22. * Write the failing test before you change the code.
  23. * See it fail for the reason you expect.
  24. * Make the smallest change that makes it pass.
  25. * If an honest test is impractical, do not write a bad one.
  26. ## Redesign From First Principles
  27. * Do not bolt a new requirement onto the old design.
  28. * Ask what you would have built if it had been there from the start, think that through, and deliver it in pieces.
  29. ## Attack the Premise
  30. * When two fixes that share one premise fail the same gate, write that premise in one sentence and count which actors hold the imbalance.
  31. * Remove the assignment.
  32. * Do not start another fix until you have done that.
  33. ## Subtract Before You Add
  34. * Take complexity out before you add anything.
  35. ## Outcome-Oriented Execution
  36. * Aim at the end state you can check.
  37. * A break in the middle is allowed when you planned it and can undo it.
  38. ## Build the Lever
  39. * If the work is not obvious at a glance, build the tool that does it.
  40. * Do one unit by hand, then make the tool match that unit.
  41. ## Architecture
  42. ### Model the Domain
  43. * Put the domain in a structure that makes the illegal states impossible.
  44. * Maintain a glossary of domain terms.
  45. * If the code is already clear and local, leave it.
  46. ### Boundary Discipline
  47. * Check the data where it enters.
  48. * Inside, trust it.
  49. * Keep the business logic in a pure function.
  50. ### Type System Discipline
  51. * Make the illegal value impossible to write.
  52. * Parse outside data once, where it comes in.
  53. * Do not silence the compiler.
  54. ### Make Operations Idempotent
  55. * Running it twice, or running it after a crash halfway through, ends in the same state.
  56. ### Separate Before Serializing Shared State
  57. * If they do not need the same mutable thing, give each its own.
  58. * If they do, allow one writer, and enforce that in the structure.
  59. # Then Make it Right
  60. ## Fix Root Causes
  61. * Reproduce it.
  62. * Fix the cause.
  63. * A guard that only hides the crash is not a fix.
  64. ## Sequence work into verifiable units
  65. * Finish one small unit and check it.
  66. * Then start the next.
  67. ## Test Behavior, Not Implementation
  68. * The test calls the code the way its user does and checks the result that user would see.
  69. * If the test would still pass when every function returned nothing, throw it out.
  70. ## Crapper
  71. * Use the crapper tool
  72. * Reduce each function under CRAP 10 by splitting it, by testing it, or both.
  73. * Consider whether case statements are worth reducing.
  74. ## Dryer
  75. * Use the dryer tool to eliminate duplication that rank 0.8 or above.
  76. ## Mutator
  77. * Use the mutator tool
  78. * Cover the uncovered.
  79. * Kill the survivors.
  80. * Delete dead code.
  81. ## Refactoring
  82. * Pin what the code does.
  83. * Change the structure.
  84. * Prove the behavior did not change.
  85. # Practice
  86. ## Keep a Log
  87. * Keep a log of every action you take and the reason you took it.
  88. * Report that log upon completion.
  89. ## Guard the Context Window
  90. * Keep the main thread small.
  91. * Send the bulk elsewhere, and keep the summary.
  92. ## Worktree Cleanup
  93. * Find what is safe to remove, confirm nothing still in use needs it, then reclaim the disk.
  94. * Uncommitted work waits for a decision.
  95. ## Commit and Push
  96. * Commit often, in small ordered commits.
  97. * Each commit says why, what changed, and how you proved it.
  98. * Push to the main line at the end.
README.md · README · 20 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # ub-mode
  2. `ub-mode` is an agent skill that enforces disciplined software engineering principles when writing or changing code. It is loosely based on portions of [@poteto](https://github.com/poteto)'s rules (`poteto-mode` / `pstack`), reduced and paired with deterministic quality-gate tools:
  3. 1. **First Make it Work** — Laziness Protocol, Foundational Thinking, TDD, Redesign From First Principles, Attack the Premise, Subtract Before You Add, Outcome-Oriented Execution, Build the Lever, and Architecture (Model the Domain, Boundary Discipline, Type System Discipline, Make Operations Idempotent, Separate Before Serializing Shared State).
  4. 2. **Then Make it Right** — Fix Root Causes, Sequence Work into Verifiable Units, Test Behavior (Not Implementation), [Crapper](https://github.com/unclebob/crapper) (`CRAP < 10`), [Dryer](https://github.com/unclebob/dryer) (duplication `< 0.8`), [Mutator](https://github.com/unclebob/mutator) (cover the uncovered, kill the survivors, delete dead code), and Refactoring.
  5. 3. **Practice** — Keep a Log, Guard the Context Window, Worktree Cleanup, and Commit and Push in small ordered commits.
  6. ## Companion Tool Repositories
  7. `ub-mode` relies on deterministic quality-gate tools to enforce structure, complexity, duplication, and test thoroughness:
  8. - [unclebob/crapper](https://github.com/unclebob/crapper) — Computes cyclomatic complexity, test coverage, and CRAP score per function so every function stays under the CRAP threshold (`< 10`).
  9. - [unclebob/dryer](https://github.com/unclebob/dryer) — Detects structural code duplication so duplicate blocks (`>= 0.8` similarity) are eliminated.
  10. - [unclebob/mutator](https://github.com/unclebob/mutator) — Runs mutation testing to expose uncovered code and surviving mutants that tests fail to catch.
  11. - [unclebob/uml-viewer](https://github.com/unclebob/uml-viewer) — Visualizes components, coverage, CRAP, mutation scores, and dependency directions.
  12. ## Installation
  13. Copy `SKILL.md` into your agent's skills directory as `ub-mode/SKILL.md` (for example `~/.grok/skills/ub-mode/SKILL.md`, `~/.claude/skills/ub-mode/SKILL.md`, or `~/.cursor/skills/ub-mode/SKILL.md`), then invoke `/ub-mode`.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.