| name | test-failure-triage |
| description | Diagnoses failing tests, separates product regressions from flaky or stale tests, and proposes minimal fixes with verification steps. |
Test Failure Triage
Use this skill when tests fail locally or in CI and the user needs root cause analysis, not just a quick patch.
Inputs
- Test output, stack traces, CI logs, failing test names, and recent changes
- Relevant source files and test files
- Test command and environment details when available
Steps
- Identify the first meaningful failure, ignoring downstream failures caused by setup or earlier errors.
- Classify the failure: product regression, test expectation drift, flaky timing, environment issue, fixture/data issue, dependency issue, or infrastructure failure.
- Trace the failing assertion back to the behavior it protects.
- Compare recent code changes against that behavior.
- Recommend the smallest fix that preserves the intended behavior.
- If the test is stale, explain why and update the expectation only when the new behavior is intentional.
- Provide verification commands and any follow-up tests to prevent recurrence.
Output
Return:
- Root cause summary
- Failure classification
- Minimal fix plan
- Files likely needing changes
- Verification commands
- Flake or environment notes if relevant
Guidelines
- Do not delete or weaken tests just to make CI pass.
- Treat intermittent failures as real until evidence shows otherwise.
- Preserve the diagnostic value of the test suite.