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

test-driven-execution

Before writing any implementation code, define the acceptance criteria and test cases that the code must satisfy. Agents then write code to pass these tests — not to match a vague description. Eliminates "it works on my machine" and "I think this is what you wanted" outcomes.

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

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.4 KB

SKILL.md(원문)

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

<!-- TÜRKÇE AÇIKLAMA ─────────────── Bu skill, implementasyon kodu yazmadan önce "başarı kriterleri"ni ve test senaryolarını tanımlar. Agent, kodu belirsiz bir tanıma değil — somut testleri geçmek için yazar. Kırmızı→Yeşil→Refactor döngüsünü uygular. "Bence çalışıyor" yerine "testler geçiyor" der. NE ZAMAN: Her yeni feature veya bug fix'ten önce. Test spec olmadan kod yazılmaz. ÇIKTI: Geçen testler, coverage raporu, "Task Complete" özeti. -->

Test-Driven Execution Skill

When to Trigger

  • At the start of any feature or task from a plan
  • When a bug fix is requested (test first, then fix)
  • When a subagent is about to implement a module
  • When "done" is ambiguous and needs a clear definition

Philosophy

"A feature is not done when code is written. It is done when the tests pass."

Tests written before code serve three purposes:

  1. They force clarity on what "correct" actually means
  2. They prevent the agent from drifting into over-engineering
  3. They provide instant verification that the task is complete

Step-by-Step Process

1. Extract Acceptance Criteria

Read the task description and extract every "must" and "should":

Example task: "Add a user registration endpoint"

Extracted criteria:

  • Must accept email, password, name in request body
  • Must return 201 on success with the created user (excluding password)
  • Must return 400 if email is already registered
  • Must return 422 if fields are missing or invalid
  • Must hash the password before storing

2. Write the Test Specification

Before writing any implementation, write the tests (or test outlines):

For unit tests:

describe('registerUser()', () => {
  it('creates a user with hashed password', async () => { ... })
  it('throws DuplicateEmailError if email already exists', async () => { ... })
  it('throws ValidationError if email format is invalid', async () => { ... })
  it('never stores plaintext password', async () => { ... })
})

For integration/API tests:

describe('POST /api/auth/register', () => {
  it('returns 201 and user object (without password) on success', async () => { ... })
  it('returns 400 when email already registered', async () => { ... })
  it('returns 422 when required fields missing', async () => { ... })
})

For UI/E2E tests:

Scenario: Successful registration
  Given I am on the /register page
  When I fill in valid email, password, and name
  And I click "Create Account"
  Then I should be redirected to /dashboard
  And I should see "Welcome, <name>"

3. Confirm Tests Fail (Red)

Run the tests before writing any implementation:

npm test
# or
pytest
# etc.

Expected: All new tests fail. This confirms the tests are correctly detecting the absence of the feature. If a test passes before implementation, the test is wrong — fix it.

4. Write the Minimum Implementation (Green)

Now implement the feature. The goal is simple: make the tests pass.

Rules during implementation:

  • Write only what is needed to pass the tests — nothing more
  • If you find yourself writing code with no corresponding test, stop and write the test first
  • Don't optimize yet — correctness first
# Keep running tests as you go
npm test --watch

5. Refactor (Refactor)

Once all tests pass:

  • Clean up the code (naming, structure, duplication)
  • Run tests again after every refactor step to confirm nothing broke
  • Add edge case tests for anything discovered during implementation

6. Define the Done Checklist

A task is complete when:

  • All acceptance criteria from Step 1 have a corresponding test
  • All tests pass (npm test exits with code 0)
  • No test is skipped (no .skip, xtest, # noqa)
  • Code coverage for the new module is ≥ 80% (check with --coverage)
  • No existing tests were broken by this change

7. Report Completion

## Task Complete: <feature name>

**Tests written:** <N>
**Tests passing:** <N>/<N>
**Coverage:** <X>%
**Acceptance criteria covered:**
  ✅ Creates user with hashed password
  ✅ Returns 400 on duplicate email
  ✅ Returns 422 on validation failure
  ✅ Never stores plaintext password

**Not covered (and why):**
  ⚠️ Email delivery test — skipped, requires mock SMTP setup

Test Naming Convention

Test names must read as requirements:

✅ it('returns 400 when email already exists') ✅ it('never exposes password in API response') ❌ it('test email duplicate') ❌ it('works correctly')

If you can't name the test clearly, the requirement isn't clear enough — clarify before writing.

Rules

  • No implementation before test spec. The spec can be pseudocode / outlines, but it must exist.
  • A failing test is not a failure — it is a correctly written test in the red phase.
  • Never delete a test to make the suite pass. Fix the code or fix the test — with justification.
  • Integration tests are not optional for public-facing APIs.
  • Coverage % is a proxy, not a goal. 100% coverage with meaningless assertions is worse than 70% with real ones.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Before committing to an implementation plan, run this skill to stress-test the proposed architecture. Catches over-engineering, circular dependencies, missing failure modes, security gaps, and scalability cliffs — before any code is written. Acts as a "second eye" on the plan.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

Systematic code review skill covering both requesting a review (pre-commit checklist) and receiving and responding to review feedback. Checks code quality, security, test coverage, architectural alignment, and documentation before any code is committed.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

Periodically scan project dependencies for security vulnerabilities, outdated packages, and unused dependencies. Produces a prioritized action report. Run before every major release and at least once per month.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

After any significant code change — new feature, API modification, config change, or architectural refactor — run this skill to identify which documentation files are now stale and update them. Keeps docs and code from drifting apart.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

github

무료

Manages all git operations (commit, push, branch management, PR creation) in a standardized, safe, and consistent way. Automatically runs the code-review skill before any commit. Enforces Conventional Commits standard. Handles the full lifecycle: branch → review → commit → push → PR.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

When something breaks in production: triage the severity, gather evidence, identify root cause, deploy a fix or mitigation, and write a post-mortem. Provides a calm, structured process for high-stress moments.

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

omergocmen/vibe-coder-kit952026년 6월 4일 업데이트

omergocmen의 스킬 모두 보기

이 스킬의 문제 신고