본문으로 건너뛰기
cccskills
무료GitHub에 공개

tdd

Strict test-driven development for behavior changes. Requires verified RED before production code, minimal GREEN, and refactor only after passing tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md4.8 KB
  • writing-good-tests.md1.4 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

/supergraph:tdd

Requires healthy index_status for CBM_PROJECT (see references/codebase-memory-contract.md with codebase-memory-mcp); if stale/degraded → index_repository before graph calls.

Strict TDD for features, bug fixes, refactors.

Iron Law: NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Delete means delete: Production code written before verified failing test → delete and restart from RED.

When

Full TDD: new features, behavior changes, refactoring. Fast TDD: bug fixes (add regression test → RED verify → minimal fix). Ask to skip: config-only, generated code, throwaway prototype, docs-only.

State Machine (in order, never skip)

needs_test → red_verified → green_verified → refactor_allowed → complete

Steps

0. Announce

"🔴 /supergraph:tdd — TDD: [full|fast] for [behavior]..."

1. Identify One Behavior

Behavior: [single externally visible behavior]
Test file: [path] | Test name: [name]
Command: [focused test command]
Expected RED: [why it should fail before implementation]

One behavior per test. Public behavior, not internals. Real code over mocks.

For a falsifiability checklist, read writing-good-tests.md before finalizing a test.

2. 🔴 RED — Write + Verify in One Round

Write one failing test, then run immediately:

<write test> && $TEST_CMD <focused command>

Valid 🔴 RED: fails for the expected missing behavior, not syntax/import/typo.

Record evidence:

## TDD Evidence — 🔴 RED
- 🔴 RED: `[command]` → FAIL ([expected missing behavior])

Serena diagnostics (optional): See serena/SKILL.md:Setup — get_diagnostics_for_file before/after GREEN; use replace_symbol_body/rename_symbol over raw edits. Skip if SERENA_ACTIVE=false or unavailable.

Invalid RED → fix test setup, don't write production code yet.

3. 🟢 GREEN — Minimal Implementation

Write only enough code to pass the test. No abstractions, no cleanup, no extra features.

Delete any production code written before RED.

4. 🟢 GREEN Verify

Run focused test → broader suite:

## TDD Evidence — 🟢 GREEN
- 🟢 GREEN: `[command]` → PASS
- Suite: PASS

Failing test → fix code, not test. Other tests fail → fix now.

5. REFACTOR — Only After 🟢 GREEN

Rename, deduplicate, extract. No behavior changes. Re-run tests.

6. Complete

Before marking complete:

## TDD Complete
- Behavior: [behavior]
- Mode: full|fast
- RED verified: yes | GREEN verified: yes | Refactor: yes|none
- Tests: PASS

7. Report

Per behavior: ✅ /supergraph:tdd — behavior N: [brief]

Final:

✅ /supergraph:tdd complete
- Behaviors: N | Mode: full|fast | Tests: PASS | Lint: PASS
- Next: /supergraph:fix → /supergraph:verify → /supergraph:review

Fast TDD Path (Bug Fixes)

For bugs, skip full TDD ceremony:

  1. Write one regression test that reproduces the bug
  2. Verify it fails (RED) — the bug is proved
  3. Write minimal fix only (GREEN)
  4. Verify test passes — bug is fixed
  5. No REFACTOR needed unless specified

Plan Integration

Plans must include TDD metadata per behavior task:

TDD:
- Behavior: [single behavior] | Test file: [path] | Test name: [name]
- RED command: `[focused test command]` | Expected RED failure: [missing behavior]
- Minimal GREEN change: [smallest implementation] | Mocking: none | [why unavoidable]

Executor Enforcement

  • No production edits before red_verified
  • Stop if RED passes immediately or fails for wrong reason
  • Allow implementation only after valid RED, refactor only after GREEN

Review Triggers — Reject When

  • Tests after implementation | No RED evidence | RED passed immediately | RED failed for wrong reason
  • Implementation exceeds tested behavior | Bug fix lacks regression test
  • Tests assert internals | Mocks hide integration risk

Anti-Patterns — Stop & Return to RED

SymptomFix
Production code before failing testDelete, start RED
Tests after implementationNext behavior test-first, remove untested code
"Too small to test"Write one-liner test
Immediate pass accepted as REDTest is wrong — revise
Pre-written implementation kept as referenceDelete, start fresh
Over-building before tests need itYAGNI — remove

Mock Gate — Answer Before Mocking

  1. What behavior is under test?
  2. Is this mock isolating an external, slow, or flaky boundary?
  3. What side effects does the real dependency provide?
  4. Would this test fail if real behavior broke?

Reject tests that only prove mocks exist or were called.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

analyze

무료

Risk analysis and approach selection before planning. Use when requirements are ambiguous, approaches vary, or work touches hub/bridge nodes. Skip for typo fixes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

Proactive architecture review — explore codebase structure, generate a self-contained HTML report with Mermaid diagrams and candidate improvements, then grill the findings. Use when planning a large refactor, onboarding to an unfamiliar codebase, or before a major architectural change.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

Autonomous human-like browser control and professional QA/QC testing. Powered by agent-browser (Rust native CDP, zero Playwright) with ISTQB test matrix generation, automated testcase execution, console/network error tracing, and defect reporting.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

caveman

무료

Persistent token-compression mode (~75% reduction) — now always-on by default. Strips filler while keeping code exact.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

Database migration best practices for schema changes, data migrations, rollbacks, and zero-downtime deployments across PostgreSQL, MySQL, and common ORMs (Prisma, Drizzle, Kysely, Django, TypeORM, golang-migrate).

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

Anti-slop frontend skill for landing pages, portfolios, and redesigns. The agent reads the brief, infers the right design direction, and ships interfaces that do not look templated. Real design systems when applicable, audit-first on redesigns, strict pre-flight check.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

datit309/supergraph212026년 10월 18일 업데이트

datit309의 스킬 모두 보기

이 스킬의 문제 신고