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

retroactive-test-check

Use when adding a test to an existing codebase for behavior that is already implemented. Ensures the test is meaningful by mutation-verifying it — breaking the production code to confirm the test fails for the expected reason. Triggers when the user says "add a test for existing behavior", "backfill test coverage", "the test passes on first run", or any scenario where a test is written without a corresponding new production change.

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

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.8 KB

SKILL.md(원문)

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

Retroactive Test Coverage Verification

When adding tests for behavior that is already implemented (the test passes on first run without any code changes), you MUST verify the test is meaningful by performing mutation-style verification.

When This Applies

  • Adding acceptance tests for features completed in prior work
  • Adding unit tests for existing functions
  • Backfilling test coverage for untested code
  • Any scenario where the test passes before you write implementation code

Required Process

  1. Write the test and confirm it passes.
  2. Break the behavior — make a targeted change to the implementation that should cause the test to fail (e.g., remove a header, change a status code, return a wrong value).
  3. Run the test and verify it fails for the expected reason — the failure message should clearly indicate the broken behavior, not an unrelated error.
  4. Restore the implementation to its original state.
  5. Run the test again and verify it passes.

What "Break the Behavior" Means

Make the smallest change that invalidates what the test asserts. Examples:

  • Test asserts a 401 status → change the status to 403
  • Test asserts a header value → remove that header
  • Test asserts a return value → change the return value
  • Test asserts an error message → change the message

If the test has multiple assertions covering different aspects, verify at least one mutation per distinct behavior being tested.

Common Failure Modes (why first-run-green is a yellow flag)

  • Assertions on the wrong variable, or a truthy check that passes on any non-null value
  • expect inside an unreached branch (async not awaited, early return, try/catch swallowing)
  • Mocks that replace the real behavior and then assert on the mock's own return value
  • The "new" case is already covered by an existing code path the test happens to hit, so your specific scenario never actually runs
  • File isn't in the test suite's include pattern, or the it/test is inside a describe.skip
  • Zero-assertion test ("passes" vacuously)
  • Async gotcha: unawaited promises let the test finish green before anything throws

Why

A test that passes without ever failing proves nothing. Mutation verification is lightweight and provides confidence that the test suite will actually catch regressions.

리뷰

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

댓글

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

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

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

0 / 1,000자

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

같은 저장소의 스킬

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

catchup

무료

Rebuilds session context after a clear by reading git history, plans, and beads state. Triggers on 'catch up'.

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

changelog

무료

Generate a bullet-point summary of branch changes for a PR description. Triggers on "changelog", "pr summary", "summarize branch", or "/changelog".

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

commit

무료

Commit the current changes with quality checks, status review, staged diff inspection, appropriate tests, and a clear commit message. Use when the user says "commit", "c", asks to make a commit, or wants changes saved in git.

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

declutter

무료

Refactor code to remove dead code, useless comments, unused variables, and unused imports. Use when asked to declutter a class, clean up noisy code, remove cruft, or run `/refactor:declutter`.

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

dry

무료

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

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

SDiamante13/dotfiles112026년 10월 2일 업데이트

SDiamante13의 스킬 모두 보기

이 스킬의 문제 신고