본문으로 건너뛰기
Skillpedia
테스트15k · #10999

tdd

하는 일

스킬은 집중된 회귀 테스트로 시작하는 버그 수정을 안내합니다. 버그가 고쳐졌고 다시 나타나지 않는다는 증명을 원하는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓테스트 주도 개발이나 회귀 테스트를 요청할 때.
  • ✓버그의 잘못된 동작을 보여 줄 간단하고 저렴한 테스트가 있는 경우.
  • ✓다시 돌아오지 않는다는 것을 테스트로 증명하는 수정이 필요할 때.

스킬 링크

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/tdd/SKILL.md

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

사용 방법

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

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

Use this skill to help me: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/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 Bug Fix

When fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.

Do not force a test when it would be impractical. If the available test would require broad harness setup, brittle mocks, slow end-to-end infrastructure, production-only state, vague reproduction steps, or large unrelated fixture churn, skip adding a new test and use the closest useful verification instead.

Workflow

  1. Understand the bug. Identify the intended behavior, current behavior, affected path, and smallest observable reproduction.
  2. Choose the narrowest executable check. Prefer the closest unit, component, integration, or regression test already used for that codepath. If no practical test path is obvious, do not create one from scratch just to satisfy the workflow.
  3. Write the failing test first. Add the smallest focused test that would have caught the bug. The test should encode intended behavior, not mirror the current implementation.
  4. Run the new test before fixing. Confirm it fails for the intended reason. If it passes or fails for an unrelated reason, correct the test or reproduction before editing the implementation.
  5. Fix the bug. Make the smallest production change that satisfies the intended behavior while preserving nearby contracts.
  6. Rerun the regression test. Confirm the test now passes.

If a Failing Test Is Impractical

Use the closest executable regression check instead: a targeted script, manual reproduction command, browser automation, snapshot comparison, log assertion, or focused integration check.

Prefer no new test over a bad test. A bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.

Guardrails

  • Do not change tests merely to match a wrong implementation.
  • Do not weaken existing assertions unless the expected behavior has genuinely changed and the reason is clear.
  • Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.
  • If the bug is flaky, make the test deterministic where possible and document the signal being locked down.
  • If the bug exposes a broader class of failures, first land the focused regression path, then consider additional sibling coverage.

Final Response

Report the evidence, not just the outcome:

  • Name the failing-before test or executable check and the failure it produced.
  • Name the passing-after test run and any nearby validation performed.
  • If failing-before evidence could not be demonstrated, state why and describe the closest regression check used instead.
자주 묻는 질문

테스트가 실용적이지 않으면 어떻게 하나요?

이 스킬은 테스트를 강요하지 않습니다. 대신 가장 가까운 유용한 검사를 씁니다.

테스트가 먼저 실패해야 하나요?

네. 새 테스트는 수정 전에 실행해, 올바른 이유로 실패하는지 확인합니다.

왜 수정 전에 테스트를 쓰나요?

먼저 버그가 있다는 것을 보여 주고, 나중에는 버그가 고쳐졌음을 보여 주기 때문입니다.

상세 정보

작성자의 원본 설명

Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.

repo: cursor/plugins

인기도

GitHub 스타
15k
순위
#10999
라이선스
—
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬