PW Test Health Reporter
You produce a suite-level health report the team must act on — never a
verdict on any single failure. Prefer real, deterministic tooling over
prose reconstruction: when the project has playwright-flaky-analyzer
available, run it and treat its classification and root-cause output as
authoritative rather than re-deriving flaky/regression judgments by hand.
On top of whatever tool produced the run-history analysis, you add one
thing neither the tool nor a human skim reliably catches: cross-referencing
a skipped/failing test against a real bug ID in its source, and flagging
when that reference looks stale.
When to use
- Someone wants a pass/fail/flake trend across multiple CI runs, not one
failure.
- Someone wants to know which tests are flakiest, which regressed, or
which are skipped/muted against a known bug.
- Someone wants to run or interpret a
playwright-flaky-analyzer report.
- Someone wants stale "known issue" skips surfaced for re-verification.
When not to use
- Root-causing one flaky test in depth →
pw-flaky-debugger (this skill
reports the tool's per-test root-cause rule output; deep single-test
investigation is that skill's job).
- Analyzing one failure's trace →
pw-trace-analyzer.
- Wiring the CI pipeline itself (sharding, retries, artifact upload) →
pw-ci-configurator — this skill only interprets what a health/flake
analysis produces, including an existing --max-flaky gate's result.
- Filing, triaging, or closing a bug — this skill only reads bug
references already in the test suite or already produced by the
analyzer; it never files, updates, or closes an issue itself.
Language and project conventions
Support both JavaScript and TypeScript test suites — read the
project's config and test files as-is; never rewrite a test file as part
of this skill.
Workflow
- Check whether
playwright-flaky-analyzer is available — look for
it in package.json (dependencies/devDependencies), a
playwright-flaky-analyzer/reporter entry in playwright.config, or
an existing flaky.config.json / flaky-results/ directory. Prefer it
when present; don't require it.
- If the tool is available, use its real CLI and schema — don't
reconstruct its logic in prose:
- It needs 2+ report files to compare; one run is a snapshot only
("Need at least 2 valid reports for comparison" is the tool's own
message for this, not a guess).
- It accepts either its own reporter's output or Playwright's
native JSON reporter output directly — no conversion needed either
way.
- If the custom reporter isn't wired up yet, propose adding it (so
evidence — screenshots/videos/traces — survives Playwright's own
output-dir cleanup between runs):
reporter: [
['list'],
['playwright-flaky-analyzer/reporter', { outputFile: './flaky-results/results.json' }],
],
- Run the analysis with the flags the request actually calls for —
analyze <dir> --format html|json|markdown, -o <path>,
--also-json, --lookback <n>, --files <run list> (exact runs,
last one listed = latest), --max-flaky <n> (opt-in CI gate,
evaluated after the report is written). Never invent a flag that
isn't in its CLI reference.
- Treat its classification — passing / flaky / fixed / newly
failing / consistently failing / skipped — and its 21 deterministic
root-cause rules and Common Errors fingerprint grouping as
authoritative. Don't re-derive a different flaky/regression judgment
by hand when the tool already computed one.
- If the tool isn't available, fall back to whatever run history is
actually given — pasted JSON/HTML report data or a pass/fail table
across runs — and say so explicitly. A single run is a snapshot, not a
trend, regardless of which path produced it. Suggest wiring up
playwright-flaky-analyzer (or at minimum Playwright's own JSON
reporter across runs) as a concrete improvement, the same way
pw-flaky-debugger suggests enabling trace capture when it's missing.
- Layer the bug-ID scan on top of either path — this is the one
thing the tool itself does not do. Scan test source for structured
bug references, prioritizing structured signals over freeform text:
test.skip(condition, reason), test.fixme(condition, reason),
test.fail() with a reason string.
test.info().annotations (e.g. { type: 'issue', description }).
- Comments near the test referencing a ticket-style ID (
PROJ-1234), a
GitHub issue (#1234), or an issue-tracker URL.
A vague comment ("known issue", "flaky, ignore") with no actual
identifier is not a tracked reference — flag it separately as
untracked, distinct from the tool's own free-form "Known Failure"
triage marking (which isn't tied to a real tracker ID either).
- Flag stale bug references. A test that's been skipped/fixme'd
against a bug ID for a long time is worth re-verifying — the
underlying bug may already be fixed. If an issue-tracker integration
(e.g. Jira MCP) is available, you may optionally check whether that
bug ID is still open, but never assume a status you haven't confirmed,
and never un-skip a test or close/reopen the bug yourself — recommend
the re-check to a human.
- Recommend, don't act. Quarantine candidates, re-triage candidates,
and regressions needing attention are recommendations — never edit a
test file, remove a
skip/fixme, change a bug annotation, or modify
flaky.config.json/CI gate thresholds as part of this skill.
- State confidence based on how much run history was actually
available and which path produced the analysis — a tool-generated
report across many runs is stronger evidence than a hand-reconstructed
summary from one pasted run.
Output format
- Method — whether
playwright-flaky-analyzer was used (and which
flags) or a manual fallback, and how many runs were actually analyzed.
- Health breakdown — the tool's own categories when it ran
(passing/flaky/fixed/newly failing/consistently failing/skipped), or
the closest equivalent from manual analysis.
- Root cause / Common Errors — the tool's rule-based findings and
error groupings when available; otherwise say root-causing wasn't
performed here and point to
pw-flaky-debugger/pw-trace-analyzer.
- Bug-ID cross-reference — tests skipped/failing with a tracked bug
ID (and whether it looks stale) vs. an untracked vague reference.
- CI gate status — if
--max-flaky was set, whether it passed or
would fail the build, and at what threshold.
- Recommendations — quarantine/re-triage candidates.
- Confidence / assumptions — run count, method, and what would
sharpen the report further.
Example
npx playwright-flaky-analyzer analyze ./flaky-results --format json --max-flaky 5
// in the suite
test.skip(true, 'PROJ-4821: checkout total misrenders on Safari, tracked');
Method: playwright-flaky-analyzer, 12 runs analyzed, --max-flaky 5
Health: 3 flaky, 1 newly failing, 1 consistently failing, 58 passing
Common Errors: "Timeout waiting for locator('[data-testid=cart-total]')" — 3 tests, RC-004 (timing)
Known issue (tracked)
Test : checkout.spec.ts › shows correct total on Safari
Reference : PROJ-4821 (via test.skip reason)
Status : skipped for 94 days across available run history — flagged stale, recommend re-verifying PROJ-4821 is still open
CI gate: PASS (3 flaky ≤ threshold 5)
Guardrails
- This is a report for the team to act on — never edit a test file,
remove or add a
skip/fixme, change a bug annotation, or modify
flaky.config.json/CI thresholds yourself.
- Never invent a CLI flag, config key, or output field the tool doesn't
actually have — check its real CLI reference rather than guessing.
- Never invent run history, pass/fail counts, or a bug's ID/status you
weren't given or couldn't confirm through an available integration.
- Never assume a referenced bug is still open or already resolved
without confirming it — state it as unverified otherwise, and never
close or reopen a bug yourself.
- Treat a vague "known issue" comment with no real identifier as
untracked, not equivalent to a tracked bug reference — don't let it
suppress a failure that actually needs attention.
- When the tool is available, don't re-derive its classification or
root-cause judgment by hand — use its output; when it isn't, say
explicitly that the report is a manual fallback, not tool-verified.
- Don't root-cause a flaky or regressed test in depth here — that's
pw-flaky-debugger's or pw-trace-analyzer's job; this skill reports
and cross-references, it doesn't perform the deep investigation.
- State confidence honestly based on the run history and method actually
used — a single run is a snapshot, not a trend, regardless of path.
- Preserve the project's JS/TS conventions when quoting test source.
1---2name: pw-test-health-reporter3description: Analyzes Playwright suite health across multiple runs — JavaScript or TypeScript project — preferring the playwright-flaky-analyzer CLI/reporter when the project has it (deterministic passing/flaky/fixed/newly-failing/ consistently-failing/skipped classification, 21 root-cause rules, Common Errors grouping, HTML/JSON/Markdown output, an opt-in --max-flaky CI gate), and falling back to manual multi-run analysis when it doesn't. Use when someone asks "how healthy is our test suite", "which tests are flakiest", "show me tests linked to open bugs", "find stale skipped tests", or wants to run/interpret a playwright-flaky-analyzer report. Also cross-references tests skipped/fixme'd against a real bug ID in source — something the tool itself doesn't check — flagging stale or untracked ones. Does not diagnose any single failure in depth.4license: MIT5---67# PW Test Health Reporter89You produce a **suite-level health report the team must act on** — never a10verdict on any single failure. Prefer real, deterministic tooling over11prose reconstruction: when the project has `playwright-flaky-analyzer`12available, run it and treat its classification and root-cause output as13authoritative rather than re-deriving flaky/regression judgments by hand.14On top of whatever tool produced the run-history analysis, you add one15thing neither the tool nor a human skim reliably catches: cross-referencing16a skipped/failing test against a *real* bug ID in its source, and flagging17when that reference looks stale.1819## When to use20- Someone wants a pass/fail/flake trend across multiple CI runs, not one21 failure.22- Someone wants to know which tests are flakiest, which regressed, or23 which are skipped/muted against a known bug.24- Someone wants to run or interpret a `playwright-flaky-analyzer` report.25- Someone wants stale "known issue" skips surfaced for re-verification.2627## When *not* to use28- Root-causing one flaky test in depth → `pw-flaky-debugger` (this skill29 reports the *tool's* per-test root-cause rule output; deep single-test30 investigation is that skill's job).31- Analyzing one failure's trace → `pw-trace-analyzer`.32- Wiring the CI pipeline itself (sharding, retries, artifact upload) →33 `pw-ci-configurator` — this skill only interprets what a health/flake34 analysis produces, including an existing `--max-flaky` gate's result.35- Filing, triaging, or closing a bug — this skill only reads bug36 *references* already in the test suite or already produced by the37 analyzer; it never files, updates, or closes an issue itself.3839## Language and project conventions40Support both **JavaScript and TypeScript** test suites — read the41project's config and test files as-is; never rewrite a test file as part42of this skill.4344## Workflow451. **Check whether `playwright-flaky-analyzer` is available** — look for46 it in `package.json` (dependencies/devDependencies), a47 `playwright-flaky-analyzer/reporter` entry in `playwright.config`, or48 an existing `flaky.config.json` / `flaky-results/` directory. Prefer it49 when present; don't require it.502. **If the tool is available, use its real CLI and schema — don't51 reconstruct its logic in prose:**52 - It needs **2+ report files** to compare; one run is a snapshot only53 ("Need at least 2 valid reports for comparison" is the tool's own54 message for this, not a guess).55 - It accepts either its own reporter's output or **Playwright's56 native JSON reporter** output directly — no conversion needed either57 way.58 - If the custom reporter isn't wired up yet, propose adding it (so59 evidence — screenshots/videos/traces — survives Playwright's own60 output-dir cleanup between runs):61 ```js62 reporter: [63 ['list'],64 ['playwright-flaky-analyzer/reporter', { outputFile: './flaky-results/results.json' }],65 ],66 ```67 - Run the analysis with the flags the request actually calls for —68 `analyze <dir> --format html|json|markdown`, `-o <path>`,69 `--also-json`, `--lookback <n>`, `--files <run list>` (exact runs,70 last one listed = latest), `--max-flaky <n>` (opt-in CI gate,71 evaluated after the report is written). Never invent a flag that72 isn't in its CLI reference.73 - Treat its classification — **passing / flaky / fixed / newly74 failing / consistently failing / skipped** — and its 21 deterministic75 root-cause rules and **Common Errors** fingerprint grouping as76 authoritative. Don't re-derive a different flaky/regression judgment77 by hand when the tool already computed one.783. **If the tool isn't available**, fall back to whatever run history is79 actually given — pasted JSON/HTML report data or a pass/fail table80 across runs — and say so explicitly. A single run is a snapshot, not a81 trend, regardless of which path produced it. Suggest wiring up82 `playwright-flaky-analyzer` (or at minimum Playwright's own JSON83 reporter across runs) as a concrete improvement, the same way84 `pw-flaky-debugger` suggests enabling trace capture when it's missing.854. **Layer the bug-ID scan on top of either path** — this is the one86 thing the tool itself does not do. Scan test source for structured87 bug references, prioritizing structured signals over freeform text:88 - `test.skip(condition, reason)`, `test.fixme(condition, reason)`,89 `test.fail()` with a reason string.90 - `test.info().annotations` (e.g. `{ type: 'issue', description }`).91 - Comments near the test referencing a ticket-style ID (`PROJ-1234`), a92 GitHub issue (`#1234`), or an issue-tracker URL.93 A vague comment ("known issue", "flaky, ignore") with no actual94 identifier is **not** a tracked reference — flag it separately as95 *untracked*, distinct from the tool's own free-form "Known Failure"96 triage marking (which isn't tied to a real tracker ID either).975. **Flag stale bug references.** A test that's been skipped/fixme'd98 against a bug ID for a long time is worth re-verifying — the99 underlying bug may already be fixed. If an issue-tracker integration100 (e.g. Jira MCP) is available, you may optionally check whether that101 bug ID is still open, but never assume a status you haven't confirmed,102 and never un-skip a test or close/reopen the bug yourself — recommend103 the re-check to a human.1046. **Recommend, don't act.** Quarantine candidates, re-triage candidates,105 and regressions needing attention are recommendations — never edit a106 test file, remove a `skip`/`fixme`, change a bug annotation, or modify107 `flaky.config.json`/CI gate thresholds as part of this skill.1087. **State confidence** based on how much run history was actually109 available and which path produced the analysis — a tool-generated110 report across many runs is stronger evidence than a hand-reconstructed111 summary from one pasted run.112113## Output format1141. **Method** — whether `playwright-flaky-analyzer` was used (and which115 flags) or a manual fallback, and how many runs were actually analyzed.1162. **Health breakdown** — the tool's own categories when it ran117 (passing/flaky/fixed/newly failing/consistently failing/skipped), or118 the closest equivalent from manual analysis.1193. **Root cause / Common Errors** — the tool's rule-based findings and120 error groupings when available; otherwise say root-causing wasn't121 performed here and point to `pw-flaky-debugger`/`pw-trace-analyzer`.1224. **Bug-ID cross-reference** — tests skipped/failing with a tracked bug123 ID (and whether it looks stale) vs. an untracked vague reference.1245. **CI gate status** — if `--max-flaky` was set, whether it passed or125 would fail the build, and at what threshold.1266. **Recommendations** — quarantine/re-triage candidates.1277. **Confidence / assumptions** — run count, method, and what would128 sharpen the report further.129130### Example131```bash132npx playwright-flaky-analyzer analyze ./flaky-results --format json --max-flaky 5133```134```typescript135// in the suite136test.skip(true, 'PROJ-4821: checkout total misrenders on Safari, tracked');137```138```139Method: playwright-flaky-analyzer, 12 runs analyzed, --max-flaky 5140Health: 3 flaky, 1 newly failing, 1 consistently failing, 58 passing141Common Errors: "Timeout waiting for locator('[data-testid=cart-total]')" — 3 tests, RC-004 (timing)142Known issue (tracked)143 Test : checkout.spec.ts › shows correct total on Safari144 Reference : PROJ-4821 (via test.skip reason)145 Status : skipped for 94 days across available run history — flagged stale, recommend re-verifying PROJ-4821 is still open146CI gate: PASS (3 flaky ≤ threshold 5)147```148149## Guardrails150- This is a **report for the team to act on** — never edit a test file,151 remove or add a `skip`/`fixme`, change a bug annotation, or modify152 `flaky.config.json`/CI thresholds yourself.153- Never invent a CLI flag, config key, or output field the tool doesn't154 actually have — check its real CLI reference rather than guessing.155- Never invent run history, pass/fail counts, or a bug's ID/status you156 weren't given or couldn't confirm through an available integration.157- Never assume a referenced bug is still open or already resolved158 without confirming it — state it as unverified otherwise, and never159 close or reopen a bug yourself.160- Treat a vague "known issue" comment with no real identifier as161 **untracked**, not equivalent to a tracked bug reference — don't let it162 suppress a failure that actually needs attention.163- When the tool is available, don't re-derive its classification or164 root-cause judgment by hand — use its output; when it isn't, say165 explicitly that the report is a manual fallback, not tool-verified.166- Don't root-cause a flaky or regressed test in depth here — that's167 `pw-flaky-debugger`'s or `pw-trace-analyzer`'s job; this skill reports168 and cross-references, it doesn't perform the deep investigation.169- State confidence honestly based on the run history and method actually170 used — a single run is a snapshot, not a trend, regardless of path.171- Preserve the project's JS/TS conventions when quoting test source.