testdoc-triagelisted
Install: claude install-skill vivekbhange-hub/test-doctor-skill
# testdoc-triage: from 40 red tests to 3 causes
A red run with many failures usually has few causes. `junit_report.py` groups failures by their
normalised message so you can see that 31 of 40 are one broken fixture. Then you decide, per
cluster, whose problem it is and what happens next.
## Inputs
- JUnit XML from the failing run. Best: also one or two earlier green or red runs of the same
suite, so "new failure" and "already failing" can be told apart.
- With `gh`: `gh run download <run-id> --pattern 'junit*' --dir ci-runs/<run-id>`, and
`gh run view <run-id> --log-failed` for the log of the failed step.
- The diff of the commit under test (`git diff --stat <base>..<head>`).
- Commands below say `python3`; on Windows use `python` (or `py -3`).
## Outputs
- `testdoc/triage.md`: one section per cluster with count, example, verdict, next action.
- A one-paragraph summary for the user: how many causes, which block the merge, which can wait.
## Steps
1. **Confirm permission.** Download CI artifacts and logs only for repositories the user owns or
is authorized to access. Logs can contain secrets; summarize, do not paste.
2. **Cluster the failures** with the script that ships in the sibling `testdoc-flaky` skill.
```
python3 "${CLAUDE_SKILL_DIR}/../testdoc-flaky/junit_report.py" ci-runs/failing --top 0 -o testdoc/triage.md
```
Add earlier runs as extra paths to see which failures are new (`Consistently failing` and
`Failed in` show history). Read "Fail