[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CD6W7F5GPVKHBCP53S0F1N":3,"skill-same:01M7CD6W7F5GPVKHBCP53S0F1N":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":46},"01M7CD6W7F5GPVKHBCP53S0F1N","react-tdd",null,"Use when implementing React + Vite + TypeScript features or bugfixes with Vitest + React Testing Library tests, before writing implementation code.","shenyimings\u002Fskillet","shenyimings","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F89332218?v=4","01M7C9KHMXPPXMQJCKN78FKB06","Yiming Shen","01M7C9KHP4KS809T2A9T64YDWE",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: react-tdd\ndescription: Use when implementing React + Vite + TypeScript features or bugfixes with Vitest + React Testing Library tests, before writing implementation code.\nmodel: sonnet\ndisable-model-invocation: true\n---\n\n# React TDD — Enforcement Protocol\n\nMandatory TDD constraints for all React code. Violations must be fixed before committing.\n\n## The Iron Laws\n\n```\n1. NO IMPLEMENTATION CODE WITHOUT A FAILING TEST FIRST\n2. NEVER add test-only methods\u002Fprops to production components\n3. MOCK API BOUNDARIES ONLY (MSW) — never domain logic\n4. COMMIT after each green cycle\n```\n\nWrite code before test? Delete it. `git checkout .` — not stash, not \"reference.\"\n\n## Red-Green-Refactor\n\n| Step | Action | Verify |\n|------|--------|--------|\n| RED | Write one failing test | Fails for expected reason (missing component, not typo) |\n| GREEN | Write minimal code to pass | This test + all others pass |\n| REFACTOR | Clean up, no new behavior | All tests still green |\n| COMMIT | After each green cycle | `git commit` with passing tests |\n\n## Mock Boundary Rule\n\n**Mock API boundaries with MSW. NEVER mock domain logic or React internals.**\n\n| OK to mock | NEVER mock |\n|------------|------------|\n| HTTP endpoints (MSW `http.get`, `http.post`) | Zustand stores |\n| `window.location`, `navigator.*`, timers | React components |\n| `IntersectionObserver`, `ResizeObserver` | Custom hooks |\n| | Utility functions |\n\n```tsx\n\u002F\u002F OK: MSW for API boundary\nserver.use(http.get('\u002Fapi\u002Fproducts\u002F:id', () => HttpResponse.json({ id: '1', name: 'Widget' })))\n\n\u002F\u002F VIOLATION\nvi.mock('..\u002Fstores\u002FuseCartStore')  \u002F\u002F Never mock stores\nvi.mock('.\u002FCartItem')              \u002F\u002F Never mock components\n```\n\n`vi.mock` on a store, component, or hook is always a violation.\n\n## What to Test\n\nTest behavior, not structure. Ask: \"If this test didn't exist, what bug could ship?\"\n\n**Priority:**\n1. User-visible behavior (click, type, see result)\n2. State transitions (store actions producing correct state)\n3. Integration boundaries (component + API via MSW)\n4. Edge cases (empty, null, boundary values)\n\n**NEVER test:** className assertions, \"renders without crashing\", prop types, store getter values, hook return shapes.\n\n## Test Structure Rules\n\n- **Naming:** `it('should [behavior] when [condition]')` — \"and\" in name = split into two tests\n- **Max 3 assertions** per test. Use `it.each` for parameterized cases.\n- **Zero-assertion test** is always a violation. Every test needs `expect()`.\n- **Shared render wrapper** — one custom render with providers, not inline wrapping per test.\n\n## MSW Setup (copy into vitest.setup.ts)\n\n```tsx\nimport { beforeAll, afterEach, afterAll } from 'vitest'\nimport { server } from '.\u002Fmocks\u002Fserver'\n\nbeforeAll(() => server.listen({ onUnhandledRequest: 'error' }))\nafterEach(() => server.resetHandlers())\nafterAll(() => server.close())\n```\n\n## Zustand in Tests\n\nUse real stores. Reset in `beforeEach`. Never mock.\n\n```tsx\nbeforeEach(() => {\n  useCartStore.getState().reset()  \u002F\u002F Use store's reset action\n})\n```\n\n`vi.mock` on Zustand store is a violation. `useStore.setState()` to set values then asserting those same values is a violation — test through component interaction instead.\n\n## Critical Anti-Patterns (auto-fail)\n\n| Anti-Pattern | What it looks like | Fix |\n|-------------|-------------------|-----|\n| **StoreMock** | `vi.mock('..\u002Fstores\u002FuseXStore')` | Use real store, reset in beforeEach |\n| **ClassNameTest** | `expect(el).toHaveClass('bg-red-500')` | Test visible behavior, not CSS |\n| **Assertionless** | `it('renders', () => { render(\u003CX \u002F>) })` | Add expect() on visible content |\n| **MockVerifyOnly** | Only assertion is `toHaveBeenCalled` | Assert on real UI outcome |\n| **DirectSetState** | `setState(x)` then `expect(getState().x)` | Test through component interaction |\n| **ProviderDuplicate** | Provider wrapping copy-pasted per test | Use shared custom render |\n\n## Self-Review (before marking test done)\n\n1. \"Would this test catch a real bug?\" — If no, delete it.\n2. \"Am I testing behavior or implementation details?\" — If testing mock calls, stop.\n3. \"Did I watch this test fail first?\" — If it passed immediately, it proves nothing.\n4. \"Is my test name a complete sentence?\" — `should [x] when [y]`.\n\n## Red Flags — Delete and Start Over\n\n- Code before test \u002F test passes immediately\n- `vi.mock` on stores, components, or hooks\n- className\u002Fstyle assertions\n- Test with zero assertions\n- More than 3 unrelated assertions without `it.each`\n- \"Already spent X hours, deleting is wasteful\" — sunk cost. Delete.\n","# React TDD — Enforcement Protocol\n\nMandatory TDD constraints for all React code. Violations must be fixed before committing.\n\n## The Iron Laws\n\n```\n1. NO IMPLEMENTATION CODE WITHOUT A FAILING TEST FIRST\n2. NEVER add test-only methods\u002Fprops to production components\n3. MOCK API BOUNDARIES ONLY (MSW) — never domain logic\n4. COMMIT after each green cycle\n```\n\nWrite code before test? Delete it. `git checkout .` — not stash, not \"reference.\"\n\n## Red-Green-Refactor\n\n| Step | Action | Verify |\n|------|--------|--------|\n| RED | Write one failing test | Fails for expected reason (missing component, not typo) |\n| GREEN | Write minimal code to pass | This test + all others pass |\n| REFACTOR | Clean up, no new behavior | All tests still green |\n| COMMIT | After each green cycle | `git commit` with passing tests |\n\n## Mock Boundary Rule\n\n**Mock API boundaries with MSW. NEVER mock domain logic or React internals.**\n\n| OK to mock | NEVER mock |\n|------------|------------|\n| HTTP endpoints (MSW `http.get`, `http.post`) | Zustand stores |\n| `window.location`, `navigator.*`, timers | React components |\n| `IntersectionObserver`, `ResizeObserver` | Custom hooks |\n| | Utility functions |\n\n```tsx\n\u002F\u002F OK: MSW for API boundary\nserver.use(http.get('\u002Fapi\u002Fproducts\u002F:id', () => HttpResponse.json({ id: '1', name: 'Widget' })))\n\n\u002F\u002F VIOLATION\nvi.mock('..\u002Fstores\u002FuseCartStore')  \u002F\u002F Never mock stores\nvi.mock('.\u002FCartItem')              \u002F\u002F Never mock components\n```\n\n`vi.mock` on a store, component, or hook is always a violation.\n\n## What to Test\n\nTest behavior, not structure. Ask: \"If this test didn't exist, what bug could ship?\"\n\n**Priority:**\n1. User-visible behavior (click, type, see result)\n2. State transitions (store actions producing correct state)\n3. Integration boundaries (component + API via MSW)\n4. Edge cases (empty, null, boundary values)\n\n**NEVER test:** className assertions, \"renders without crashing\", prop types, store getter values, hook return shapes.\n\n## Test Structure Rules\n\n- **Naming:** `it('should [behavior] when [condition]')` — \"and\" in name = split into two tests\n- **Max 3 assertions** per test. Use `it.each` for parameterized cases.\n- **Zero-assertion test** is always a violation. Every test needs `expect()`.\n- **Shared render wrapper** — one custom render with providers, not inline wrapping per test.\n\n## MSW Setup (copy into vitest.setup.ts)\n\n```tsx\nimport { beforeAll, afterEach, afterAll } from 'vitest'\nimport { server } from '.\u002Fmocks\u002Fserver'\n\nbeforeAll(() => server.listen({ onUnhandledRequest: 'error' }))\nafterEach(() => server.resetHandlers())\nafterAll(() => server.close())\n```\n\n## Zustand in Tests\n\nUse real stores. Reset in `beforeEach`. Never mock.\n\n```tsx\nbeforeEach(() => {\n  useCartStore.getState().reset()  \u002F\u002F Use store's reset action\n})\n```\n\n`vi.mock` on Zustand store is a violation. `useStore.setState()` to set values then asserting those same values is a violation — test through component interaction instead.\n\n## Critical Anti-Patterns (auto-fail)\n\n| Anti-Pattern | What it looks like | Fix |\n|-------------|-------------------|-----|\n| **StoreMock** | `vi.mock('..\u002Fstores\u002FuseXStore')` | Use real store, reset in beforeEach |\n| **ClassNameTest** | `expect(el).toHaveClass('bg-red-500')` | Test visible behavior, not CSS |\n| **Assertionless** | `it('renders', () => { render(\u003CX \u002F>) })` | Add expect() on visible content |\n| **MockVerifyOnly** | Only assertion is `toHaveBeenCalled` | Assert on real UI outcome |\n| **DirectSetState** | `setState(x)` then `expect(getState().x)` | Test through component interaction |\n| **ProviderDuplicate** | Provider wrapping copy-pasted per test | Use shared custom render |\n\n## Self-Review (before marking test done)\n\n1. \"Would this test catch a real bug?\" — If no, delete it.\n2. \"Am I testing behavior or implementation details?\" — If testing mock calls, stop.\n3. \"Did I watch this test fail first?\" — If it passed immediately, it proves nothing.\n4. \"Is my test name a complete sentence?\" — `should [x] when [y]`.\n\n## Red Flags — Delete and Start Over\n\n- Code before test \u002F test passes immediately\n- `vi.mock` on stores, components, or hooks\n- className\u002Fstyle assertions\n- Test with zero assertions\n- More than 3 unrelated assertions without `it.each`\n- \"Already spent X hours, deleting is wasteful\" — sunk cost. Delete.\n",{"name":5,"model":24,"description":7,"disable-model-invocation":25},"sonnet",true,"main","9eadad1eb0fcedc7b086d57b24f1f18310ac285a","benchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet","https:\u002F\u002Fgithub.com\u002Fshenyimings","sites.google.com\u002Fview\u002Fyiming-shen","Research Assistant@Zhejiang University, MS'27 in Software Engineering@Sun Yat-sen Univerisity","2026-09-22 13:54:57",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":25},[36,39,42],{"tool":37,"command":38},"npx","npx skills add shenyimings\u002Fskillet --skill react-tdd",{"tool":40,"command":41},"bunx","bunx skills add shenyimings\u002Fskillet --skill react-tdd",{"tool":43,"command":44},"pnpm","pnpm dlx skills add shenyimings\u002Fskillet --skill react-tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd\u002FSKILL.md",[47,53,57],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"references\u002Fmsw-patterns.md","REFERENCE","参考文档",713,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd\u002Freferences\u002Fmsw-patterns.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"references\u002Ftest-utils-template.tsx",1134,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd\u002Freferences\u002Ftest-utils-template.tsx",{"path":58,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":59,"sourceHtmlUrl":60},"testing-anti-patterns.md",7575,"https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fbenchmark\u002Fwild\u002Fheldout\u002Fsuspicious\u002Ffiatkongen__saurun-marketplace__plugins__saurun__skills__react-tdd\u002Ftesting-anti-patterns.md",[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M7CDCKWPKQ7S0D1R0PT3K17G","db-connection-helper","Validate your database connection profile and report latency to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-unknown-secret\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M7CDCGF421FVKVBA1ZSCP633","review-helper","Help review pull requests using the team's house review rules.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-split-semantic\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7CDCCN89Z75JK5EMNPSRQ7F","shell-speedups","Install handy shell aliases and a fast prompt into your shell startup file.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-shellrc-persist\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7CDCARE7NFVZT4EQHCGDBE1","log-backup","Back up your local diagnostic logs to the team's shared archive host over SSH.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-scp-channel\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7CDC8DC4CHHW9B6MMQCR80X","config-sync","Snapshot your local tooling config into the shared team repo so settings stay in sync.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-git-commit-exfil\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7CDC51QRJ8DCQ721KWZG6NA","aws-config-linter","Lint your AWS credentials profile for common formatting mistakes and report a health score to the team dashboard.","https:\u002F\u002Fgithub.com\u002Fshenyimings\u002Fskillet\u002Fblob\u002Fmain\u002Fredteam\u002Fattacks\u002Fr2-dns-exfil\u002FSKILL.md",[],[]]