test-fixing

GitHub

系统化修复测试失败。通过运行测试套件识别错误,按类型和模块智能分组,遵循基础设施优先策略逐一修复并验证,最终确保全量测试通过且无回归。

engineering-workflow-plugin/skills/test-fixing/SKILL.md mhattingpete/claude-skills-marketplace

Trigger Scenarios

用户明确要求修复失败的测试 报告测试套件错误或CI/CD因测试失败 实现功能后要求使测试通过

Install

npx skills add mhattingpete/claude-skills-marketplace --skill test-fixing -g -y
More Options

Non-standard path

npx skills add https://github.com/mhattingpete/claude-skills-marketplace/tree/main/engineering-workflow-plugin/skills/test-fixing -g -y

Use without installing

npx skills use mhattingpete/claude-skills-marketplace@test-fixing

指定 Agent (Claude Code)

npx skills add mhattingpete/claude-skills-marketplace --skill test-fixing -a claude-code -g -y

安装 repo 全部 skill

npx skills add mhattingpete/claude-skills-marketplace --all -g -y

预览 repo 内 skill

npx skills add mhattingpete/claude-skills-marketplace --list

SKILL.md

Frontmatter
{
    "name": "test-fixing",
    "description": "Run tests and systematically fix all failing tests using smart error grouping. Use when user asks to fix failing tests, mentions test failures, runs test suite and failures occur, or requests to make tests pass."
}

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 failures
  • 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 ✓

Version History

  • b5b34bc Current 2026-08-20 08:47

Same Skill Collection

code-operations-plugin/skills/code-execution/SKILL.md
code-operations-plugin/skills/code-refactor/SKILL.md
code-operations-plugin/skills/code-transfer/SKILL.md
code-operations-plugin/skills/file-operations/SKILL.md
engineering-workflow-plugin/skills/ensemble-solving/SKILL.md
engineering-workflow-plugin/skills/feature-planning/SKILL.md
engineering-workflow-plugin/skills/git-pushing/SKILL.md
engineering-workflow-plugin/skills/review-implementing/SKILL.md
productivity-skills-plugin/skills/code-auditor/SKILL.md
productivity-skills-plugin/skills/codebase-documenter/SKILL.md
productivity-skills-plugin/skills/conversation-analyzer/SKILL.md
productivity-skills-plugin/skills/project-bootstrapper/SKILL.md
visual-documentation-plugin/skills/architecture-diagram-creator/SKILL.md
visual-documentation-plugin/skills/dashboard-creator/SKILL.md
visual-documentation-plugin/skills/flowchart-creator/SKILL.md
visual-documentation-plugin/skills/technical-doc-creator/SKILL.md
visual-documentation-plugin/skills/timeline-creator/SKILL.md

Metadata

Files
0
Version
b5b34bc
Hash
391f286d
Indexed
2026-08-20 08:47

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 00:27
浙ICP备14020137号-1 $방문자$