frontend-testing
Skill5 starsChanged 4 months agoMITView on GitHub
Scaffold and advise on frontend testing for production readiness, mapped to the Front-End-Checklist Testing category (13 rules). Defines a testing pyramid (unit, integration, E2E, visual, a11y, cross-browser, real-device, perf-budget, mutation, error-monitoring, coverage, mocking, contract) and emits copy-pasteable configs: Playwright config + smoke specs, axe a11y (jest-axe / @axe-core/playwright), Pact contract tests, and a GitHub Actions perf-budget + coverage CI. Use when the user asks for 'frontend testing', 'test strategy', 'e2e', 'visual regression', 'playwright setup', 'playwright test', 'unit test', 'integration test', 'write tests', 'test generation', 'test coverage', 'regression test', 'perf budget CI', 'accessibility testing in CI', 'contract testing', 'mutation testing', 'настрой тесты фронта', or wants tests before a release. Scaffolds & advises only — does not run your full CI; you wire the configs in. Composes with frontend-perfection, frontend-a11y, frontend-performance, /frontend.
- Installs packages
8 other projects use a version of this.
Adopted by
Most recently taken up by
- langgenius/difytheir own version, first seen Nov 24, 2026
- theexperiencecompany/gaiatheir own version, first seen Sep 17, 2026
- factor241/ketos-bottheir own version, first seen Sep 3, 2026
- peakdong68/my-skillstheir own version, first seen Aug 29, 2026
- lobomfz/skillstheir own version, first seen Apr 28, 2026
- LiuRoi/skillstheir own version, first seen Mar 24, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- langgenius/dify★ 162ksame name
- theexperiencecompany/gaia★ 306same name
- nilecui/SkillsBase★ 27same name
- aboio-labs/aboio-skills★ 2same name
- lobomfz/skills★ 2same name
- factor241/ketos-bot★ 1same name
- LiuRoi/skills★ 1same name
- peakdong68/my-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository59 other files it gives its agents.
- skills/chronos/references/AGENTS.mdAGENTS.md
- api-contract-testingSkill
- api-doc-generatorSkill
- canonSkill
- censorSkill
- changelog-generatorSkill
- chronosSkill
- code-reviewSkill
- commit-lintSkill
- commit-message-writerSkill
- coverage-analyzerSkill
- csv-proSkill
- data-analysisSkill
- deweySkill
- diagram-makerSkill
- doc-compareSkill
- docs-productSkill
- docs-projectSkill
- docs-systemSkill
- dsh-runnerSkill
- frontend-a11ySkill
- frontend-design-tasteSkill
- frontend-perfectionSkill
- frontend-performanceSkill
- github-repo-hygieneSkill
- long-running-agent-workflowSkill
- mermaid-to-imageSkill
- mobile-frontendSkill
- pdf-report-builderSkill
- plan-skillSkill
- prd-to-appSkill
- presentation-craftSkill
- presentation-engineeringSkill
- presentation-makerSkill
- raster-to-svgSkill
- reddit-karmaSkill
- repo-community-filesSkill
- repo-metadata-healthSkill
- repo-readme-assetsSkill
- repo-social-previewSkill
- secret-scannerSkill
- security-reviewSkill
- seo-auditSkill
- seo-contentSkill
- seo-crawlSkill
- seo-schemaSkill
- seo-toolkitSkill
- skill-feedbackSkill
- skill-forgeSkill
- skill-suggesterSkill
- sql-helperSkill
- systematic-debuggerSkill
- test-generatorSkill
- test-graphicsSkill
- velesSkill
- version-bumperSkill
- video-script-writerSkill
- web-replicationSkill
- web-scraperSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 3 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 81
Don't E2E a pure function.
- Very specific: line 98
Do NOT reimplement perf/security/a11y audits here — point to the siblings.
- Very specific: line 102
Decide the layers you need: Start from the pyramid; for a typical SPA: unit (Vitest) + integration (Vitest + MSW) + E2E (Playwright) + a11y …
- Distinctive: line 173
When you deliver a testing scaffold, write a short report:
- Very specific: line 190
Do NOT reimplement performance/security/a11y *audits* — delegate to the sibling skills.
- Distinctive: line 192
No external Front-End-Checklist MCP dependency.
- Very specific: line 207
Do not use to audit an already-built site.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
frontend-testing
Define and scaffold frontend testing for production readiness. Our other
frontend skills (frontend-perfection, frontend-a11y, frontend-performance)
audit a built site; they run ZERO tests. This skill closes that gap: it tells
you what to test, which layer owns each concern, and hands you the config
to wire into CI. It is a process/knowledge + scaffolding skill, not a runtime
audit.
The 13 Testing rules → pyramid layer
Mapped 1:1 from the Front-End-Checklist "Testing" category. Each rule names the layer it belongs to and the reference file that scaffolds it.
| # | Rule (verbatim priority) | Layer | Scaffold |
| 1 | Write unit tests [High] | Unit | your unit runner (Vitest/Jest) |
| 2 | Write integration tests for key workflows [High] | Integration | your runner + MSW |
| 3 | Implement end-to-end testing [High] | E2E | references/playwright.config.ts, references/e2e-smoke.spec.ts |
| 4 | Use visual regression testing [Medium] | Visual | references/visual-regression.md |
| 5 | Include accessibility testing [High] | A11y | references/a11y-test.md |
| 6 | Test across all major browsers [High] | Cross-browser | references/playwright.config.ts (projects) |
| 7 | Test on real mobile devices and viewports [High] | Real-device | references/playwright.config.ts (Mobile projects) |
| 8 | Enforce performance budgets in CI [Medium] | Perf-budget | references/ci-perf-budget.yml |
| 9 | Use mutation testing to measure how well tests detect bugs [Medium] | Mutation | Stryker config note |
| 10 | Integrate real-time error monitoring in production [High] | Error-monitoring | Sentry note |
| 11 | Maintain test coverage thresholds [Medium] | Coverage | references/ci-perf-budget.yml (coverage gate) |
| 12 | Follow mocking best practices [Medium] | Mocking | mocking note |
| 13 | Implement consumer-driven contract testing for API boundaries [Medium] | Contract | references/contract-test.md |
Testing pyramid (shape, not just a list)
/\ E2E (few, critical journeys only) → Playwright / Cypress
/ \ Visual regression (key screens) → snapshot diff
/----\ Cross-browser + real-device → Playwright projects
/ \ A11y (axe in CI) → jest-axe / @axe-core/playwright
/--------\ Integration (key workflows) → Vitest/Jest + MSW
/ \ Unit (critical logic, many) → Vitest/Jest
/____________\ Contract (API boundaries) → Pact- Unit is the base: fast, many, no browser. Cover critical functionality only — not every getter.
- Integration exercises units wired together (form + validation + state, or API route + query). Mock the network boundary with MSW, not the unit under test.
- E2E covers only the 3–7 journeys that, if broken, are a sev-1 (login, checkout, signup, core nav). Everything else is waste.
- Visual / a11y / cross-browser / real-device ride on the E2E run — same browser, extra assertions. Don't stand them up as separate suites.
- Contract guards the frontend↔backend API boundary so a backend change can't silently break the UI.
Decision guide: which test for which job
| Symptom / question | Reach for | Why |
| "Is this pure function correct?" | Unit | Fastest feedback, no flake |
| "Do these modules cooperate?" | Integration | Catches wiring bugs units miss |
| "Can a real user complete the flow?" | E2E (Playwright) | Only layer that proves the journey |
| "Did the layout shift unexpectedly?" | Visual regression | Pixel diff beats eyeballs |
| "Is it usable by AT users?" | A11y (axe) | Automated WCAG subset in CI |
| "Does it work in Firefox/Safari/Edge?" | Cross-browser projects | Engine differences are real |
| "Does it break on a phone?" | Real-device / mobile emulation | Touch + viewport bugs |
| "Did a backend change break the UI?" | Contract (Pact) | Fails before prod |
| "Will my tests actually catch bugs?" | Mutation (Stryker) | Coverage % lies; mutations don't |
| "Is it fast enough to ship?" | Perf budget in CI | Fails build on regression |
| "What blew up in prod?" | Error monitoring (Sentry) | Post-deploy truth |
Rule of thumb: write the cheapest test that can fail for the right reason. Don't E2E a pure function; don't unit-test a user journey.
Composition with sibling skills
frontend-perfection— audits a built site (Lighthouse, contrast, tokens, a11y subset). This skill adds the test suite that prevents regressions the audit would otherwise catch late. Scaffold tests here first, then runfrontend-perfectionto verify the result stays green.frontend-a11y— deep accessibility. This skill'sreferences/a11y-test.mdis the CI gate (axe in the pipeline);frontend-a11yis the manual/expert pass. They share axe-core; don't duplicate the audit — wire the gate.frontend-performance— measures field/lab perf. This skill'sreferences/ci-perf-budget.ymlfails the build when budgets slip;frontend-performancetells you why and how to fix./frontend— orchestrator. Routes the testing/QA domain to this skill during a build or pre-release handoff.
Do NOT reimplement perf/security/a11y audits here — point to the siblings.
How to scaffold (workflow)
- Decide the layers you need. Start from the pyramid; for a typical SPA: unit (Vitest) + integration (Vitest + MSW) + E2E (Playwright) + a11y gate + perf budget in CI. Add visual/contract/mutation when the cost is justified.
Scaffold the configs into the project with the bundled script — it copies the reference files deterministically and prints exactly what it wrote, so the run is evidence (a config that was never placed is a draft, not a scaffold):
python3 scripts/scaffold.py --target /path/to/project --layers playwright,e2e,a11y,ci # expected: one "copied references/<file> -> <dest>" line per layer; # "Scaffolded N file(s) into <target>"; exit 0 # exit 2 if --target does not exist; exit 1 if a source is missingThe script maps each layer to its reference file and destination (the reference files stay the source of truth if you prefer to place them by hand):
playwright→references/playwright.config.ts→playwright.config.tse2e→references/e2e-smoke.spec.ts→e2e/e2e-smoke.spec.tsa11y→references/a11y-test.md→e2e/a11y-test.mdvisual→references/visual-regression.md→e2e/visual-regression.mdci→references/ci-perf-budget.yml→.github/workflows/perf-budget.ymlcontract→references/contract-test.md→tests/contract/contract-test.md
Copy only the layers you need; pass
--layersto pick them.- Install only what you use. Baseline (E2E + a11y + unit):
npm i -D @playwright/test @axe-core/playwright vitest @vitest/coverage-v8 msw npx playwright install --with-deps chromium firefox webkit - Wire the CI gate (perf budget + coverage) from
references/ci-perf-budget.yml. - Run locally to prove the scaffold is green (evidence gate below) before handing configs back.
Evidence gates (show the command, show the expected shape)
You must be able to demonstrate the scaffold runs, not just that files exist.
Unit / integration (Vitest):
npx vitest run --coverage
# expected: ✓ N passed; coverage summary; exit 0 when ≥ thresholdE2E (Playwright):
npx playwright test --project=chromium
# expected: Running 6 tests using 1 worker; N passed; exit 0
# on failure: trace + screenshot retained (see config use:)A11y gate (axe in Playwright):
npx playwright test e2e/a11y.spec.ts
# expected: no violations; exit 0. On violation: list of axe rule ids + nodesMutation (Stryker) — critical logic only:
npx stryker run
# expected: Mutation score ≥ your threshold (e.g. 80%); report shows killed/survivedPerf budget (CI only, but locally reproducible):
npx lhci autorun --collect.url=http://localhost:3000
# expected: all budgets met; exit 0. Breach → non-zero exit fails the buildReport the exact command you ran, the real output (or its shape), and the exit code. A config that has never been executed is not "scaffolded" — it's a draft.
Engagement / before-after report convention
When you deliver a testing scaffold, write a short report:
- Input: repo path, framework detected, which layers were missing.
- Added: list of files created (with paths) and the layers they cover.
- Commands: the exact commands to run each layer locally.
- CI: what the workflow enforces (budgets, coverage threshold, browsers).
- Expected: pass/fail shape per layer (from evidence gate).
- Not done (non-goals): we did not run your full CI, did not pick a backend provider for Pact, did not tune every threshold — those are the user's calls.
- Next: which sibling skill to run next (perf / a11y / perfection).
Constraints / non-goals
- This skill scaffolds & advises. It does NOT run the user's full CI, deploy, or stand up their backend provider. It produces configs they wire in.
- Framework-agnostic where possible: the Playwright example is the reference implementation; unit/integration snippets adapt to Vitest/Jest/Mocha.
- Do NOT reimplement performance/security/a11y audits — delegate to the sibling skills. This skill owns the testing/QA domain only.
- No external Front-End-Checklist MCP dependency; the 13 rules are inlined above.
- Thresholds (coverage %, mutation score, Lighthouse numbers) are placeholders — set them with the user; don't ship arbitrary numbers as policy.
References index
references/playwright.config.ts— multi-project config (devices, baseURL, trace).references/e2e-smoke.spec.ts— critical-journey E2E example.references/visual-regression.md— screenshot-diff approach + tooling.references/a11y-test.md— jest-axe and @axe-core/playwright snippets.references/ci-perf-budget.yml— GitHub Actions perf budget + coverage gate.references/contract-test.md— Pact consumer-driven contract example.
Boundaries
- Do not use to audit an already-built site; use
frontend-perfection,frontend-a11y, orfrontend-performance.
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
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.

