Skip to content

test-to-completion

test-to-completion

Verifies implemented work with sufficient tests, runs the relevant suites after changes and fixes, and blocks completion until tests pass. Use when implementing features, fixing bugs, refactoring, or when the user asks to finish, ship, or mark work complete; also when tests are missing, failing, or need regression coverage.

When to apply

Use this skill whenever code changes affect behavior: new features, bug fixes, refactors, or dependency updates. Treat green, relevant tests as part of the definition of done.

Workflow

  1. Understand the capability
    Identify observable behavior: inputs, outputs, side effects, errors, and boundaries.

  2. Design coverage
    Add or extend tests that cover:

    • Happy paths
    • Edge cases and boundaries
    • Error and failure modes
    • Regressions for fixed bugs (one test per bug when practical)
  3. Prefer depth over volume
    Aim for meaningful behavioral assertions (state, outputs, invariants), not redundant shallow checks.

  4. Run the right suites
    After implementation and after each fix, run the test commands appropriate to the project (e.g. bun test, pytest, cargo test, npm test). Re-run until the relevant scope is green.

  5. Close the loop

    • If a test fails: fix the code or, if the test is wrong, correct the test—do not ignore.
    • If a bug was found: add a failing test that reproduces it, then fix until it passes.
    • Do not leave skipped or failing tests as "temporary."
  6. Completion gate
    Do not report work as complete if:

    • Important behavior has no tests, or
    • Relevant tests still fail.

Expected outcomes

  • Implemented behavior is covered by tests where it matters.
  • The full relevant test suite passes for the changed area.
  • Fixed bugs are locked in with regression tests.

Project specifics

Detect and use the repo's standard test runner and scripts (package scripts, Makefile, CI config). If unclear, infer from package.json, Cargo.toml, pyproject.toml, or CI workflow files before running tests.

Related skills

  • round-trip-testing — For pipelines, serializers, and migrations where correctness depends on end-to-end data preservation.