[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7844XCW79GE9Z1XDPG2RDF2":3,"skill-same:01M7844XCW79GE9Z1XDPG2RDF2":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7844XCW79GE9Z1XDPG2RDF2","vitest-testing",null,"Modern TypeScript\u002FJavaScript testing with Vitest. Fast unit and integration tests, native ESM support, Vite-powered HMR, and comprehensive mocking. Use for testing TS\u002FJS projects.","aibizmod\u002Faibizmod-service-web","aibizmod","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F295315630?v=4","01M7836CB8EQY701YQ7N88M591","01M7836CBVPZGNSJ8BRP2BT398",0,"MIT","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fvitest-testing\u002Fskills\u002Fvitest-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vitest-testing\ndescription: Modern TypeScript\u002FJavaScript testing with Vitest. Fast unit and integration tests, native ESM support, Vite-powered HMR, and comprehensive mocking. Use for testing TS\u002FJS projects.\nallowed-tools: Bash, Read, Edit, Write, Grep, Glob, TodoWrite\nlicense: MIT\n---\n\n# Vitest Testing\n\nExpert knowledge for testing JavaScript\u002FTypeScript projects using Vitest - a blazingly fast testing framework powered by Vite.\n\n## Quick Start\n\n### Installation\n\n```bash\n# Using Bun (recommended)\nbun add -d vitest\n\n# Using npm\nnpm install -D vitest\n```\n\n### Configuration\n\n```typescript\n\u002F\u002F vitest.config.ts\nimport { defineConfig } from 'vitest\u002Fconfig'\n\nexport default defineConfig({\n  test: {\n    globals: true,\n    environment: 'node', \u002F\u002F or 'jsdom'\n    coverage: {\n      provider: 'v8',\n      reporter: ['text', 'json', 'html'],\n      thresholds: { lines: 80, functions: 80, branches: 80 },\n    },\n    include: ['**\u002F*.{test,spec}.{js,ts,jsx,tsx}'],\n  },\n})\n```\n\n## Running Tests\n\n```bash\n# Run all tests (prefer bun)\nbun test\n\n# Watch mode (default)\nbun test --watch\n\n# Run once (CI mode)\nbun test --run\n\n# With coverage\nbun test --coverage\n\n# Specific file\nbun test src\u002Futils\u002Fmath.test.ts\n\n# Pattern matching\nbun test --grep=\"calculates sum\"\n\n# UI mode (interactive)\nbun test --ui\n\n# Verbose output\nbun test --reporter=verbose\n```\n\n## Writing Tests\n\n### Basic Structure\n\n```typescript\nimport { describe, it, expect, beforeEach, afterEach } from 'vitest'\nimport { add, subtract } from '.\u002Fmath'\n\ndescribe('Math utilities', () => {\n  beforeEach(() => {\n    \u002F\u002F Setup before each test\n  })\n\n  it('adds two numbers correctly', () => {\n    expect(add(2, 3)).toBe(5)\n  })\n\n  it('subtracts two numbers correctly', () => {\n    expect(subtract(5, 3)).toBe(2)\n  })\n})\n```\n\n### Parametrized Tests\n\n```typescript\ndescribe.each([\n  { input: 2, expected: 4 },\n  { input: 3, expected: 9 },\n])('square function', ({ input, expected }) => {\n  it(`squares ${input} to ${expected}`, () => {\n    expect(square(input)).toBe(expected)\n  })\n})\n```\n\n## Assertions\n\n```typescript\n\u002F\u002F Equality\nexpect(value).toBe(expected)\nexpect(value).toEqual(expected)\n\n\u002F\u002F Truthiness\nexpect(value).toBeTruthy()\nexpect(value).toBeNull()\nexpect(value).toBeDefined()\n\n\u002F\u002F Numbers\nexpect(number).toBeGreaterThan(3)\nexpect(number).toBeCloseTo(0.3, 1)\n\n\u002F\u002F Strings\u002FArrays\nexpect(string).toMatch(\u002Fpattern\u002F)\nexpect(array).toContain(item)\n\n\u002F\u002F Objects\nexpect(object).toHaveProperty('key')\nexpect(object).toMatchObject({ a: 1 })\n\n\u002F\u002F Exceptions\nexpect(() => throwError()).toThrow('message')\n\n\u002F\u002F Promises\nawait expect(promise).resolves.toBe(value)\nawait expect(promise).rejects.toThrow()\n```\n\n## Mocking\n\n### Function Mocks\n\n```typescript\nimport { vi } from 'vitest'\n\nconst mockFn = vi.fn()\nmockFn.mockReturnValue(42)\nmockFn.mockResolvedValue('async result')\nmockFn.mockImplementation((x) => x * 2)\n\nexpect(mockFn).toHaveBeenCalled()\nexpect(mockFn).toHaveBeenCalledWith('arg')\n```\n\n### Module Mocking\n\n```typescript\nvi.mock('.\u002Fapi', () => ({\n  fetchUser: vi.fn(() => ({ id: 1, name: 'Test User' })),\n}))\n\nimport { fetchUser } from '.\u002Fapi'\n\nbeforeEach(() => {\n  vi.clearAllMocks()\n})\n```\n\n### Timers\n\n```typescript\nbeforeEach(() => vi.useFakeTimers())\nafterEach(() => vi.restoreAllMocks())\n\nit('advances timers', () => {\n  const callback = vi.fn()\n  setTimeout(callback, 1000)\n  vi.advanceTimersByTime(1000)\n  expect(callback).toHaveBeenCalledOnce()\n})\n\nit('mocks dates', () => {\n  const date = new Date('2024-01-01')\n  vi.setSystemTime(date)\n  expect(Date.now()).toBe(date.getTime())\n})\n```\n\n## Coverage\n\n```bash\n# Generate coverage report\nbun test --coverage\n\n# HTML report\nbun test --coverage --coverage.reporter=html\nopen coverage\u002Findex.html\n\n# Check against thresholds\nbun test --coverage --coverage.thresholds.lines=90\n```\n\n## Integration Testing\n\n```typescript\nimport request from 'supertest'\nimport { app } from '.\u002Fapp'\n\ndescribe('API endpoints', () => {\n  it('creates a user', async () => {\n    const response = await request(app)\n      .post('\u002Fapi\u002Fusers')\n      .send({ name: 'John' })\n      .expect(201)\n\n    expect(response.body).toMatchObject({\n      id: expect.any(Number),\n      name: 'John',\n    })\n  })\n})\n```\n\n## Best Practices\n\n- One test file per source file: `math.ts` → `math.test.ts`\n- Group related tests with `describe()` blocks\n- Use descriptive test names\n- Mock only external dependencies\n- Use `concurrent` tests for independent async tests\n- Share expensive fixtures with `beforeAll()`\n- Aim for 80%+ coverage but don't chase 100%\n\n## See Also\n\n- `test-quality-analysis` - Detecting test smells\n- `playwright-testing` - E2E testing\n- `mutation-testing` - Validate test effectiveness\n","# Vitest Testing\n\nExpert knowledge for testing JavaScript\u002FTypeScript projects using Vitest - a blazingly fast testing framework powered by Vite.\n\n## Quick Start\n\n### Installation\n\n```bash\n# Using Bun (recommended)\nbun add -d vitest\n\n# Using npm\nnpm install -D vitest\n```\n\n### Configuration\n\n```typescript\n\u002F\u002F vitest.config.ts\nimport { defineConfig } from 'vitest\u002Fconfig'\n\nexport default defineConfig({\n  test: {\n    globals: true,\n    environment: 'node', \u002F\u002F or 'jsdom'\n    coverage: {\n      provider: 'v8',\n      reporter: ['text', 'json', 'html'],\n      thresholds: { lines: 80, functions: 80, branches: 80 },\n    },\n    include: ['**\u002F*.{test,spec}.{js,ts,jsx,tsx}'],\n  },\n})\n```\n\n## Running Tests\n\n```bash\n# Run all tests (prefer bun)\nbun test\n\n# Watch mode (default)\nbun test --watch\n\n# Run once (CI mode)\nbun test --run\n\n# With coverage\nbun test --coverage\n\n# Specific file\nbun test src\u002Futils\u002Fmath.test.ts\n\n# Pattern matching\nbun test --grep=\"calculates sum\"\n\n# UI mode (interactive)\nbun test --ui\n\n# Verbose output\nbun test --reporter=verbose\n```\n\n## Writing Tests\n\n### Basic Structure\n\n```typescript\nimport { describe, it, expect, beforeEach, afterEach } from 'vitest'\nimport { add, subtract } from '.\u002Fmath'\n\ndescribe('Math utilities', () => {\n  beforeEach(() => {\n    \u002F\u002F Setup before each test\n  })\n\n  it('adds two numbers correctly', () => {\n    expect(add(2, 3)).toBe(5)\n  })\n\n  it('subtracts two numbers correctly', () => {\n    expect(subtract(5, 3)).toBe(2)\n  })\n})\n```\n\n### Parametrized Tests\n\n```typescript\ndescribe.each([\n  { input: 2, expected: 4 },\n  { input: 3, expected: 9 },\n])('square function', ({ input, expected }) => {\n  it(`squares ${input} to ${expected}`, () => {\n    expect(square(input)).toBe(expected)\n  })\n})\n```\n\n## Assertions\n\n```typescript\n\u002F\u002F Equality\nexpect(value).toBe(expected)\nexpect(value).toEqual(expected)\n\n\u002F\u002F Truthiness\nexpect(value).toBeTruthy()\nexpect(value).toBeNull()\nexpect(value).toBeDefined()\n\n\u002F\u002F Numbers\nexpect(number).toBeGreaterThan(3)\nexpect(number).toBeCloseTo(0.3, 1)\n\n\u002F\u002F Strings\u002FArrays\nexpect(string).toMatch(\u002Fpattern\u002F)\nexpect(array).toContain(item)\n\n\u002F\u002F Objects\nexpect(object).toHaveProperty('key')\nexpect(object).toMatchObject({ a: 1 })\n\n\u002F\u002F Exceptions\nexpect(() => throwError()).toThrow('message')\n\n\u002F\u002F Promises\nawait expect(promise).resolves.toBe(value)\nawait expect(promise).rejects.toThrow()\n```\n\n## Mocking\n\n### Function Mocks\n\n```typescript\nimport { vi } from 'vitest'\n\nconst mockFn = vi.fn()\nmockFn.mockReturnValue(42)\nmockFn.mockResolvedValue('async result')\nmockFn.mockImplementation((x) => x * 2)\n\nexpect(mockFn).toHaveBeenCalled()\nexpect(mockFn).toHaveBeenCalledWith('arg')\n```\n\n### Module Mocking\n\n```typescript\nvi.mock('.\u002Fapi', () => ({\n  fetchUser: vi.fn(() => ({ id: 1, name: 'Test User' })),\n}))\n\nimport { fetchUser } from '.\u002Fapi'\n\nbeforeEach(() => {\n  vi.clearAllMocks()\n})\n```\n\n### Timers\n\n```typescript\nbeforeEach(() => vi.useFakeTimers())\nafterEach(() => vi.restoreAllMocks())\n\nit('advances timers', () => {\n  const callback = vi.fn()\n  setTimeout(callback, 1000)\n  vi.advanceTimersByTime(1000)\n  expect(callback).toHaveBeenCalledOnce()\n})\n\nit('mocks dates', () => {\n  const date = new Date('2024-01-01')\n  vi.setSystemTime(date)\n  expect(Date.now()).toBe(date.getTime())\n})\n```\n\n## Coverage\n\n```bash\n# Generate coverage report\nbun test --coverage\n\n# HTML report\nbun test --coverage --coverage.reporter=html\nopen coverage\u002Findex.html\n\n# Check against thresholds\nbun test --coverage --coverage.thresholds.lines=90\n```\n\n## Integration Testing\n\n```typescript\nimport request from 'supertest'\nimport { app } from '.\u002Fapp'\n\ndescribe('API endpoints', () => {\n  it('creates a user', async () => {\n    const response = await request(app)\n      .post('\u002Fapi\u002Fusers')\n      .send({ name: 'John' })\n      .expect(201)\n\n    expect(response.body).toMatchObject({\n      id: expect.any(Number),\n      name: 'John',\n    })\n  })\n})\n```\n\n## Best Practices\n\n- One test file per source file: `math.ts` → `math.test.ts`\n- Group related tests with `describe()` blocks\n- Use descriptive test names\n- Mock only external dependencies\n- Use `concurrent` tests for independent async tests\n- Share expensive fixtures with `beforeAll()`\n- Aim for 80%+ coverage but don't chase 100%\n\n## See Also\n\n- `test-quality-analysis` - Detecting test smells\n- `playwright-testing` - E2E testing\n- `mutation-testing` - Validate test effectiveness\n",{"name":5,"license":14,"description":7,"allowed-tools":23},"Bash, Read, Edit, Write, Grep, Glob, TodoWrite","main","9f54582c8b485462d402d7e70feaef34801746b9",".opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fvitest-testing\u002Fskills\u002Fvitest-testing","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web","https:\u002F\u002Fgithub.com\u002Faibizmod","2026-09-24 00:48:11",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add aibizmod\u002Faibizmod-service-web --skill vitest-testing",{"tool":36,"command":37},"bunx","bunx skills add aibizmod\u002Faibizmod-service-web --skill vitest-testing",{"tool":39,"command":40},"pnpm","pnpm dlx skills add aibizmod\u002Faibizmod-service-web --skill vitest-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fvitest-testing\u002Fskills\u002Fvitest-testing\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M7846EAPZWCQ8C6G3AAMMR57","{TODO=lowercase-hyphen-case-name}","[TODO: Write comprehensive description in third-person. Start with \"This skill provides...\" or \"This skill should be used when...\"]\n\n[TODO: Add \"Use when\" scenarios - specific situations where Claude should use this skill]\n\n[TODO: Add keywords - technologies, use cases, error messages that should trigger this skill]","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Ftemplates\u002Fskill-skeleton\u002Fskills\u002Fskill-name\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M7846A0WGDKJTDPD5QMHQVFV","zustand-state-management","Zustand state management for React with TypeScript. Use for global state, Redux\u002FContext API migration, localStorage persistence, slices pattern, devtools, Next.js SSR, or encountering hydration errors, TypeScript inference issues, persist middleware problems, infinite render loops.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzustand-state-management\u002Fskills\u002Fzustand-state-management\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M78463GGSP9B3JSF146B2MG0","zod","TypeScript-first schema validation and type inference. Use for validating API requests\u002Fresponses, form data, env vars, configs, defining type-safe schemas with runtime validation, transforming data, generating JSON Schema for OpenAPI\u002FAI, or encountering missing validation errors, type inference issues, validation error handling problems. Zero dependencies (2kb gzipped).","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fzod\u002Fskills\u002Fzod\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7845ZX17SVNNY7EDGPJHSBT","xss-prevention","XSS attack prevention with input sanitization, output encoding, Content Security Policy. Use for user-generated content, rich text editors, web application security, or encountering stored XSS, reflected XSS, DOM manipulation, script injection errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fxss-prevention\u002Fskills\u002Fxss-prevention\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7845ST1H37YHSXWWQ9N0V0S","wordpress-plugin-core","WordPress plugin development with hooks, security, REST API, custom post types. Use for plugin creation, $wpdb queries, Settings API, or encountering SQL injection, XSS, CSRF, nonce errors.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwordpress-plugin-core\u002Fskills\u002Fwordpress-plugin-core\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7845PTWD5HWSTGP35Q8TFNY","woocommerce-dev-cycle","Run tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow in WooCommerce projects.","https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fwoocommerce-dev-cycle\u002Fskills\u002Fwoocommerce-dev-cycle\u002FSKILL.md",[],[]]