agentleFS
smooth-deploysmooth-deploy/playwright-skills/skills/e2e-prune/SKILL.md

e2e-prune

Skill0 starsChanged 23 days agoMITView on GitHub

Review a Playwright suite and propose which tests to drop and which steps to trim, with one reason per finding. Use when a suite has grown faster than anyone can read it, when asked which tests are noise, duplicates or theater, or before a maintenance pass. Proposes only; changes no test and no app file. One spec checked against its ticket goes to e2e-assess, and a test that fails goes to e2e-triage.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    wrong-scope: not an end-to-end check. Arithmetic on constants, a unit test of a helper, a pixel or CSS-value check, a test with no page …

    line 20
  2. Very specific:

    If the Playwright config does not load .env.e2e, load it into the shell first (set -a.

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

e2e-prune

Input: a suite directory (tests/, e2e/) and the environment file .e2e/e2e-env.md, called ENV below. No .e2e/e2e-env.md in the repo: run the e2e-setup skill first. Output: a report that names every test to drop, every step to trim, and the reason. Nothing is edited: deletion is the team's call, the skill supplies the evidence.

A test earns its place by failing when the user-visible behaviour it names breaks. Everything else is cost: minutes per run, a line in every failure report, a thing to update when the page changes.

Classes

Each dropped test gets exactly one class, the strongest that applies:

  • no-assert: no expect on anything a user sees. goto then waitFor, toHaveURL alone, a page toBeVisible. It is green against an empty page. Catches nothing.
  • duplicate: asserts the same user-visible outcome as another test, through the same flow. Different title, different locators, same facts checked. One copy stays: the one that asserts more (a subset is the copy to drop); on equal assertions, the shorter one with the more durable locators. Overlap alone is not duplication: two tests that share setup steps but check different outcomes both stay, since a suite is run in parts.
  • implementation-coupled: asserts how the page is built, not what it shows. CSS classes, element ids, DOM structure (div > span), API response shape, request payloads, data attributes other than the test ids ENV names as stable. Breaks on a refactor that changes nothing for the user. Where it also checks a user outcome, the test may be worth rewriting instead of dropping; say so.
  • wrong-scope: not an end-to-end check. Arithmetic on constants, a unit test of a helper, a pixel or CSS-value check, a test with no page interaction. Right thing, wrong layer.

trim is for tests that stay: steps that prove nothing the test is about. Title checks, a reload with no state to re-read, a detour to a page the test never asserts on, the same assertion repeated after an action that could not change it, a reset (per ENV) when nothing was changed. Name the step, keep the test.

1. Run the suite once

If the Playwright config does not load .env.e2e, load it into the shell first (set -a; . ./.env.e2e; set +a).

npx playwright test --reporter=line

A failing test gets reported as failing, not classified: triage comes first (the e2e-triage skill). Note runtime per test; a drop saves that time on every run.

2. Read every test

For each test write down: title, pages visited, outcomes asserted (what the user would see), locator style. Two tests with the same outcomes list are duplicate candidates; a test with an empty outcomes list is no-assert or wrong-scope; a test whose assertions name markup is coupled. Steps that add nothing to the outcomes list are trim candidates.

Reading the test is enough for the verdict. Open the page with playwright-cli only when a locator's meaning is unclear (does .badge carry the status the user reads, or decoration?).

3. Report

Summary line, then one line per finding, nothing else per finding:

Suite: 10 tests, 4 files, 14.2s. Proposed: drop 7, trim 1, keep 2.

- drop checkout page opens: no-assert: only toHaveURL after goto, green on an empty page
- drop shipping fee drops to zero once the cart passes $100: duplicate: same amounts on /cart as "socks alone pay $5.99 shipping..." (shipping.spec.ts:3), keep that one
- drop product grid renders eight cards with price tags: implementation-coupled: asserts article.card.product and span.price classes
- drop shipping and tax math: wrong-scope: arithmetic on constants, never opens a page
- trim guest cart survives sign-in and is gone after sign-out: toHaveTitle twice, reload on /, empty-cart check before anything is added: none bear on the merge

Title is the exact test title. Class is one of the four. Reason names the evidence from the test body. A keep needs no line.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.