{"id":"test-fixing","name":"test-fixing","summary":"テストを実行し、スマートエラーグループ化を使って失敗したテストを体系的に修正します。ユーザーが失敗したテストの修正を求めたり、テストの失敗について言及したり、テストスイートを実行して失敗が発生したり、テストを通すように依頼したりするときに使います。","body":"# Test Fixing\n\nSystematically identify and fix all failing tests using smart grouping strategies.\n\n## When to Use\n\n- Explicitly asks to fix tests (\"fix these tests\", \"make tests pass\")\n- Reports test failures (\"tests are failing\", \"test suite is broken\")\n- Completes implementation and wants tests passing\n- Mentions CI/CD failures due to tests\n\n## Systematic Approach\n\n### 1. Initial Test Run\n\nRun `make test` to identify all failing tests.\n\nAnalyze output for:\n- Total number of failures\n- Error types and patterns\n- Affected modules/files\n\n### 2. Smart Error Grouping\n\nGroup similar failures by:\n- **Error type**: ImportError, AttributeError, AssertionError, etc.\n- **Module/file**: Same file causing multiple test failures\n- **Root cause**: Missing dependencies, API changes, refactoring impacts\n\nPrioritize groups by:\n- Number of affected tests (highest impact first)\n- Dependency order (fix infrastructure before functionality)\n\n### 3. Systematic Fixing Process\n\nFor each group (starting with highest impact):\n\n1. **Identify root cause**\n   - Read relevant code\n   - Check recent changes with `git diff`\n   - Understand the error pattern\n\n2. **Implement fix**\n   - Use Edit tool for code changes\n   - Follow project conventions (see CLAUDE.md)\n   - Make minimal, focused changes\n\n3. **Verify fix**\n   - Run subset of tests for this group\n   - Use pytest markers or file patterns:\n     ```bash\n     uv run pytest tests/path/to/test_file.py -v\n     uv run pytest -k \"pattern\" -v\n     ```\n   - Ensure group passes before moving on\n\n4. **Move to next group**\n\n### 4. Fix Order Strategy\n\n**Infrastructure first:**\n- Import errors\n- Missing dependencies\n- Configuration issues\n\n**Then API changes:**\n- Function signature changes\n- Module reorganization\n- Renamed variables/functions\n\n**Finally, logic issues:**\n- Assertion failures\n- Business logic bugs\n- Edge case handling\n\n### 5. Final Verification\n\nAfter all groups fixed:\n- Run complete test suite: `make test`\n- Verify no regressions\n- Check test coverage remains intact\n\n## Best Practices\n\n- Fix one group at a time\n- Run focused tests after each fix\n- Use `git diff` to understand recent changes\n- Look for patterns in failures\n- Don't move to next group until current passes\n- Keep changes minimal and focused\n\n## Example Workflow\n\nUser: \"The tests are failing after my refactor\"\n\n1. Run `make test` → 15 failures identified\n2. Group errors:\n   - 8 ImportErrors (module renamed)\n   - 5 AttributeErrors (function signature changed)\n   - 2 AssertionErrors (logic bugs)\n3. Fix ImportErrors first → Run subset → Verify\n4. Fix AttributeErrors → Run subset → Verify\n5. Fix AssertionErrors → Run subset → Verify\n6. Run full suite → All pass ✓","author":"@mhattingpete","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/mhattingpete/claude-skills-marketplace/tree/main/engineering-workflow-plugin/skills/test-fixing","license":"Apache-2.0","category":"testing","lang":"en","tokens":628,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}