← ClaudeAtlas

coverage-pr-commentlisted

Use when reporting code coverage on a pull request, or fixing a report that is not landing. Fire when the user says "post coverage on the PR", "show the coverage delta against the base branch", "the coverage bot adds a new comment every push", "add a threshold / red-amber-green band to coverage", "coverage dropped and nobody noticed", or when a PR carries a bare coverage percentage that no reviewer acts on. Stack-agnostic — JaCoCo, lcov, Istanbul, coverage.py, go cover, SimpleCov, coverlet. Skip for GitLab MRs, whose discussion API needs its own upsert; when Codecov or Coveralls already comments, stop and ask before adding a second (see When to STOP).
damson/hard-won-skills · ★ 1 · AI & Automation · score 67
Install: claude install-skill damson/hard-won-skills
# Coverage comment on a pull request A coverage comment fails in two ways, and neither one looks like a failure: 1. **It appends instead of editing.** Ten pushes, ten comments, and the review thread is unreadable. Fixed by a marker and an upsert (step 4). 2. **It reports a number with no verdict.** `47.3%` answers nothing a reviewer can act on — is that good, is it falling, is it about to break a rule? Fixed by a delta against the base and a threshold band (steps 2 and 5). The output is one sticky comment carrying a headline percentage, a bar that doubles as a diff, a **band line** naming where the project stands, and a per-metric table with a **status column**. ## Procedure ### 1. Get the numbers Every stack can emit a machine-readable report. Parse that, never the human summary — its layout changes between tool versions without notice. | Stack | Report to generate | Totals live at | |---|---|---| | JVM — JaCoCo | `jacocoTestReport` → `jacocoTestReport.xml` | root `<counter type="LINE" missed= covered=>` | | JS/TS — Istanbul (jest, vitest, nyc) | `--coverage --coverage-reporters=json-summary` | `coverage/coverage-summary.json` → `.total.lines.pct` | | Python — coverage.py | `coverage xml` | `coverage.xml` (Cobertura) → `line-rate`, `branch-rate` | | .NET — coverlet | `--collect:"XPlat Code Coverage"` | `coverage.cobertura.xml`, same shape | | Go | `go test -coverprofile=c.out` then `go tool cover -func=c.out` | the trailing `total:` line | | Ruby — SimpleCov