站内导读
定位:ub-mode 是一个 Agent 技能,用于在写代码或改代码时约束工程习惯,基于 poteto 的部分规则精简,并搭配确定性质量门禁工具。
核心能力
- 分三阶段推进:先让代码能跑(TDD、从第一性原理重设计、攻击前提),再让代码正确(修根因、行为测试、重构),最后落实实践(日志、上下文窗口管理、小步提交)。
- 通过 CRAP 分数门禁把每个函数的圈复杂度与测试覆盖绑定,要求 CRAP < 10。
- 用 Dryer 检测结构重复,相似度 >= 0.8 的重复块需消除;Mutator 做变异测试,暴露未覆盖代码和存活变异体。
- 安装只需把 SKILL.md 复制到 Agent 的 skills 目录(如 ~/.claude/skills/ub-mode/),再调用 /ub-mode 即可。
适用人群:适合已在 Grok、Claude、Cursor 等 Agent 环境里写代码的开发者,需要能安装技能目录并运行 crapper、dryer、mutator 等配套工具。
注意:README 未写明具体工具版本与运行环境要求。
位置づけ:ub-mode は、コードを書く・変更する際に規律あるソフトウェア工学の原則を適用する Agent スキルです。poteto 氏のルールの一部を簡略化し、決定論的な品質ゲートツールと組み合わせています。
主な機能
- 3段階で進行:まず動くコード(TDD、第一原理からの再設計、前提への攻撃)、次に正しいコード(根本原因の修正、振る舞いテスト、リファクタリング)、最後に実践(ログ、コンテキストウィンドウ管理、小さなコミット)。
- CRAP スコアのゲートで、各関数の循環的複雑度とテストカバレッジを結び付け、CRAP < 10 を要求。
- Dryer で構造的な重複を検出し、類似度 0.8 以上の重複ブロックを排除。Mutator はミューテーションテストで未カバーコードと生存ミュータントを明示。
- インストールは SKILL.md を Agent の skills ディレクトリ(例:~/.claude/skills/ub-mode/)にコピーし、/ub-mode を呼び出すだけ。
対象読者:Grok、Claude、Cursor などの Agent 環境でコードを書く開発者。スキルディレクトリへの配置と、crapper・dryer・mutator などのツール実行が前提です。
注意:README にはツールのバージョンや実行環境の要件は明記されていません。
정의: ub-mode는 코드를 작성하거나 수정할 때 규율 있는 소프트웨어 엔지니어링 원칙을 적용하는 Agent 스킬입니다. poteto의 규칙 일부를 축약해 결정론적 품질 게이트 도구와 결합했습니다.
핵심 기능
- 3단계로 진행: 먼저 동작하는 코드(TDD, 제1원리 재설계, 전제 공격), 다음으로 올바른 코드(근본 원인 수정, 행위 테스트, 리팩터링), 마지막으로 실천(로그, 컨텍스트 윈도우 관리, 작은 커밋).
- CRAP 점수 게이트로 각 함수의 순환 복잡도와 테스트 커버리지를 묶어 CRAP < 10을 요구합니다.
- Dryer로 구조적 중복을 탐지해 유사도 0.8 이상 중복 블록을 제거하고, Mutator는 변이 테스트로 미커버 코드와 생존 변이체를 드러냅니다.
- 설치는 SKILL.md를 Agent의 skills 디렉터리(예: ~/.claude/skills/ub-mode/)에 복사한 뒤 /ub-mode를 호출하면 됩니다.
대상 독자: Grok, Claude, Cursor 등 Agent 환경에서 코드를 작성하는 개발자. 스킬 디렉터리 설치와 crapper·dryer·mutator 실행이 전제입니다.
주의: README에는 도구 버전이나 실행 환경 요구 사항이 명시되어 있지 않습니다.
What it is: ub-mode is an agent skill that applies disciplined software engineering principles when writing or changing code. It is a reduced version of parts of poteto's rules, paired with deterministic quality-gate tools.
Key capabilities
- Works in three stages: first make it work (TDD, redesign from first principles, attack the premise), then make it right (fix root causes, behavior tests, refactoring), then practice (log, context window, small commits).
- A CRAP score gate ties each function's cyclomatic complexity to test coverage and requires CRAP < 10.
- Dryer detects structural duplication and eliminates blocks with similarity >= 0.8; Mutator runs mutation testing to expose uncovered code and surviving mutants.
- Install by copying SKILL.md into your agent's skills directory (e.g. ~/.claude/skills/ub-mode/) and invoking /ub-mode.
Who it is for: Developers already writing code in agent environments such as Grok, Claude, or Cursor, who can install a skills directory and run companion tools like crapper, dryer, and mutator.
Caveats: The README does not state tool versions or runtime requirements.
README · 详细文档
来源 · 查看原文
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:
- 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).
- 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. - 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:
- unclebob/crapper — Computes cyclomatic complexity, test coverage, and CRAP score per function so every function stays under the CRAP threshold (
< 10). - unclebob/dryer — Detects structural code duplication so duplicate blocks (
>= 0.8similarity) are eliminated. - unclebob/mutator — Runs mutation testing to expose uncovered code and surviving mutants that tests fail to catch.
- unclebob/uml-viewer — Visualizes components, coverage, CRAP, mutation scores, and dependency directions.
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.