Catalogue / grouped-test-failure-recovery
grouped-test-failure-recovery
Older skill: source not recordedSignedRepairs a failing test suite by collecting failures, grouping shared causes, fixing upstream problems first, and verifying focused tests before the complete suite. Use when a user asks to fix broken tests or a refactor has left CI failing. Not for hiding failures by weakening assertions or skipping…--- name: grouped-test-failure-recovery description: >- Repairs a failing test suite by collecting failures, grouping shared causes, fixing upstream problems first, and verifying focused tests before the complete suite. Use when a user asks to fix broken tests or a refactor has left CI failing. Not for hiding failures by weakening assertions or skipping tests. ---
Treat the failures as a dependency map
Read the project's instructions and test entry points. Use make test when the repository defines that target; otherwise identify the documented equivalent. Verify that a test run is isolated from live services and real data. Before editing code, installing dependencies, changing configuration, or running tests that write data or contact an external system, show the intended effects and obtain explicit human confirmation.
Run the complete applicable suite once to collect an initial inventory. Record failure count, error classes, failing test files, affected implementation modules, and representative stack traces. Keep unrelated working-tree changes intact and inspect git diff to understand what recently moved.
Form repair groups from evidence
Group failures sharing an error class, module, or demonstrated cause. An import failure affecting several test files may have one repair; similar-looking assertions may have different causes. Verify the connection before merging them into a group.
Rank by dependency and impact. Resolve missing imports, dependency setup, and configuration before diagnosing downstream functional failures. Then address changed APIs, signatures, renamed symbols, or module locations. Finally investigate behavior, boundary cases, and incorrect assertions against the intended contract. Within a dependency level, prefer a cause blocking more tests.
Use an inventory such as this fresh scenario: several storage tests cannot import a moved adapter, a smaller set calls an old constructor, and one export test mishandles an empty result. Repair the adapter path first, verify it, then reassess which remaining failures are still independent. Do not assume all later failures will survive the first fix.
Complete one group before starting another
Read the relevant implementation, tests, project conventions, and recent changes. State the demonstrated cause and make a focused repair after confirmation. A test expecting obsolete behavior may need correction, but justify that change against the intended API rather than treating any failing assertion as wrong.
Run the tests for that group and any nearby behavior the repair affects. A pytest project managed with uv can select a file or expression:
uv run pytest tests/test_inventory_export.py -v uv run pytest -k "inventory_export" -v
These are illustrative selectors; use actual discovered tests. Fix the remaining failure in the current group before moving on. If its cause differs from the original hypothesis, update the inventory rather than piling on unrelated edits.
Reconcile the final suite
After all known groups pass, run the complete initial suite again through its normal entry point. Check that formerly failing tests actually ran, no new regression appeared, and existing coverage requirements remain intact. Report baseline failures, repaired causes, final test counts and result, and any test or environment limitation. A passing subset proves only that subset.
Never
- Delete, skip, or relax tests merely to obtain a green result.
- Install, edit, or run stateful tests without the explicit confirmation above.
- Change several unverified groups at once or stage unrelated user work.
- Claim the suite passes without a current complete run at the required scope.
| File | Size | SHA-256 |
|---|---|---|
| SKILL.md | 3.7 kB | 1ff0202bc0f5 |
| examples.json | 1.9 kB | 3ce905985b6b |
Published verbatim from the pinned commit. Nothing is rewritten.
| Version | Pinned commit | Signed | |
|---|---|---|---|
| 1.0.0 Current | Not recorded | 2 Oct 2026 |
Locking a skill to one version needs Pro.