Testing

test-fixing

davila7/claude-code-templates · updated Apr 8, 2026

$npx skills add https://github.com/davila7/claude-code-templates --skill test-fixing
summary

Systematically identify and fix all failing tests using smart grouping strategies.

skill.md

Test Fixing

Systematically identify and fix all failing tests using smart grouping strategies.

When to Use

  • Explicitly asks to fix tests ("fix these tests", "make tests pass")
  • Reports test failures ("tests are failing", "test suite is broken")
  • Completes implementation and wants tests passing
  • Mentions CI/CD failures due to tests

Systematic Approach

1. Initial Test Run

Run make test to identify all failing tests.

Analyze output for:

  • Total number of failures
  • Error types and patterns
  • Affected modules/files

2. Smart Error Grouping

Group similar failures by:

  • Error type: ImportError, AttributeError, AssertionError, etc.
  • Module/file: Same file causing multiple test failure
  • Root cause: Missing dependencies, API changes, refactoring impacts

Prioritize groups by:

  • Number of affected tests (highest impact first)
  • Dependency order (fix infrastructure before functionality)

3. Systematic Fixing Process

For each group (starting with highest impact):

  1. Identify root cause

    • Read relevant code
    • Check recent changes with git diff
    • Understand the error pattern
  2. Implement fix

    • Use Edit tool for code changes
    • Follow project conventions (see CLAUDE.md)
    • Make minimal, focused changes
  3. Verify fix

    • Run subset of tests for this group
    • Use pytest markers or file patterns:
      uv run pytest tests/path/to/test_file.py -v
      uv run pytest -k "pattern" -v
      
    • Ensure group passes before moving on
  4. Move to next group

4. Fix Order Strategy

Infrastructure first:

  • Import errors
  • Missing dependencies
  • Configuration issues

Then API changes:

  • Function signature changes
  • Module reorganization
  • Renamed variables/functions

Finally, logic issues:

  • Assertion failures
  • Business logic bugs
  • Edge case handling

5. Final Verification

After all groups fixed:

  • Run complete test suite: make test
  • Verify no regressions
  • Check test coverage remains intact

Best Practices

  • Fix one group at a time
  • Run focused tests after each fix
  • Use git diff to understand recent changes
  • Look for patterns in failures
  • Don't move to next group until current passes
  • Keep changes minimal and focused

Example Workflow

User: "The tests are failing after my refactor"

  1. Run make test → 15 failures identified
  2. Group errors:
    • 8 ImportErrors (module renamed)
    • 5 AttributeErrors (function signature changed)
    • 2 AssertionErrors (logic bugs)
  3. Fix ImportErrors first → Run subset → Verify
  4. Fix AttributeErrors → Run subset → Verify
  5. Fix AssertionErrors → Run subset → Verify
  6. Run full suite → All pass ✓
general reviews

Ratings

4.510 reviews
  • Shikha Mishra· Oct 10, 2024

    test-fixing is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Piyush G· Sep 9, 2024

    Keeps context tight: test-fixing is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Chaitanya Patil· Aug 8, 2024

    Registry listing for test-fixing matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Sakshi Patil· Jul 7, 2024

    test-fixing reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Ganesh Mohane· Jun 6, 2024

    I recommend test-fixing for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Oshnikdeep· May 5, 2024

    Useful defaults in test-fixing — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Dhruvi Jain· Apr 4, 2024

    test-fixing has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Rahul Santra· Mar 3, 2024

    Solid pick for teams standardizing on skills: test-fixing is focused, and the summary matches what you get after install.

  • Pratham Ware· Feb 2, 2024

    We added test-fixing from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Yash Thakker· Jan 1, 2024

    test-fixing fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.