test-driven-bug-fix — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited test-driven-bug-fix (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
A bug without a failing test is an unverified assumption. A bug fixed without a failing test may be fixed correctly this time, but has no protection against regression. The test-driven bug fix discipline ensures that every fix is:
Before reproducing, classify the failure into one of four buckets:
| Bucket | Symptom | Action |
|---|---|---|
| Product | Real defect in the code under test | Continue with the four-step discipline below |
| Test impl | Test wrong; behavior correct | File a separate test-fix; do NOT change production code to satisfy a bad test |
| Infra | CI environment, DB, network, container | Fix the env; do not encode the env-fix as a test |
| Tooling | Test runner / build system | Fix the tool; the bug is not in the product |
Intermittent failures are not a fifth bucket — they belong in one of the four above. Quarantining a test as "flaky" without classifying the failure hides the very intermittent product bug that the test surfaced. The conditions that make a test flaky are frequently the conditions that trigger the bug. Reproduce deterministically before fixing — see skills/systematic-debugging/SKILL.md. When the failure is non-obvious, drill the causal chain to its root first via the Root Cause Analysis (5 Whys) subsection of skills/systematic-debugging/SKILL.md before proposing a fix.
Follow skills/progress-tracking/SKILL.md: when this procedure has two or more steps, seed one todo item per step before starting and mark each complete as you go.Before writing any code, reproduce the bug. Understanding exactly when and why the bug occurs is the prerequisite for everything that follows.
do (expected behavior)
Do not hypothesize a fix during this step. Observe first.
Reproduction is complete when you can reliably trigger the bug on demand.
Write a test that:
triggers the bug
happen, not what currently happens
failure (wrong behavior), not an error (broken test infrastructure)
Name the test to document the bug scenario: test_returns_error_when_token_is_expired, not test_bug_123 or test_fix.
Run the test suite and confirm:
This is the "Red" state. Do not proceed until the test fails correctly.
Apply the smallest change that makes the failing test pass.
behavior. Do not refactor, improve, or extend.
is wrong, that is a separate problem — do not fix the code to match wrong tests.
bug, note it. File it for later. Fix only the targeted bug.
failing to passing. No existing test should start failing.
This is the "Green" state. The targeted test passes, all other tests pass.
After the fix:
now fails that passed before, the fix introduced a regression — undo and investigate.
occurs with the original inputs.
missing null check), search the codebase for the same pattern. File issues for related instances — do not fix them in this commit.
line of the fix and re-run the new test. It must go red again. If it still passes, the test does not exercise the fix — strengthen the assertion or the reproduction inputs. This guards against fixes that hide the symptom without addressing the root cause, and against tests that drift away from the bug.
Each step produces a commit:
test: reproduce <bug description> with failing test
Adds a test that fails due to the bug described in <issue reference>.
The test will pass once the fix is applied.fix: <minimal description of the fix>
Fixes the root cause identified in the preceding test commit.
All tests now pass including the new reproduction test.
Closes #<issue>Keeping the test commit and fix commit separate makes the intention clear: the test proves the bug existed, the fix makes it go away.
the surrounding code. The scope is: broken test passes, no regressions.
functionality beyond restoring the previous intent, that is a feature, not a bug fix.
corrects the buggy code. When in doubt, fix the root cause.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.