Analyze a failed test, fix the underlying issue, and verify the fix. Use after /test reports failures.
Automates fixing failed tests by analyzing errors, applying minimal code changes, and verifying the fix with the original test command. Use immediately after /test reports failures.
/plugin marketplace add melodic-software/claude-code-plugins/plugin install google-ecosystem@melodic-softwaretest-result-jsonAnalyze a failed test, fix the underlying issue, and verify the fix.
test_result: $ARGUMENTS - JSON object from /test command with failed test detailsExpects a JSON object from the /test command:
{
"test_name": "unit_tests",
"passed": false,
"execution_command": "pytest tests/test_auth.py -v",
"test_purpose": "Validates authentication functionality",
"error": "AssertionError: Expected status 200, got 401"
}
Review the test result:
Identify the root cause by understanding:
IMPORTANT: Use the exact execution_command from the test result:
# Run the exact command to confirm failure
{execution_command}
Verify you see the same error. This ensures you're fixing the right problem.
Apply a fix following these principles:
Re-run the exact same execution_command:
{execution_command}
Success criteria: Test now passes (exit code 0, no failures)
If the specific test passes, run the full test suite to check for regressions:
# Run complete test suite
[full test command]
Report your resolution:
## Resolution Complete
### Failure Analysis
- **Test**: {test_name}
- **Root Cause**: [What caused the failure]
- **Error**: {error}
### Fix Applied
- **File(s) Modified**: [list of files]
- **Change Summary**: [brief description]
### Validation
- **Specific Test**: PASS
- **Full Suite**: PASS/FAIL
- **Command Used**: {execution_command}
### Notes
[Any observations or recommendations]
If the fix doesn't work:
Maximum 3 retry attempts before escalating.
This command is the RESOLVE phase:
/test → [failure JSON] → /resolve-failed-test {result} → /test
↓
[verify fix]