Skip to content
Agent Orchestration
Skill

/tdd

테스트 주도 개발 - 테스트 먼저 작성 후 구현. 트리거: "TDD", "테스트 먼저", "테스트 주도", "RED-GREEN-REFACTOR". 안티-트리거: "구현 먼저", "테스트 나중에".

BOOST
From plugin
my-cc-harness
12543 skills12 agents4 commands10 hooks
Install
$ npx -y skills add jh941213/my-cc-harness --skill tdd --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/tdd

Context preview

The summary Claude sees to decide when to auto-load this skill.

테스트 주도 개발 - 테스트 먼저 작성 후 구현. 트리거: "TDD", "테스트 먼저", "테스트 주도", "RED-GREEN-REFACTOR". 안티-트리거: "구현 먼저", "테스트 나중에".

SKILL.md

tdd.SKILL.md
name: tdd
description: 테스트 주도 개발 - 테스트 먼저 작성 후 구현. 트리거: "TDD", "테스트 먼저", "테스트 주도", "RED-GREEN-REFACTOR". 안티-트리거: "구현 먼저", "테스트 나중에".
disable-model-invocation: false
allowed-tools: Read, Write, Edit, Bash, Grep
user-invocable: true

TDD (테스트 주도 개발)

테스트를 먼저 작성하고, 코드를 구현하는 TDD 방식을 적용합니다.

TDD 사이클

RED → GREEN → REFACTOR → REPEAT

RED:      실패하는 테스트 작성
GREEN:    테스트 통과하는 최소 코드 작성
REFACTOR: 코드 개선 (테스트 유지)
REPEAT:   다음 기능/시나리오

Step 1: 인터페이스 정의 (SCAFFOLD)

// 타입 먼저 정의
interface CreateUserInput {
  name: string;
  email: string;
}

// 빈 구현체
export function createUser(input: CreateUserInput): User {
  throw new Error('Not implemented');
}

Step 2: 테스트 작성 (RED)

테스트 순서: **정상 → 엣지 → 에러**

describe('createUser', () => {
  // 정상 케이스 먼저
  it('유효한 입력으로 사용자를 생성해야 한다', () => {
    const input = { name: '홍길동', email: 'hong@test.com' };
    const result = createUser(input);
    expect(result).toMatchObject({ name: '홍길동', email: 'hong@test.com' });
    expect(result.id).toBeDefined();
  });

  // 엣지 케이스
  it('이름 앞뒤 공백을 제거해야 한다', () => {
    const result = createUser({ name: '  홍길동  ', email: 'hong@test.com' });
    expect(result.name).toBe('홍길동');
  });

  // 에러 케이스
  it('이메일이 없으면 ValidationError를 던져야 한다', () => {
    expect(() => createUser({ name: '홍길동', email: '' })).toThrow(ValidationError);
  });
});

Step 3: 실패 확인 (중요!)

# 반드시 실패하는지 확인 — 바로 통과하면 테스트가 잘못된 것
npm test -- path/to/file.test.ts
# 또는
pytest path/to/test_file.py -v

**실패 안 하면 STOP** — 테스트를 다시 검토.

Step 4: 최소 구현 (GREEN)

  • 테스트만 통과하는 최소한의 코드
  • 하드코딩도 OK (리팩토링에서 개선)
  • 우아함보다 정확성

Step 5: 리팩토링 (REFACTOR)

  • 중복 제거, 네이밍 개선
  • 테스트 재실행하여 깨지지 않는지 확인
  • **새 기능 추가 금지** — 리팩토링만

Step 6: 반복 (REPEAT)

다음 테스트 케이스 추가 → RED부터 다시.

프레임워크별 명령어

| 프레임워크 | 실행 | 워치 | 커버리지 | |-----------|------|------|---------| | Vitest | `npx vitest run` | `npx vitest` | `npx vitest --coverage` | | Jest | `npx jest` | `npx jest --watch` | `npx jest --coverage` | | pytest | `pytest -v` | `ptw` | `pytest --cov=src` |

테스트 파일 위치

| 패턴 | 위치 | |------|------| | 코로케이션 | `src/user.ts` → `src/user.test.ts` | | __tests__ | `src/user.ts` → `src/__tests__/user.test.ts` | | Python | `src/user.py` → `tests/test_user.py` |

기존 프로젝트 패턴을 따름.

주의사항

  • 한 번에 하나의 테스트만 추가
  • 테스트가 실패하는지 반드시 확인
  • 구현이 아닌 행위를 테스트
  • 커버리지 목표: 새 코드 80%+
Read more
Ships withmy-cc-harness

my-claude-code-asset

Get the whole plugin

Other skills on my-cc-harness.

auto-memory
Skill

auto-memory

레포에서 실질적인 작업(구현·수정·배포·디버깅)을 시작할 때, 새 레포를 처음 파악할 때, 작업을 마치고 기억할 지식이 생겼을 때 사용. 작업 유형에 맞는 docs·메모리만 선택적으로 로드하는 라우팅 테이블을 운영한다

autodev-parallel
Skill

autodev-parallel

Ralph Loop 병렬 버전. 여러 에이전트가 worktree에서 동시에 PRD 항목을 처리한다. 트리거: "PRD 항목 병렬 구현", "병렬 구현", "autodev parallel", "워크트리 병렬 개발", "병렬 랄프"…

autodev
Skill

autodev

Ralph Loop 기반 자율 개발 루프. Stop Hook이 세션 종료를 가로채어 PRD 항목을 하나씩 완료하며 자동 커밋한다. 트리거: "autodev", "자율 개발", "밤새 돌려", "랄프 루프", "ralph loop",…

brainstorming
Skill

brainstorming

기능 추가·컴포넌트 생성·동작 변경 등 모든 창작 작업 전에 사용. 구현 전에 의도·요구사항·설계를 대화로 확정 (심층 인터뷰가 필요한 대규모 기능은 /spec 사용)