the-frontend-testing-skill
CLAUDE.md13 starsChanged 26 days agoMITView on GitHub
This is The Frontend Testing Skill - a Claude Code skill that orchestrates comprehensive frontend test writing and verification. It provides specialized agents, commands, and best practices documentation for testing workflows. Core Philosophy: The "Double Gate π Principle" - test planning is the first task in any workflow, test verification is the last. Testing is integrated throughout development, not separate. Explainer deck code slides: any "show the code" slide in docs/explainer-deck/ must use the EditorMock component (GitHub diff-header style ββ¦
- Installs packages
In this repository18 other files it gives its agents.
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- example-app-playwright/AGENTS.mdAGENTS.md
- example-app-vitest-browser/AGENTS.mdAGENTS.md
- example-app-playwright/CLAUDE.mdCLAUDE.md
- example-app-vitest-browser/CLAUDE.mdCLAUDE.md
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- practica-brand-designSkill
- skill-maintenanceSkill
- vercel-react-best-practicesSkill
The file
We split this CLAUDE.md into the rules it gives an agent
9 rules. About 0 are common, 6 are distinctive, and 3 are very specific to this project.
β0
Common Β· estimate
Many files like this have a rule of this kind.
β6
Distinctive Β· estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 113
Before writing tests: Must have test-plan.md (from testskill.planner)
- Very specific: line 114
Before writing tests: Must have page-analysis.md (from testskill.page-analyzer)
- Distinctive: line 115
After writing tests: Must run testskill.verifier
- Distinctive: line 128
No more than 10 statements per test
- Distinctive: line 131
Never mock internal parts - only external systems
- Distinctive: line 132
Smoking Gun Principle: Every assertion value must appear first in arrange phase
- Very specific: line 141
When installing the skill in a project, config.toml controls:
- Distinctive: line 146
Paths: Test context artifacts location
- Distinctive: line 153
Unit Testing: - Only for heavy logic with high combinatorial inputs
β βCommonβ is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md 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.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
This is The Frontend Testing Skill - a Claude Code skill that orchestrates comprehensive frontend test writing and verification. It provides specialized agents, commands, and best practices documentation for testing workflows.
Core Philosophy: The "Double Gate π Principle" - test planning is the first task in any workflow, test verification is the last. Testing is integrated throughout development, not separate.
Repository Structure
the-frontend-testing-skill/
βββ plugin/frontend-testing/ # β
SOURCE OF TRUTH β the distributable skill
β βββ agents/ # specialized agents
β βββ commands/ # slash command definitions
β βββ skills/frontend-testing/ # core docs & config (config.toml, test-workflow.md, patterns-and-practices/)
βββ example-app-playwright/ # Demo app β embeds a copy of the skill under .claude/
βββ example-app-vitest-browser/ # Demo app β embeds a copy of the skill under .claude/
βββ .claude/skills/skill-maintenance/ # Repo-maintainer skill (review, sync, sanity-test)
βββ the-testing-skill/ # DEPRECATED β ignore
βββ docs/demo/ # Presentation materialsExplainer deck code slides: any "show the code" slide in
docs/explainer-deck/ must use the EditorMock component (GitHub diff-header
style β no terminal/traffic-light chrome). See Code frame standard in
docs/explainer-deck/decks/frontend-testing-explainer/CLAUDE.md.
Source of Truth & Maintenance
- Canonical source:
plugin/frontend-testing/is what ships to users. Edit the skill here. - Example apps are targets: the two demo apps embed a copy under their
.claude/. Propagate changes with the maintenance skill, don't hand-edit copies. the-testing-skill/is deprecated β ignore it.
Small-change discipline (when editing the skill directly): keep changes small
(ideally 1β3 lines, single file), routed to exactly one correct target file
(patterns β patterns-and-practices/, workflow β test-workflow.md, config keys β
config.toml, a command's behavior β its commands/testskill.*.md). Don't mix
topics. Get user approval, then bump the version (metadata.version + VERSION).
Maintenance skill β just ask in chat (.claude/skills/skill-maintenance/):
- review β audit the skill against the agentskills.io spec, broken links, content placement, quick wins
- install local β wire one named example app to the local marketplace
- sync up β pull one named example app back to root (templates config)
- sanity test β build a feature with the skill end-to-end, verify tests, then clean up (single app, or
example-monorepoper package)
Development Commands
Example App: Playwright (example-app-playwright/)
cd example-app-playwright && pnpm install
pnpm dev # Start dev server (port 5173)
pnpm test:page # Run Playwright page tests
pnpm test:page:ui # Run Playwright tests with UI
pnpm test:unit # Run Vitest unit tests
pnpm test:storybook # Run Storybook tests
pnpm lint --fix # Fix lint errorsExample App: Vitest Browser (example-app-vitest-browser/)
cd example-app-vitest-browser && pnpm install
pnpm dev # Start dev server (port 5173)
pnpm test:browser # Run Vitest browser mode tests
pnpm test:browser:headed # Run browser tests with visible browser
pnpm test:unit # Run Vitest unit tests
pnpm lint --fix # Fix lint errorsRunning Single Tests
# Playwright (from example-app-playwright/)
pnpm test:page -g "test title pattern"
pnpm test:page path/to/test.spec.ts
# Vitest (from either example app)
pnpm test:unit -t "test title pattern"
pnpm test:browser path/to/test.browser.tsxSkill Commands (Slash Commands)
| Command | Purpose |
/testskill.write-test <page-name> | Full workflow: plan β analyze β write β verify |
/testskill.plan <page-name> | Create test plan only |
/testskill.verify <test-plan.md-path> | Verify tests after writing |
/testskill.review <test-file-path> | Review test file against best practices |
/testskill.init | Initialize skill in a project |
Agents
| Agent | Role |
testskill.planner | Creates test plans with coverage targets |
testskill.page-analyzer | Inspects live app for network calls, state, UI structure |
testskill.verifier | Runs tests, checks quality, generates reports |
testskill.healer | Debugs and fixes failing tests |
testskill.locator-fixer | Adds ARIA attributes for stable selectors |
Mandatory Workflow
VIOLATION WARNINGS will be printed if these are not followed:
- Before writing tests: Must have
test-plan.md(from testskill.planner) - Before writing tests: Must have
page-analysis.md(from testskill.page-analyzer) - After writing tests: Must run testskill.verifier
- Every task list: First task = test planning, Last task = test verification
Critical Files to Read
the-testing-skill/skills/testing/test-workflow.md- The mandatory workflow sequencethe-testing-skill/skills/testing/patterns-and-practices/the-test-anatomy.md- 6 critical rulesthe-testing-skill/skills/testing/config.toml- Configuration template
Test Writing Rules (Summary)
The 6 most critical rules from the-test-anatomy.md:
- No more than 10 statements per test
- Include only details that affect test results - no unnecessary details
- Totally flat: no if/else, loops, try-catch, console.log
- Never mock internal parts - only external systems
- Smoking Gun Principle: Every assertion value must appear first in arrange phase
- Tests are self-contained - never rely on other tests' state
Test title pattern: When {scenario}, then {expectation}
Test structure: AAA (Arrange-Act-Assert) with clear phase separation
Configuration (config.toml)
When installing the skill in a project, config.toml controls:
- Workflow enforcement:
stop_when_no_plan,stop_when_no_page_analysis,must_have_human_review_of_plan - Frameworks: vitest, vitest-browser-mode, playwright, msw
- Commands: App start/stop, test run, git staging
- Paths: Test context artifacts location
- Canonical example: Path to a reference test file in the target project
Test Types (Priority Order)
- Page Testing (Primary) - Single page scope, one meaningful user action per test
- Component Testing - Reusable components and design system libraries
- Unit Testing - Only for heavy logic with high combinatorial inputs
Test only external outcomes: UI changes users notice, API mutations, storage changes. Never test implementation details.
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.

