Skip to content
tdd-guardian logo

Tdd Guardian

tdd-guardian

**TDD GUARDIAN**: '테스트 작성', '테스트 만들어', 'TDD', '단위 테스트', '통합 테스트', '커버리지', 'mock', '모킹' 요청 시 자동 발동. *.test.ts/*.spec.ts/test_*.py 파일 작업 시 자동 적용. Fake Test 탐지, 80% 커버리지 게이트. Jest/Vitest/PyTest/JUnit 템플릿.

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

TDD Guardian v2.0 - Test-Driven Development Enforcer

Proactive TDD Enforcer - 테스트 작업 시 자동으로 TDD 원칙 적용

자동 발동 조건

이 스킬은 다음 상황에서 자동으로 활성화됩니다:

Auto_Trigger_Conditions:
  File_Patterns:
    - "*.test.ts, *.test.tsx, *.test.js"
    - "*.spec.ts, *.spec.tsx, *.spec.js"
    - "__tests__/​**, test/​**, tests/​**"
    - "*_test.py, test_*.py"           # Python
    - "*_test.go"                       # Go
    - "*Test.java, *Spec.java"          # Java

  Keywords_KO:
    - "테스트 작성, 테스트 만들어, 테스트 추가"
    - "단위 테스트, 통합 테스트, E2E 테스트"
    - "TDD, 테스트 주도, 테스트 먼저"
    - "커버리지, 테스트 커버리지"
    - "테스트 코드, 테스트 케이스"
    - "mock, 모킹, 스텁"

  Keywords_EN:
    - "write test, create test, add test"
    - "unit test, integration test, e2e test"
    - "TDD, test driven, test first"
    - "coverage, test coverage"

  Code_Patterns:
    - "describe(, it(, test(, expect("
    - "jest., vitest., pytest"
    - "beforeEach, afterEach, beforeAll"

선택적 문서 로드 전략

전체 문서를 로드하지 않습니다! 상황에 따라 필요한 문서만 로드:

Document_Loading_Strategy:
  Step_1_Detect_Framework:
    - 파일 확장자, import 문, 설정 파일로 테스트 프레임워크 감지
    - 불명확하면 package.json의 devDependencies 확인

  Step_2_Load_Required_Docs:
    Universal_Always_Load:
      - "core/​tdd-workflow.md"       # TDD 3단계 사이클 (항상)
      - "core/​real-assertions.md"    # Real Assertion 규칙 (항상)

    Framework_Specific_Load:
      Jest: "frameworks/​jest.md"           # Jest 설정, 매처, 모킹
      Vitest: "frameworks/​vitest.md"       # Vitest 설정, 매처
      Mocha: "frameworks/​mocha.md"         # Mocha + Chai
      PyTest: "frameworks/​pytest.md"       # Python PyTest
      GoTest: "frameworks/​gotest.md"       # Go testing package
      RSpec: "frameworks/​rspec.md"         # Ruby RSpec
      JUnit: "frameworks/​junit.md"         # Java JUnit5
      XCTest: "frameworks/​xctest.md"       # Swift XCTest

    Context_Specific_Load:
      Unit_Test: "templates/​unit-test.md"
      Integration_Test: "templates/​integration-test.md"
      React_Test: "templates/​react-test.md"
      Fake_Detection: "patterns/​fake-test-detector.md"
      Coverage_Check: "core/​coverage-thresholds.md"

  Quick_Reference:
    Checklist: "quick-reference/​checklist.md"
    Anti_Patterns: "quick-reference/​anti-patterns.md"

2025 테스트 프레임워크 선택 가이드

Framework_Comparison:
  Vitest:
    권장_상황: "새 프로젝트, Vite 기반"
    장점:
      - "Jest보다 30-70% 빠름"
      - "ESM 네이티브 지원"
      - "설정 없이 바로 사용 (zero-config)"
      - "Jest 호환 API (jest.* → vi.*)"
      - "브라우저 UI 디버깅"
    메모리: "Jest 1.2GB vs Vitest 800MB (50K 라인 기준)"
    마이그레이션: "85-90% Jest 테스트 수정 없이 작동"

  Jest:
    권장_상황: "기존 프로젝트, React Native"
    장점:
      - "안정적, 10년+ 커뮤니티"
      - "레퍼런스/튜토리얼 풍부"
      - "스냅샷 테스팅 원조"
    주의: "ESM 설정 복잡, 싱글 스레드 기본"

  선택_기준:
    새_프로젝트: "Vitest 권장"
    기존_Jest_프로젝트: "유지 (마이그레이션 비용 고려)"
    React_Native: "Jest 필수"
    Vite_프로젝트: "Vitest 필수"

Quick Reference

5 Core Principles

1. Test First: "코드 작성 전 반드시 실패하는 테스트부터"
2. Real Assertions: "toBeDefined/​toBeTruthy 단독 사용 금지"
3. Edge Coverage: "Happy + Error + Boundary + Async 필수"
4. No Fake Tests: "15+ 패턴의 Fake Test 탐지 및 거부"
5. Coverage Gate: "80% line, 70% branch 미달 시 진행 금지"

Instant Checklist

## 테스트 작성 전 체크
- [ ] 요구사항에서 테스트 케이스 도출했는가?
- [ ] Happy/​Error/​Boundary/​Async 케이스 포함했는가?

## 테스트 작성 후 체크
- [ ] 모든 assertion이 구체적 값을 검증하는가?
- [ ] toBeDefined/​toBeTruthy 단독 사용 없는가?
- [ ] 테스트 제목과 내용이 일치하는가?
- [ ] Mock이 과도하지 않은가?
- [ ] Edge case가 포함되었는가?

## 최종 검증
- [ ] 모든 테스트 통과?
- [ ] Line coverage >= 80%?
- [ ] Branch coverage >= 70%?

문서 구조

tdd-guardian/
├── SKILL.md                          # 이 파일 (라우터)
├── core/
│   ├── tdd-workflow.md               # Red-Green-Refactor 사이클
│   ├── real-assertions.md            # Real Assertion 규칙
│   ├── edge-coverage.md              # Edge Case 커버리지
│   └── coverage-thresholds.md        # 커버리지 임계값
├── frameworks/
│   ├── jest.md                       # Jest 설정, 매처, 모킹
│   ├── vitest.md                     # Vitest 설정, 매처
│   ├── pytest.md                     # Python PyTest
│   ├── gotest.md                     # Go testing package
│   └── junit.md                      # Java JUnit5
├── templates/
│   ├── unit-test.md                  # NestJS Service/​Controller 템플릿
│   ├── integration-test.md           # E2E 테스트 템플릿
│   └── react-test.md                 # React Component/​Hook 템플릿
├── patterns/
│   ├── fake-test-detector.md         # 15+ Fake Test 패턴
│   └── mock-guidelines.md            # Mock 사용 가이드
└── quick-reference/
    ├── checklist.md                  # 빠른 체크리스트
    └── anti-patterns.md              # 20+ Anti-Pattern

사용 방법

1. 자동 발동 (Proactive)

테스트 파일 작업 시 자동으로 원칙 적용됨

2. 명시적 호출

"이 테스트 TDD 원칙으로 리뷰해줘"
"Fake test 패턴 검사해줘"
"커버리지 80% 확인해줘"

3. 템플릿 요청

"NestJS Service 단위 테스트 템플릿"
"React Hook 테스트 템플릿"
"E2E 테스트 템플릿"

Version: 2.0.0 Quality Target: 95% Related Skills: clean-code-mastery, code-reviewer

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View