fix-test

Diagnose failing tests and fix the responsible test or production code.

Updated Dec 21, 2018
One-click install
npx skills add https://github.com/dhnt/dhnt --skill fix-test-dhnt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-test
Source: https://github.com/dhnt/dhnt/tree/main/catalog/md/test/fix-test
Command: npx skills add https://github.com/dhnt/dhnt --skill fix-test-dhnt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you quickly determine whether a failing automated test is incorrect or whether the underlying code implementation is wrong, so you can fix the right layer and restore reliable CI.

Core Features & Use Cases

  • Triage and diagnosis: Reproduce the failure locally and interpret expected vs actual, stack traces, and recent changes to decide what diverged.
  • Correct fix path: Apply the repair process for cases where the code is wrong versus where the test/fixtures/mocks are wrong.
  • Flake handling: Identify non-deterministic failures and address them by repeated runs rather than masking them with skips or time sleeps.
  • Safe output format: Produce a consistent diagnosis, fix plan, and verification report so the change is reviewable and reversible.

Quick Start

Run the failing test in isolation, decide whether the contract changed or the implementation diverged, then update the test or apply the bug fix accordingly and rerun the test enough times to confirm it is stable.

Frequently Asked Questions about fix-test

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix failing unit tests without breaking the original test contract?

To fix failing unit tests, reproduce the failure locally to triage whether the production code diverged or the test contract is wrong, then apply the correct remediation path to the appropriate layer and verify the fix removes the failure without introducing flakiness.

Why does my CI pipeline have flaky tests and how do I handle non-deterministic failures?

Flaky tests are non-deterministic failures that should be addressed by reproducing the failure and running repeated verifications to identify the root cause, rather than masking the flaky tests with skips or time sleeps.

How do I triage test failures to decide if I should update the test or fix the code?

Test triage involves reproducing the failure locally and interpreting expected versus actual results, stack traces, and recent changes to determine if the test contract changed or the underlying implementation diverged before applying a fix.

What is the best way to repair regression test failures encountered during the SDLC review cycle?

The best way to repair regression test failures is to isolate the failing test, diagnose the root cause of the failure, apply the correct per-case remediation path, and verify the fix removes the failure for the right reason.

Can I use automated test fixing for integration tests or is it only for unit tests?

Automated test fixing applies to unit, integration, and regression test failures encountered during SDLC test and review cycles, requiring local reproduction and failure triage to determine the correct per-case remediation path.

How do I verify a test fix removes a CI failure without introducing new flakiness?

To verify a test fix removes a CI failure without introducing flakiness, rerun the failing test in isolation enough times to confirm it is stable, ensuring the fix removes the failure for the right reason.