$npx -y skills add omnigentx/jarvis --skill test-fixingSystematically identify and fix failing tests using smart error grouping. Use when tests are failing and need to be fixed.
| 1 | # Test Fixing |
| 2 | |
| 3 | Adapted from [mhattingpete/claude-skills-marketplace](https://github.com/mhattingpete/claude-skills-marketplace/tree/main/engineering-workflow-plugin/skills/test-fixing). |
| 4 | |
| 5 | ## When to Use |
| 6 | |
| 7 | - Tests are failing after implementation changes |
| 8 | - CI/CD reports test failures |
| 9 | - QE reports FAIL verdict with test failures |
| 10 | |
| 11 | ## Systematic Approach |
| 12 | |
| 13 | ### 1. Run All Tests |
| 14 | Run the test suite to see the full picture: |
| 15 | - Total number of failures |
| 16 | - Error types and patterns |
| 17 | - Affected modules/files |
| 18 | |
| 19 | ### 2. Group Errors |
| 20 | |
| 21 | Group similar failures by: |
| 22 | - **Error type**: ImportError, AttributeError, AssertionError, etc. |
| 23 | - **Module/file**: Same file causing multiple failures |
| 24 | - **Root cause**: Missing deps, API changes, refactoring impacts |
| 25 | |
| 26 | ### 3. Fix in Priority Order |
| 27 | |
| 28 | **Infrastructure first:** |
| 29 | 1. Import errors |
| 30 | 2. Missing dependencies |
| 31 | 3. Configuration issues |
| 32 | |
| 33 | **Then API changes:** |
| 34 | 4. Function signature changes |
| 35 | 5. Module reorganization |
| 36 | 6. Renamed variables/functions |
| 37 | |
| 38 | **Finally logic issues:** |
| 39 | 7. Assertion failures |
| 40 | 8. Business logic bugs |
| 41 | 9. Edge case handling |
| 42 | |
| 43 | ### 4. Fix One Group at a Time |
| 44 | |
| 45 | For each group: |
| 46 | 1. **Identify root cause** — Read code, check recent changes |
| 47 | 2. **Implement fix** — Minimal, focused changes |
| 48 | 3. **Run subset tests** — Verify this group passes |
| 49 | 4. **Move to next group** — Only after current passes |
| 50 | |
| 51 | ### 5. Final Verification |
| 52 | |
| 53 | After all groups fixed: |
| 54 | - Run complete test suite |
| 55 | - Verify no regressions |
| 56 | - Report results |
| 57 | |
| 58 | ## Best Practices |
| 59 | |
| 60 | - Fix one group at a time |
| 61 | - Run focused tests after each fix (`pytest tests/specific_test.py -v`) |
| 62 | - Keep changes minimal |
| 63 | - Don't move to next group until current passes |
| 64 | - Look for patterns — one fix might solve multiple failures |