ub-mode README

项目的 README,来自 github.com/unclebob/ub-mode。合并为一个 markdown 文件:README.md。

ub-mode

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's rules (poteto-mode / pstack), reduced and paired with deterministic quality-gate tools:

  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).
  2. Then Make it Right — Fix Root Causes, Sequence Work into Verifiable Units, Test Behavior (Not Implementation), Crapper (CRAP < 10), Dryer (duplication < 0.8), Mutator (cover the uncovered, kill the survivors, delete dead code), and Refactoring.
  3. Practice — Keep a Log, Guard the Context Window, Worktree Cleanup, and Commit and Push in small ordered commits.

Companion Tool Repositories

ub-mode relies on deterministic quality-gate tools to enforce structure, complexity, duplication, and test thoroughness:

Installation

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.

ub-mode (unclebob/ub-mode)

正在搜索数据库…

8.1K ·GitHub
这是什么?ub-mode 是一个智能体 skill,当 AI 编程智能体编写或修改代码时,它会强制执行严谨的软件工程原则(如 TDD、从第一性原理重新设计、架构纪律)。
这是独立应用,还是放进编程智能体里使用的文件?它是一个单独的 SKILL.md 文件,放进智能体的 skills 文件夹即可,并不是可以单独运行的程序。它大致基于 @poteto 的规则(poteto-mode / pstack)中的部分内容,并做了精简,同时搭配了确定性的质量门禁工具。
哪些编程智能体可以使用它?安装路径显示它支持 Grok、Claude(Claude Code)和 Cursor,因为该 skill 会放入这三者各自的 skills 目录中。
要获得完整的质量门禁体验,我还需要其他工具吗?要让“让它正确”阶段真正测量变异覆盖率和 CRAP 分数,你需要配套仓库:unclebob/mutator 用于变异测试,unclebob/uml-viewer 用于可视化覆盖率、CRAP 和变异分数。仅靠 ub-mode 只能通过智能体来执行这些规则。
“先让它能用”阶段包含哪些内容?它包括偷懒协议、基础思维、TDD、从第一性原理重新设计、质疑前提、先做减法再做加法、以结果为导向的执行、构建杠杆,以及领域建模、边界纪律、类型系统纪律、幂等操作、在序列化前分离共享状态等架构实践。
“然后让它正确”阶段包含哪些内容?它聚焦于修复根本原因、将工作拆分为可验证的单元、测试行为而非实现,并持续降低 CRAP 指标(相似度阈值为 0.8),直到有问题的代码被消除。
ub-mode 为什么基于 poteto-mode?作者精简并改编了 @poteto 现有规则集(poteto-mode / pstack)的部分内容,形成了一个更轻量的版本,并搭配了确定性的质量门禁工具,而不是只依赖智能体自身的判断。
这个 skill 试图消除的 CRAP 分数是什么?CRAP(Change Risk Anti-Patterns,变更风险反模式)衡量的是代码复杂度与测试覆盖不足的组合;ub-mode 的质量门禁搭配以相似度阈值 0.8 为目标,用来标识那些此分数表明风险高、测试不足的代码。
作者
unclebob
大小
<0.1 MB
星标
8.1K
更新
提交Nov 02
时长
24天
提交 · 90 天