ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

tdd-discipline

Test-Driven Development methodology. Use when implementing features or fixing bugs. Write the test first, watch it fail, write minimal code to pass, then refactor. Prevents untested code from shipping.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/kjaylee/tdd-discipline
Or

TDD Discipline

핵심 사이클

RED → GREEN → REFACTOR → 반복

RED: 실패하는 테스트 작성

  • 하나의 동작만 테스트
  • 명확한 이름 ("rejects empty email" ✅, "test1" ❌)
  • 실제 코드 사용 (mock 최소화)

검증: 실패 확인 (필수! 건너뛰기 금지)

npm test path/to/test.test.ts
  • 테스트가 실패하는가? (에러가 아닌 실패)
  • 실패 메시지가 예상대로인가?
  • 기능 미구현 때문에 실패하는가? (오타 아닌지 확인)

GREEN: 최소한의 코드

  • 테스트를 통과하는 가장 간단한 코드
  • 기능 추가 금지, 리팩토링 금지
  • YAGNI (You Ain't Gonna Need It)

REFACTOR: 정리

  • 중복 제거, 이름 개선, 헬퍼 추출
  • 테스트는 계속 GREEN 유지
  • 동작 추가 금지

위반 시 규칙

테스트 전에 코드 작성했으면? → 삭제. 처음부터.
  • "참고용으로 남기자" ❌
  • "테스트 쓰면서 적용하자" ❌
  • "보지도 말자" ✅

적용 시점

항상:

  • 새 기능 구현
  • 버그 수정 (버그 재현 테스트 먼저!)
  • 동작 변경

예외 (주인님 판단):

  • 일회성 프로토타입
  • 설정 파일
  • 생성된 코드

흔한 합리화

핑계현실
"너무 간단해서 테스트 불필요"간단한 코드도 깨짐. 테스트 30초
"나중에 테스트 쓸게"나중 = 즉시 통과 = 아무것도 증명 못함
"TDD가 느려"TDD가 디버깅보다 빠름
"수동으로 테스트했어"수동 = 기록 없음, 재실행 불가
"X시간 작업 삭제가 아까워"매몰비용. 검증 안 된 코드가 진짜 낭비

버그 수정 시 TDD

  1. 버그 재현하는 테스트 작성
  2. RED 확인 (테스트가 버그를 잡는지)
  3. 수정 코드 작성
  4. GREEN 확인
  5. 회귀 테스트로 영구 보존

Metadata

Author@kjaylee
Stars1776
Views0
Updated2026-03-02
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-kjaylee-tdd-discipline": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.

Related Skills

ui-ux-pro-max

UI/UX design intelligence and implementation guidance for building polished interfaces. Use when the user asks for UI design, UX flows, information architecture, visual style direction, design systems/tokens, component specs, copy/microcopy, accessibility, or to generate/critique/refine frontend UI (HTML/CSS/JS, React, Next.js, Vue, Svelte, Tailwind). Includes workflows for (1) generating new UI layouts and styling, (2) improving existing UI/UX, (3) producing design-system tokens and component guidelines, and (4) turning UX recommendations into concrete code changes.

kjaylee 1776

ralph-loop

AI 자율 구현 방법론. 구현/개발/코딩 요청 시 자동 적용. 메인은 마더 서브에이전트를 spawn하고, 마더가 워커들을 관리. specs/ → IMPLEMENTATION_PLAN.md → 1태스크씩 구현 → 2단계 리뷰 → 테스트 → 반복.

kjaylee 1776

game-dev-rust-godot

Game development workflow using Rust+WASM or Godot 4.x for HTML5 games. Use when creating new games, implementing game mechanics, or porting existing games. Follows TDD-based production pipeline v3.1 with asset-first approach. Covers Rust(Macroquad/Bevy), Godot HTML5 Export, asset acquisition, test case writing, and QA automation. Master directive (2026-02-06) - ONLY Rust+WASM or Godot allowed, JS/TS frameworks prohibited.

kjaylee 1776

subagent-dev

Execute implementation plans using fresh subagents per task with two-stage review (spec compliance + code quality). Use when executing multi-task plans with independent work units. Enhances ralph-loop methodology.

kjaylee 1776

systematic-debugging

Root-cause-first debugging methodology. Use when encountering any bug, test failure, or unexpected behavior BEFORE proposing fixes. Prevents random fix attempts that waste time and create new bugs.

kjaylee 1776