본문으로 건너뛰기
Skillpedia
테스트41k · #7027

tdd

하는 일

이 스킬은 에이전트가 먼저 테스트를 쓰고, 그 테스트를 통과시키는 가장 작은 코드를 쓰며 코드를 만들도록 안내합니다. 각 변경이 코드보다 먼저 쓰인 테스트로 증명되기를 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓새 동작을 한 번에 작은 단계로 테스트 우선 방식으로 만들고 싶을 때.
  • ✓버그를 재현하는 테스트를 먼저 써서 버그를 고치고 싶을 때.
  • ✓코드 자체가 아니라 명세나 예제 같은 기준으로 테스트를 쓰고 싶을 때.

스킬 링크

https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/tdd/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/tdd/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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:

  1. 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.
  2. Implement the smallest change that turns it green.
  3. 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.

repo: Yeachan-Heo/oh-my-claudecode

인기도

GitHub 스타
41k
순위
#7027
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬