tdd
하는 일
이 스킬은 에이전트가 먼저 테스트를 쓰고, 그 테스트를 통과시키는 가장 작은 코드를 쓰며 코드를 만들도록 안내합니다. 각 변경이 코드보다 먼저 쓰인 테스트로 증명되기를 원하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓새 동작을 한 번에 작은 단계로 테스트 우선 방식으로 만들고 싶을 때.
- ✓버그를 재현하는 테스트를 먼저 써서 버그를 고치고 싶을 때.
- ✓코드 자체가 아니라 명세나 예제 같은 기준으로 테스트를 쓰고 싶을 때.
스킬 링크
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/tdd/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“가격 명세의 예제를 사용해서 할인 규칙을 테스트 우선 방식으로 한 단계씩 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 합의된 지점에서 다음 테스트를 쓰고, 예상한 이유로 실패하는지 확인한 다음, 그것을 통과시키는 가장 작은 변경을 씁니다. 이 루프를 반복하며, 리팩터링은 나중의 검토 단계로 미룹니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
TDD
Red-green in small steps, at seams that were agreed in advance. In a launch run the seam list is C2's approved output; outside launch, agree the seams with the user before the first test exists — a seam nobody approved gets no tests.
The loop
One test → one implementation → repeat:
- Write the next test at a seam. Run it. Watch it fail for the reason you expect — a test that cannot fail is not a test.
- Implement the smallest change that turns it green.
- Repeat. Each test is a tracer bullet: a narrow but complete path through the behavior, not a layer finished in isolation.
Rules
- Expected values come from an independent source of truth — a spec line, a worked example, a documented output. Never from the implementation under test: a test that asserts what the code happens to do is a mirror, not a check.
- Substitute at the seam's declared boundary class only — in-process, locally substitutable, owned-remote port, or true-external, the class C2 records for each seam. No substitutes inside the boundary the test is exercising.
- Refactoring is not part of the loop. It belongs to the review stage; the repair worker owns it. Do not refactor mid-red-green.
- A bug fix starts with the failing test that reproduces it — reproduction before theory, the debugger's rule.
- When proposing a seam, say in one line what it catches and what it lets through — a seam choice nobody can price is a guess, not a decision.
When no seam fits
If the behavior cannot be tested at any approved seam, stop and say so: report the missing seam as a finding (it feeds architecture-survey and refit) rather than inventing a seam or testing through internals.
Output
- The seam list used, with boundary classes and each seam's catch/miss line
- Red/green evidence — the failing run and the passing run
- Any seam-absence findings
자주 묻는 질문
테스트가 코드의 동작을 그대로 베끼나요?
아니요. 기대값은 명세나 작업 예제처럼 테스트 대상 코드와 독립적인 출처에서 옵니다.
테스트는 어디에 두나요?
미리 합의된 지점에서만 씁니다. 아무도 승인하지 않은 지점에는 테스트를 쓰지 않습니다.
리팩터링은 언제 하나요?
빨강-초록 루프 안에서는 하지 않습니다. 나중의 검토 단계에 속합니다.
상세 정보
작성자의 원본 설명
Test-first at pre-agreed seams — one test, one implementation, tracer-bullet red/green; independent expected values; substitutions only at the seam's boundary class; launch Phase 4 reference.
인기도
- GitHub 스타
- 41k
- 순위
- #7027
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
agent-doc-discipline
41k에이전트가 다른 AI 에이전트가 스스로 따를 수 있는 지침을 쓰도록 가르칩니다. 확인할 수 있는 규칙과 각 규칙의 명확한 이유를 담습니다.
ai-slop-cleaner
41k에이전트가 작동하지만 군더더기가 많거나 반복되는 AI 작성 코드를 정리해, 동작을 바꾸지 않고 불필요한 코드를 제거하도록 돕습니다.
architecture-survey
41k에이전트가 코드베이스의 구조를 검토하고, 근거와 함께 변경하기 어려워지는 부분을 나열합니다. 스스로 아무것도 바꾸지 않습니다.
ask-navigator
41k에이전트가 막연한 프로젝트를 명확한 결정 질문의 지도로 바꾸고, 길이 분명해질 때까지 질문을 하나씩 해결하도록 돕습니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.