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분.
작동 방식
스킬은 세 단계를 제시합니다. 먼저 테스트와 가장 작은 수정으로 변경이 동작하게 하고, 다음으로 설계를 정리하고, 마지막으로 프로젝트의 일반적인 관행을 따릅니다.
기술 내용 (원본 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.
자주 묻는 질문
여기서 먼저 테스트한다는 것은 무슨 뜻인가요?
스킬은 예상한 이유로 실패하는 테스트를 작성한 뒤, 그 테스트를 통과시키는 가장 작은 변경을 하라고 요청합니다.
전체를 다시 작성하라고 하나요?
아니요. 가장 작은 동작 수정을 하고, 더 추가하기 전에 복잡성을 먼저 줄이라고 요청합니다.
누구를 위한 스킬인가요?
테스트를 거친 안정적인 변경을 원하는 개발자를 위한 스킬입니다.
상세 정보
작성자의 원본 설명
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.
댓글
- …