When to use it

Use test-discipline for an authorized bug fix when an observable regression test can expose the problem. The test should reproduce the failure in the old code so you can tell whether the fix changes the behavior.

How it works

Figure 01

A useful regression test changes from red to green.

  1. Reproduce

    Observe a test fail for the reported bug.

  2. Repair

    Change the code and rerun the same test.

  3. Validate

    Check that the test detects the relevant failure.

ResultA regression check tied to the repaired behavior
This shows the bug-fix path. Characterization of untested code has a separate path. Temporary validation mutations are restored.

Before the fix, the skill establishes a failing regression test or an appropriate characterization artifact. After the implementation changes, that same evidence shows whether the behavior changed as intended.

After a reproduced fix or a characterization check, the workflow validates that the check can detect the relevant failure. It makes a scoped temporary mutation, observes the result, and restores the original code. You can also explicitly request validation of a freshly green test.

An example request

Ask your agent

“Fix the retry-count bug. First add a regression test that fails on the current code, then use it to verify the fix.”

This illustrates a request you can adapt; it is not a transcript of a completed run.

A regression check whose failure and subsequent success are tied to the behavior being repaired.

Install and use

The skill’s identifier is test-discipline. It ships in the discipline-gates plugin. In Claude Code, first add the Overclock marketplace, then install the package:

/plugin install discipline-gates@overclock

For a standalone installation, keep the skill directory and its bundled resources together. The repository also includes per-skill Codex metadata. Read the full skill instructions for its exact workflow and supporting files.

What to keep in mind

The skill has quiet paths for trivial edits, new features, generated files, behavior-preserving rewrites, and code that is already adequately covered.

It does not stage or commit changes. Bugs that cannot be reproduced through an ordinary test may need debugging-discipline to establish a useful observation loop first.

  • Git archaeologist — Find out why a defensive check exists before removing it.
  • Debugging discipline — Build a useful observation loop for a bug that resists straightforward reproduction.