testing-standards
Skill1 starsChanged 5 months agoMITView on GitHub
Use this skill when the user invokes /testing-standards, asks about the project's testing approach, asks how to write tests, asks what tests to write for a feature, or needs a reminder of TDD workflow. Also trigger when the user says "write tests first", "what tests do I need", "set up testing", or "add tests for X". This skill defines the canonical testing philosophy, tooling, file conventions, and Claude's own rules for writing tests. Do NOT invoke for a project with no test runner configured — fill in the "Before first use" section below first.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- DaveSkender/Stock.Indicatorstheir own version, first seen Oct 8, 2026
- alibaba/loongcollectortheir own version, first seen Oct 8, 2026
- zenghur/skillstheir own version, first seen Apr 11, 2026
- maxyeh0817/Forgetheir own version, first seen Feb 25, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- alibaba/loongcollector★ 2.2ksame name
- DaveSkender/Stock.Indicators★ 1.3ksame name
- maxyeh0817/Forge★ 34same name
- zenghur/skills★ 1same 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 repository28 other files it gives its agents.
- advanced-prd-writerSkill
- calendar-reviewSkill
- challenge-before-buildSkill
- claude-build-hardeningSkill
- claude-memorySkill
- claude-product-demo-videoSkill
- codex-imagegenSkill
- codexSkill
- coding-craftSkill
- computer-controlSkill
- context-disciplineSkill
- disk-cleanupSkill
- image-generation-craftSkill
- infinite-working-skillSkill
- intelligent-delegationSkill
- linkedin-post-writerSkill
- okr-structuringSkill
- operator-standardSkill
- posthog-design-customizationSkill
- self-performance-reviewSkill
- session-namerSkill
- session-recallSkill
- skill-hardeningSkill
- slack-statusSkill
- slack-writerSkill
- subagent-briefSkill
- verification-gatesSkill
- writing-craftSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 14 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈14
Distinctive · estimate
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
- could be automatic: a setting could enforce it
- Distinctive: line 31
All new features must follow TDD.
- Distinctive: line 34
Before writing any feature code, write tests covering all expected flows and edge cases
- Distinctive: line 35
Run the tests — they should all fail (this confirms the tests are real and wired up correctly)
- Distinctive: line 37
Never mark a feature done until all tests are green
- Distinctive: line 46
Test individual functions, components, hooks, and API handlers in isolation
- Distinctive: line 52
Test complete user flows through the real browser (no mocks for the critical path)
- Distinctive: line 65
Run through the app in a headless browser and capture screenshots at every meaningful state
- Distinctive: line 112
Write the test file first
- Distinctive: line 114
Run tests, confirm they fail, then start implementing
- Distinctive: line 115
Keep building until all tests pass before moving on
- Very specific: line 118
Run npm run test:all before starting
- Distinctive: line 119
Run again after every meaningful change
- Distinctive: line 120
If any test fails that wasn't failing before: fix it immediately, don't continue building
- Very specific: line 123
Add screenshot captures for all relevant states in e2e/visual.spec.ts
- Very specific: line 124
Run npm run test:e2e and review the new screenshots before proceeding
- Distinctive: line 127
If tests are failing and you can't immediately fix them, stop and explain why before continuing
- Very specific: line 134
Keep realistic test fixtures in tests/fixtures/.
- Distinctive: line 140
When you *intentionally* change the UI (new design, refactor), update baselines explicitly:
≈ “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.
Files
Testing Standards
Before first use
Fill in the following for the project before relying on this skill:
- Test runner: [e.g. Vitest, Jest, Pytest — replace the placeholder in § Test Suites below]
- Unit test command: [e.g.
npm run test] - E2E test command: [e.g.
npm run test:e2e] - Full suite command: [e.g.
npm run test:all] - Key user flows to cover: [list the primary E2E journeys specific to this project]
Until these are filled in, this skill is a template, not a working standard.
Failure modes
| Situation | What to do |
| Broken suite on arrival | Run the full suite first. Fix or flag every pre-existing failure before writing new tests — never add tests on top of a red suite. |
| Missing runner | If no test runner is configured for the project, stop. Tell the user to install and configure one, then fill in "Before first use" above. Do not invent or assume a runner. |
| CI-only tests | If tests are configured to run only in CI (no local runner), say so explicitly. Do not claim local verification has passed — it hasn't. |
Philosophy: Test-Driven Development
All new features must follow TDD. No exceptions.
The workflow:
- Before writing any feature code, write tests covering all expected flows and edge cases
- Run the tests — they should all fail (this confirms the tests are real and wired up correctly)
- Build the feature incrementally until every test passes
- Never mark a feature done until all tests are green
This catches edge cases early, prevents regressions, and gives future changes a safety net.
Test Suites
1. Unit / Integration Tests
- Test individual functions, components, hooks, and API handlers in isolation
- Cover: happy path, edge cases, error states, boundary values
- Tool: [Vitest / Jest — pick one and note it here]
- Location:
__tests__/alongside source files, or*.test.tsco-located
2. End-to-End Tests
- Test complete user flows through the real browser (no mocks for the critical path)
- Cover: every major user journey from entry point to completion
- Tool: Playwright
- Location:
e2e/
Flows to cover (update this list as the app grows):
- User can sign up and land on dashboard
- User can [core action #1]
- User can [core action #2]
- Error states show correctly (network failure, 404, validation)
- Auth gates redirect unauthenticated users
3. UI Regression / Screenshot Tests
- Run through the app in a headless browser and capture screenshots at every meaningful state
- Compare against baseline images; flag any pixel diffs
- Tool: Playwright (built-in screenshot + visual comparison)
- Location:
e2e/screenshots/for baselines,e2e/screenshots/diff/for failures
States to capture for every major screen:
- Empty state (no data)
- Loaded state (with realistic test data)
- Error state
- Loading/skeleton state (if applicable)
- Mobile viewport (375px)
- Dark mode (if supported)
To review all screenshots at once:
open e2e/screenshots/
# or
npx playwright show-reportThis gives a quick visual skim of the entire app across all states — useful before any major merge.
Running Tests
# Unit tests
npm run test
# Unit tests in watch mode (during development)
npm run test:watch
# E2E + screenshots (headless)
npm run test:e2e
# Update screenshot baselines (after intentional UI changes)
npm run test:e2e -- --update-snapshots
# Full suite (run before every commit)
npm run test:allRules for Claude When Writing Code
- Writing a new feature?
- Write the test file first
- Include: happy path, at least two edge cases, one error state
- Run tests, confirm they fail, then start implementing
- Keep building until all tests pass before moving on
- Modifying existing code?
- Run
npm run test:allbefore starting - Run again after every meaningful change
- If any test fails that wasn't failing before: fix it immediately, don't continue building
- Run
- Adding a new screen or major UI component?
- Add screenshot captures for all relevant states in
e2e/visual.spec.ts - Run
npm run test:e2eand review the new screenshots before proceeding
- Add screenshot captures for all relevant states in
- Never leave a test suite in a broken state.
- If tests are failing and you can't immediately fix them, stop and explain why before continuing
- A green test suite is a prerequisite for any new work
Test Data
Keep realistic test fixtures in tests/fixtures/. Use these consistently across unit, E2E, and screenshot tests so results are reproducible and comparable.
Screenshot Baseline Updates
When you intentionally change the UI (new design, refactor), update baselines explicitly:
npm run test:e2e -- --update-snapshotsThen commit the updated PNGs alongside the code change. Reviewers can visually diff the screenshots in the PR to confirm the change looks right.
Sync home
Sync home: canonical = your live private copy; public sanitized twin: ~/code/skills/testing-standards → github.com/justinwilliames/skills. Sanitization is a sync step.
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.

