write-tests
Skill316 starsChanged 5 months agoMITView on GitHub
Use when asked to add or extend automated tests — e.g. "write test", "add test", "cover X with tests", "reproduce with a test", "test this", "e2e test", "playwright test". Covers Vitest (apps/ui, apps/strapi) and Playwright (qa/tests/playwright: e2e, visual, axe, seo).
80 other projects use a version of this.
Adopted by
Most recently taken up by
- crsmithdev/alephtheir own version, first seen Nov 16, 2026
- kishormorol/promptaliastheir own version, first seen Nov 16, 2026
- dzhng/skillstheir own version, first seen Nov 15, 2026
- Kuan-AI-com/agent-skillstheir own version, first seen Nov 15, 2026
- qivora-labs/agentinittheir own version, first seen Nov 15, 2026
- todoist/todoist-clitheir own version, first seen Nov 15, 2026
Used with
Projects with it also use close-spec, design-with-images and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 5 projects that use this
dzhngSkilldesign-with-images
Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.
Also in 5 projects that use this
transitive-bullshitSkillcompare-screenshots
Compare screenshots against the intended design, distinguishing approved references from historical baselines. Use for iterative implementation matching, before/after visual review, objective image telemetry, or checking a lone capture for flat, empty, or badly framed content.
Also in 5 projects that use this
LucasMatuszewskiSkillaudit-agents
Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.
Also in 5 projects that use this
wolverin0Skillaudit-decisions
Standardize remediation decisions, baseline-policy entries, and legal-review banners for accepted, deferred, or policy-blocked audit findings.
Also in 4 projects that use this
rhnfzlSkillexplore-unknowns
Walk the user through mapping the unknowns of a task before, during, and after they build it, and hand them a four-quadrant map (settled ground, open decisions, taste, and landmines) they keep. Reach for this eagerly whenever a request is ambiguous or underspecified, the codebase or domain is unfamiliar, the user will "know it when they see it", a reference implementation must be understood before porting, a build-queue or architecture-changing task is about to start, a mid-build deviation needs capturing, or a finished change needs buy-in or verified understanding before merge. Trigger even when the skill is not named: "do a blindspot pass", "find my unknown unknowns", "interview me about this change", "brainstorm the approach for a task I am about to build", "help me scope this", "what am I missing here", "plan this before I build", "I know nothing about X in this codebase". When a territory profile is present it reads memory and the graph first and feeds the map into the build pipeline; without one it degrades to a plain general map. Not for trivial or mechanical tasks with clear acceptance criteria, single-fact lookups, pure debugging of a known symptom, or pure code review, those have their own tools. Do not use it to run the build itself; the map is the deliverable and implementation remains a separate task, whether it has not started or is already underway.
Also in 5 projects that use this
- +5 more from dzhng
Other versions80 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 80
- remix-run/remix★ 33ksame name
- elie222/inbox-zero★ 13ksame name
- getsentry/sentry-javascript★ 8.8ksame name
- dzhng/jevgrep★ 3.2ksame name
- meta-pytorch/OpenEnv★ 2.9ksame name
- huggingface/OpenEnv★ 2.9ksame name
- JamieMason/syncpack★ 2.1ksame name
- clice-io/clice★ 1.7ksame name
- dzhng/skills★ 1.5ksame name
- ryokun6/ryos★ 1.3ksame name
70 more not listed
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 repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-content-typeSkill
- add-localeSkill
- add-ui-componentSkill
- consolidate-patternsSkill
- copy-componentSkill
- create-content-componentSkill
- find-componentSkill
- find-skillsSkill
- frontend-designSkill
- make-prSkill
- next-best-practicesSkill
- remove-azure-monitorSkill
- remove-cache-revalidationSkill
- remove-cdn-purgeSkill
- remove-sentrySkill
- resolve-review-suggestionsSkill
- review-prSkill
- seed-contentSkill
- start-workSkill
- strapi-schema-checkSkill
- validate-branch-refsSkill
- vercel-react-best-practicesSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. 0 are common, 9 are distinctive, and 5 are very specific to this project.
0
Common
Most of the 75 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Add or extend tests using the starter's existing conventions.
- Distinctive: line 35
Before writing, read one existing test in the same layer to mirror style:
- Very specific: line 51
Import from vitest: describe, it, expect, beforeAll, afterAll.
- Very specific: line 55
Strapi tests do not boot Strapi: Import the unit under test directly and either keep it pure, read schema.json from disk (app.test.ts), or …
- Very specific: line 59
Import from @playwright/test: test, expect.
- Very specific: line 60
Use test.describe for grouping.
- Distinctive: line 64
Do not hardcode ports — rely on config.
- Very specific: line 71
No console.log left behind.
- Distinctive: line 76
Run only the relevant package, not the whole monorepo, while iterating.
- Distinctive: line 96
Run the new test — it must pass.
- Distinctive: line 97
Run the file's full suite — no regressions.
- Distinctive: line 98
If reproducing a bug: first confirm the test fails without the fix, then apply the fix, then confirm it passes.
- Distinctive: line 115
Do not add new dev dependencies for testing without explicit user request.
- Distinctive: line 116
Do not introduce Jest, Mocha, Cypress, or other competing frameworks.
“Common” is measured: kept by at least 6 in 10 of the 75 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
Write Tests
Add or extend tests using the starter's existing conventions. Do not introduce new test frameworks. Do not invent new helpers when an existing one fits.
Reference: apps/docs/docs/reference/testing/overview.md (layers), unit-testing.md (Vitest), playwright.md (browser QA).
Decide the test layer first
Pick before writing. Wrong layer = wasted test.
| Goal | Layer | Where |
| Pure function / utility / hook (no network, no DOM) | Vitest unit (apps/ui) | *.test.ts next to source (apps/ui/src/**/*.test.ts) |
| Strapi service / util / schema / middleware behaviour | Vitest (apps/strapi) | apps/strapi/tests/**/*.test.ts |
| Full browser flow, navigation, user interaction | Playwright e2e | qa/tests/playwright/e2e/*.spec.ts |
| Visual regression | Playwright visual | qa/tests/playwright/visual/*.spec.ts |
| Accessibility | Playwright axe | qa/tests/playwright/axe/*.spec.ts |
| SEO meta, head, robots | Playwright seo | qa/tests/playwright/seo/*.spec.ts |
Unit > integration > e2e. Push tests down the pyramid when behavior allows.
Phase 1 — Locate convention
Before writing, read one existing test in the same layer to mirror style:
- UI unit ref:
apps/ui/src/lib/dates.test.ts - Strapi pure-logic ref:
apps/strapi/tests/hierarchy-compute.test.ts - Strapi schema-from-disk ref:
apps/strapi/tests/app.test.ts(readsschema.jsondirectly — no Strapi boot) - Strapi service-with-mocked-
strapi-global ref:apps/strapi/tests/revalidate.test.ts(vi.stubGlobal("strapi", …)) - Playwright e2e ref:
qa/tests/playwright/e2e/test_example.spec.ts - Playwright visual ref:
qa/tests/playwright/visual/visual.spec.ts - Playwright axe ref:
qa/tests/playwright/axe/axe.spec.ts
Match imports, helper usage, describe/it nesting, naming.
Phase 2 — Write the test
Vitest (UI + Strapi)
- Import from
vitest:describe,it,expect,beforeAll,afterAll. globals: truealready set — but still import explicitly (matches existing code).- File pattern:
*.test.ts. UI include:src/**/*.test.ts. Strapi include:tests/**/*.test.ts. - Path alias
@resolves toapps/ui/src(UI tests only). - Strapi tests do not boot Strapi. Import the unit under test directly and either keep it pure, read
schema.jsonfrom disk (app.test.ts), or mock thestrapiglobal withvi.stubGlobal("strapi", …)(revalidate.test.ts). There is nosetupStrapihelper — do not add a DB or a real instance.
Playwright
- Import from
@playwright/test:test,expect. - Use
test.describefor grouping. page.goto("/")— baseURL configured inplaywright.config.ts.- For visual:
await expect(page).toHaveScreenshot(). Update snapshots only when intentional viapnpm tests:playwright:visual:update. - For axe: import existing axe helper if present (read
axe.spec.tsfirst). - Do not hardcode ports — rely on config.
Phase 3 — Naming + structure
- One
describeper unit-under-test (function, component, route). - One
itper behavior. Behavior phrased as outcome:it("returns null when input is empty"), notit("test 1"). - AAA: arrange, act, assert. Separate with a blank line if it aids reading.
- No console.log left behind. No
.only/.skipcommitted. - Strapi tests mock the
strapiglobal where needed (vi.stubGlobal); they never connect to a real database.
Phase 4 — Run
Run only the relevant package, not the whole monorepo, while iterating.
| Test | Command |
| UI unit (all) | pnpm test:ui |
| Strapi unit (all) | pnpm test:strapi |
| Single Vitest file | pnpm --filter @repo/ui exec vitest run <path> (or @repo/strapi) |
| Vitest watch | pnpm --filter @repo/ui test:watch |
| Playwright e2e | pnpm tests:playwright:e2e:test |
| Playwright e2e interactive | pnpm tests:playwright:e2e:test:interactive |
| Playwright visual | pnpm tests:playwright:visual |
| Playwright axe | pnpm tests:playwright:axe |
| Playwright seo | pnpm tests:playwright:seo |
| Update visual snapshots | pnpm tests:playwright:visual:update |
| All workspace tests | pnpm test |
Playwright requires a running app (pnpm dev or built+started). If e2e fails with connection refused, start the app first.
Phase 5 — Verify before reporting done
- Run the new test — it must pass.
- Run the file's full suite — no regressions.
- If reproducing a bug: first confirm the test fails without the fix, then apply the fix, then confirm it passes. Do not skip the failing step.
- Snapshot updates: never update without inspecting the diff visually.
Report
Print:
Tests added: <n>
Files: <paths>
Layer: vitest-ui | vitest-strapi | playwright-e2e | playwright-visual | playwright-axe | playwright-seo
Result: pass
Command: <exact command to re-run>Notes
- Do not add new dev dependencies for testing without explicit user request.
- Do not introduce Jest, Mocha, Cypress, or other competing frameworks.
- Coverage reports configured in
vitest.config.ts— don't reconfigure per-test. - Strapi tests run in a
nodeenvironment without booting Strapi — keep them fast and focused; isolate logic so it's testable without a running instance. - Playwright
MOBILE_VIEWPORTS_TESTING_ENABLED=trueenv var opts in mobile projects (seeplaywright.config.ts). - Visual snapshots are platform-sensitive — generated on macOS may diff on CI. Note in PR if you regenerated locally.
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.

