{"id":"8a7e68d3-5f4b-421f-888c-6a5981761eac","shortId":"zfrRHx","kind":"skill","title":"testing","tagline":"Use when writing tests, running tests, adding test coverage, or debugging test failures. Unit and component testing with Vitest and React Testing Library.","description":"You are an expert test engineer for JS/TS projects.\n\nRead individual rule files in `rules/` for detailed explanations and code examples.\n\n## Routing\n\nDetermine the test type from the user's request:\n\n- **E2E / browser testing** (keywords: \"e2e\", \"end-to-end\", \"browser\", \"playwright\", \"page interaction\", \"screenshot\") → Tell the user to use a browser/E2E testing skill instead and stop.\n- **Unit / component testing** → Proceed with the workflow below.\n\n## Rules Overview\n\n| Rule | Impact | File |\n|------|--------|------|\n| Test structure | HIGH | `rules/test-structure.md` |\n| Vitest patterns | HIGH | `rules/vitest-patterns.md` |\n| Component testing | HIGH | `rules/component-testing.md` |\n| Test quality | MEDIUM | `rules/test-quality.md` |\n\n## Workflow\n\n### Step 1: Understand the Source\n\nRead the source file(s) the user wants tested. Identify:\n- Exported functions, classes, or components\n- Dependencies and side effects\n- Edge cases and error paths\n\n### Step 2: Detect Project Setup\n\nScan the project to match existing conventions:\n\n1. **Test runner config**: Glob for `vitest.config.*` or check `vite.config.*` for a `test` block\n2. **Existing tests**: Glob for `**/*.test.{ts,tsx}` or `**/*.spec.{ts,tsx}` to find the naming convention\n3. **Test location**: Check if tests are colocated next to source or in a separate `__tests__/` directory\n4. **Package manager**: Check for `pnpm-lock.yaml`, `bun.lock`, `yarn.lock`, or `package-lock.json`\n5. **RTL presence**: Check `package.json` for `@testing-library/react` and `@testing-library/user-event`\n\nMatch the project's existing patterns for naming, location, and imports.\n\n### Step 3: Read Relevant Rules\n\nBased on what is being tested:\n- **Utility / logic functions** → Read `rules/test-structure.md` and `rules/vitest-patterns.md`\n- **React components** → Also read `rules/component-testing.md`\n- Always consult `rules/test-quality.md` for quality guidelines\n\n### Step 4: Write Tests\n\nCreate the test file following project conventions:\n1. Place the file according to the project's test location pattern\n2. Use the project's naming convention (`.test.ts` or `.spec.ts`)\n3. Follow the AAA pattern (Arrange, Act, Assert)\n4. Cover the happy path, edge cases, and error cases\n\n### Step 5: Run and Verify\n\nRun the tests using the project's test command:\n\n```bash\n# Use the project's package manager\npnpm run test          # or npm/bun/yarn equivalent\npnpm vitest run <file> # run a specific test file\n```\n\nReport results. If tests fail, read the error output, fix the test, and re-run.\n\n## Assumptions\n\n- Project uses Vitest as the test runner\n- React components are tested with React Testing Library\n- `globals: true` is set in Vitest config (no need to import `describe`, `it`, `expect`)","tags":["testing","skills","tartinerlabs","agent-skills","automation","claude-code","claude-code-skills","cli","code-quality","developer-tools","github-actions","productivity"],"capabilities":["skill","source-tartinerlabs","skill-testing","topic-agent-skills","topic-automation","topic-claude-code","topic-claude-code-skills","topic-cli","topic-code-quality","topic-developer-tools","topic-github-actions","topic-productivity","topic-tailwind-css"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/tartinerlabs/skills/testing","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add tartinerlabs/skills","source_repo":"https://github.com/tartinerlabs/skills","install_from":"skills.sh"}},"qualityScore":"0.453","qualityRationale":"deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (2,746 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-05-18T19:13:57.311Z","embedding":null,"createdAt":"2026-05-07T20:43:16.427Z","updatedAt":"2026-05-18T19:13:57.311Z","lastSeenAt":"2026-05-18T19:13:57.311Z","tsv":"'/react':220 '/user-event':225 '1':113,153,277 '2':142,167,289 '3':184,238,299 '4':201,267,307 '5':211,318 'aaa':302 'accord':281 'act':305 'ad':8 'also':257 'alway':260 'arrang':304 'assert':306 'assumpt':368 'base':242 'bash':331 'block':166 'browser':57,65 'browser/e2e':76 'bun.lock':207 'case':137,313,316 'check':161,187,204,214 'class':129 'code':44 'coloc':191 'command':330 'compon':17,83,103,131,256,377 'config':156,390 'consult':261 'convent':152,183,276,295 'cover':308 'coverag':10 'creat':270 'debug':12 'depend':132 'describ':395 'detail':41 'detect':143 'determin':47 'directori':200 'e2e':56,60 'edg':136,312 'effect':135 'end':62,64 'end-to-end':61 'engin':30 'equival':343 'error':139,315,359 'exampl':45 'exist':151,168,230 'expect':397 'expert':28 'explan':42 'export':127 'fail':356 'failur':14 'file':37,94,120,273,280,351 'find':180 'fix':361 'follow':274,300 'function':128,250 'glob':157,170 'global':384 'guidelin':265 'happi':310 'high':97,101,105 'identifi':126 'impact':93 'import':236,394 'individu':35 'instead':79 'interact':68 'js/ts':32 'keyword':59 'librari':24,219,224,383 'locat':186,234,287 'logic':249 'manag':203,337 'match':150,226 'medium':109 'name':182,233,294 'need':392 'next':192 'npm/bun/yarn':342 'output':360 'overview':91 'packag':202,336 'package-lock.json':210 'package.json':215 'page':67 'path':140,311 'pattern':100,231,288,303 'place':278 'playwright':66 'pnpm':338,344 'pnpm-lock.yaml':206 'presenc':213 'proceed':85 'project':33,144,148,228,275,284,292,327,334,369 'qualiti':108,264 're':366 're-run':365 'react':22,255,376,381 'read':34,117,239,251,258,357 'relev':240 'report':352 'request':55 'result':353 'rout':46 'rtl':212 'rule':36,39,90,92,241 'rules/component-testing.md':106,259 'rules/test-quality.md':110,262 'rules/test-structure.md':98,252 'rules/vitest-patterns.md':102,254 'run':6,319,322,339,346,347,367 'runner':155,375 'scan':146 'screenshot':69 'separ':198 'set':387 'setup':145 'side':134 'skill':78 'skill-testing' 'sourc':116,119,194 'source-tartinerlabs' 'spec':176 'spec.ts':298 'specif':349 'step':112,141,237,266,317 'stop':81 'structur':96 'tell':70 'test':1,5,7,9,13,18,23,29,49,58,77,84,95,104,107,125,154,165,169,172,185,189,199,218,223,247,269,272,286,324,329,340,350,355,363,374,379,382 'test.ts':296 'testing-librari':217,222 'topic-agent-skills' 'topic-automation' 'topic-claude-code' 'topic-claude-code-skills' 'topic-cli' 'topic-code-quality' 'topic-developer-tools' 'topic-github-actions' 'topic-productivity' 'topic-tailwind-css' 'true':385 'ts':173,177 'tsx':174,178 'type':50 'understand':114 'unit':15,82 'use':2,74,290,325,332,370 'user':53,72,123 'util':248 'verifi':321 'vite.config':162 'vitest':20,99,345,371,389 'vitest.config':159 'want':124 'workflow':88,111 'write':4,268 'yarn.lock':208","prices":[{"id":"5140c087-4bae-4d18-9e61-055489a8e834","listingId":"8a7e68d3-5f4b-421f-888c-6a5981761eac","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"tartinerlabs","category":"skills","install_from":"skills.sh"},"createdAt":"2026-05-07T20:43:16.427Z"}],"sources":[{"listingId":"8a7e68d3-5f4b-421f-888c-6a5981761eac","source":"github","sourceId":"tartinerlabs/skills/testing","sourceUrl":"https://github.com/tartinerlabs/skills/tree/main/skills/testing","isPrimary":false,"firstSeenAt":"2026-05-18T13:21:02.045Z","lastSeenAt":"2026-05-18T19:13:57.311Z"},{"listingId":"8a7e68d3-5f4b-421f-888c-6a5981761eac","source":"skills_sh","sourceId":"tartinerlabs/skills/testing","sourceUrl":"https://skills.sh/tartinerlabs/skills/testing","isPrimary":true,"firstSeenAt":"2026-05-07T20:43:16.427Z","lastSeenAt":"2026-05-07T22:42:05.321Z"}],"details":{"listingId":"8a7e68d3-5f4b-421f-888c-6a5981761eac","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"tartinerlabs","slug":"testing","github":{"repo":"tartinerlabs/skills","stars":7,"topics":["agent-skills","automation","claude-code","claude-code-skills","cli","code-quality","developer-tools","github-actions","productivity","tailwind-css"],"license":"mit","html_url":"https://github.com/tartinerlabs/skills","pushed_at":"2026-05-17T09:09:47Z","description":"Claude Code skills for git workflows, GitHub automation, security audits, code refactoring, and project tooling","skill_md_sha":"5bc0ea0a902cacbc8fb478036bce651050aba573","skill_md_path":"skills/testing/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/tartinerlabs/skills/tree/main/skills/testing"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"testing","description":"Use when writing tests, running tests, adding test coverage, or debugging test failures. Unit and component testing with Vitest and React Testing Library."},"skills_sh_url":"https://skills.sh/tartinerlabs/skills/testing"},"updatedAt":"2026-05-18T19:13:57.311Z"}}