ub-mode
できること
このスキルは、コードのあらゆる変更に対する単純な作業の順序を示します。まず動くようにし、次に正しくし、その後で一般的な慣習に従います。慎重で最小限の変更を望む開発者向けです。
使う場面
- ✓開発者がAIにコードの変更や追加を依頼し、小さくテストできる手順を求めているとき。
- ✓開発者が、コードを変える前に失敗するテストを書かせたいとき。
- ✓開発者が、新しい機能を追加する前に複雑さを減らしたいとき。
スキルのリンク
https://github.com/unclebob/ub-mode/blob/master/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“この変更を、小さく、まずテストしてから行い、余計な複雑さは加えないでください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
このスキルは3つの段階を定めています。まず、テストと最小限の編集を使って変更を動くようにします。次に設計を整理し、最後にプロジェクトの通常の慣習に従います。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
ub-mode
Every time you are asked to make a change follow:
- First Make it Work.
- Then Make it Right.
- Follow Practice
First Make it Work
Laziness Protocol
- One decision lives in one place.
- Ship the smallest edit that solves the problem.
Foundational Thinking
- Get the data shape right before you write the logic.
- Do first whatever helps every later phase.
- If a concurrent writer would matter, do not share state.
TDD
- Write the failing test before you change the code.
- See it fail for the reason you expect.
- Make the smallest change that makes it pass.
- If an honest test is impractical, do not write a bad one.
Redesign From First Principles
- Do not bolt a new requirement onto the old design.
- Ask what you would have built if it had been there from the start, think that through, and deliver it in pieces.
Attack the Premise
- When two fixes that share one premise fail the same gate, write that premise in one sentence and count which actors hold the imbalance.
- Remove the assignment.
- Do not start another fix until you have done that.
Subtract Before You Add
- Take complexity out before you add anything.
Outcome-Oriented Execution
- Aim at the end state you can check.
- A break in the middle is allowed when you planned it and can undo it.
Build the Lever
- If the work is not obvious at a glance, build the tool that does it.
- Do one unit by hand, then make the tool match that unit.
Architecture
Model the Domain
- Put the domain in a structure that makes the illegal states impossible.
- Maintain a glossary of domain terms.
- If the code is already clear and local, leave it.
Boundary Discipline
- Check the data where it enters.
- Inside, trust it.
- Keep the business logic in a pure function.
Type System Discipline
- Make the illegal value impossible to write.
- Parse outside data once, where it comes in.
- Do not silence the compiler.
Make Operations Idempotent
- Running it twice, or running it after a crash halfway through, ends in the same state.
Separate Before Serializing Shared State
- If they do not need the same mutable thing, give each its own.
- If they do, allow one writer, and enforce that in the structure.
Then Make it Right
Fix Root Causes
- Reproduce it.
- Fix the cause.
- A guard that only hides the crash is not a fix.
Sequence work into verifiable units
- Finish one small unit and check it.
- Then start the next.
Test Behavior, Not Implementation
- The test calls the code the way its user does and checks the result that user would see.
- If the test would still pass when every function returned nothing, throw it out.
Crapper
- Use the crapper tool
- Reduce each function under CRAP 10 by splitting it, by testing it, or both.
- Consider whether case statements are worth reducing.
Dryer
- Use the dryer tool to eliminate duplication that rank 0.8 or above.
Mutator
- Use the mutator tool
- Cover the uncovered.
- Kill the survivors.
- Delete dead code.
Refactoring
- Pin what the code does.
- Change the structure.
- Prove the behavior did not change.
Practice
Keep a Log
- Keep a log of every action you take and the reason you took it.
- Report that log upon completion.
Guard the Context Window
- Keep the main thread small.
- Send the bulk elsewhere, and keep the summary.
Worktree Cleanup
- Find what is safe to remove, confirm nothing still in use needs it, then reclaim the disk.
- Uncommitted work waits for a decision.
Commit and Push
- Commit often, in small ordered commits.
- Each commit says why, what changed, and how you proved it.
- Push to the main line at the end.
よくある質問
ここでの「まずテスト」とは何を意味しますか?
スキルは、期待された理由で失敗するテストをAIに書かせ、そのテストを通す最小限の変更を加えるよう求めています。
書き直しを求めていますか?
いいえ。最小限の動く編集を求め、さらに追加する前に複雑さを取り除くよう求めています。
誰が対象ですか?
コードに着実で、十分にテストされた変更を望む開発者です。
詳細
作者による元の説明
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.
repo: unclebob/ub-mode
人気
- GitHubのスター
- 6.5k
- ランキング
- #14186
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。