Przejdź do treści
Biblioteka skilli
Programowanie · Testowanie

run-coverage

/run-coverage

Mierzy pokrycie testami, wskazuje niepokryte gałęzie i dokumentuje wynik, gdy zadanie wyznacza próg pokrycia lub wymaga jego podniesienia, także przy kontroli mutation score.

Repozytorium
gaffer ↗
Licencja
Apache-2.0
Ostatnia zmiana repozytorium
29.09.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 29.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

Co robi i kiedy

Mierzy pokrycie testami, wskazuje niepokryte gałęzie i dokumentuje wynik, gdy zadanie wyznacza próg pokrycia lub wymaga jego podniesienia, także przy kontroli mutation score.

Wyzwalacze z opisu

coverage must stay above N%cover the new modulewhich paths are untested
Oryginalny opis (EN)

Use when a ticket or acceptance criterion sets a coverage threshold or asks to raise coverage on a unit, and you need to measure it, find the uncovered branches, and evidence the number. Invoke for "coverage must stay above N%", "cover the new module", "which paths are untested", or a mutation-score check on changed code.

Jak działa

  1. Procedure
  2. Done when
  3. Anti-patterns
  4. Rules
  5. Capture lore
Sekcje z nagłówków SKILL.md, w oryginale · 76 linii, 737 słów
Podgląd SKILL.md
---
name: run-coverage
description: Use when a ticket or acceptance criterion sets a coverage threshold or asks to raise coverage on a unit, and you need to measure it, find the uncovered branches, and evidence the number. Invoke for "coverage must stay above N%", "cover the new module", "which paths are untested", or a mutation-score check on changed code.
stack: []
area: testing
---

# Measure and raise test coverage

Coverage tells you what the tests did **not** execute; it cannot tell you that what they
executed was checked. A line can be 100% covered by a test with no assertion. Google's
coverage guidance treats it as a signal for finding untested code — reviewed per change,
not chased as a repo-wide score — and Google's diff-based mutation testing exists because
covered-but-unasserted code is common. Measure with the repo's tool, read the uncovered
branches, test the behaviour behind them, and evidence the true number.

## Procedure

1. **Find the command.** Use the context packet's `coverage_command`; else the project
   script (`test:coverage`, `coverage`) or the tool it wraps: `vitest run --coverage`,
   `jest --coverage`, `pytest --cov=<pkg> --cov-branch --cov-report=term-missing`,
   `go test -coverprofile=cover.out ./... && go tool cover -func=cover.out`,
   `mvn verify` (JaCoCo), `cargo llvm-cov`/`cargo tarpaulin`, `dotnet test --collect:"XPlat Code Coverage"`.
   Use the project script so thresholds and excludes match CI.
2. **Baseline first.** Run it before changing anything. Note the total, the per-file line
   and **branch** figures for the files in scope, and whether a threshold already fails. If
   it fails on code your ticket does not own, note it and raise `request_decision` instead
   of fixing the world.
3. **Read the uncovered branches, not the percentage.** Open the report (`term-missing`,
   `coverage/index.html`, `lcov.info`) for the files you changed or own and list each
   uncovered branch: error paths, early returns, boundary conditions, the `else` nobody
   hits, the catch block for a failed write. Those are behaviours awaiting a test.
4. **Tie each gap to an acceptance criterion or a documented behaviour.** Test the
   behaviour behind the line through the unit's public interface (the `add-unit-test`
   skill; the `add-integration-test` skill for failure paths that need a real file,
   process or database). Error and recovery branches for persistence and concurrency are
   exactly where live-run defects hid — cover them with a real injected fault, not a mock
   that throws on cue.
5. **Check the tests would catch a regression.** For the changed code, run the repo's
   mutation tool if it has one (StrykerJS `npx --no -- stryker run --mutate <files>`, `mutmut run`,
   PIT `mvn pitest:mutationCoverage`, `cargo mutants`) scoped to the files in scope, and
   treat surviving mutants on AC-relevant lines as missing assertions. Without a tool, do
   the break-it check by hand: invert a condition in a covered branch, see a test fail,
   restore, confirm with `git diff`. (An independent tester never edits implementation
   files or runs `git diff`; it skips this step.)
6. **Never lower the bar to pass.** Do not add files to the exclude list, lower a
   threshold, or add `/* istanbul ignore */`, `/* c8 ignore */` or `# pragma: no cover` to reach a number. If a threshold is genuinely wrong for the
   ticket's scope, raise it via `request_decision`.
7. **Re-run and evidence.** Record the exact command, the total, and the per-file line and
   branch figures for the files in scope, before and after — plus the mutation score if
   you ran one. Use the `record-evidence` skill (`coverage_report`) against the AC that sets
   the threshold; the runner submits for review.

## Done when

- The coverage AC's threshold is met on a run in this session, measured by the repo's
  configured tool.
- Every newly covered branch is covered by a test that asserts its outcome and fails when
  that branch's behaviour is broken.
- No excludes, ignores or threshold edits were added.

## Anti-patterns

- Tests that call code and assert nothing (or only `toBeDefined()`) to lift the number.
- Chasing the repo-wide total when the AC names a unit; chasing 100% on trivial getters.
- Snapshotting large outputs to cover render paths.
- Reporting a number from memory or a previous session.

## Rules

- Measure with the repo's tool and config; no second coverage tool.
- Coverage on the ticket's code is what matters unless the AC names the total.
- Delete any added test that only touches lines.

## Capture lore

This skill is one of the places durable, reusable knowledge naturally surfaces:
**While reading the uncovered branches you learn a testing convention the repo assumes — a fixtures directory, a mocked boundary, a module deliberately excluded and why.** That kind of fact is *lore*. Capture it via the **lore-capture
protocol in your brief** (`CLAUDE.factory.md`, step 11 "Memory contribution"):
call the Memory MCP `suggest_lore` once at the close of your work — reusable
conventions, gotchas, decisions, and boundaries only, never per-ticket trivia.

Wersje

W bazie nie ma innych skilli o nazwie run-coverage.

Migawka bazy z 13.11.2026 · wersja paczki 3b6a91035d2e (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100qe-coverage-analysis
    Analizuje dane pokrycia testami (Istanbul, c8, lcov), wskazuje niepokryte linie, gałęzie i funkcje z wagą ryzyka oraz porównuje pokrycie między gałęziami.
  • 100analyzing-test-coverage
    Analizuje metryki pokrycia kodu testami i wskazuje nieprzetestowane fragmenty kodu.
  • 100analyzing-test-coverage
    Analizuje metryki pokrycia kodu testami i wskazuje nieprzetestowane fragmenty kodu.
  • 90Coverage Guard
    Sprawdza pokrycie testami, znajduje nieprzetestowany kod i dopisuje brakujące testy, dążąc do pełnego pokrycia.
  • 100review-coverage
    Analizuje pokrycie testami zmienionego kodu Go przez go test -coverprofile i raportuje niepokryte funkcje pogrupowane według pakietów, z oceną ważności.
  • 90code-coverage
    Analizuje pokrycie testami, wskazuje nietestowane ścieżki kodu i generuje testy dla najważniejszych nieobjętych obszarów przed wydaniami.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.