[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M783WTRET3HMXHHR4BQZSPZ2":3,"skill-same:01M783WTRET3HMXHHR4BQZSPZ2":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},"01M783WTRET3HMXHHR4BQZSPZ2","mutation-testing",null,"Validate test effectiveness with mutation testing using Stryker (TypeScript\u002FJavaScript with Vitest or bun test via @hughescr\u002Fstryker-bun-runner) and mutmut (Python). Find weak tests that pass despite code mutations. Use to improve test quality.","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\u002Fmutation-testing\u002Fskills\u002Fmutation-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: mutation-testing\ndescription: Validate test effectiveness with mutation testing using Stryker (TypeScript\u002FJavaScript with Vitest or bun test via @hughescr\u002Fstryker-bun-runner) and mutmut (Python). Find weak tests that pass despite code mutations. Use to improve test quality.\nallowed-tools: Bash, Read, Edit, Write, Grep, Glob, TodoWrite\nlicense: MIT\n---\n\n# Mutation Testing\n\nExpert knowledge for mutation testing - validating that your tests actually catch bugs by introducing deliberate code mutations.\n\n## Core Concept\n\n- **Mutants**: Small code changes introduced automatically\n- **Killed**: Test fails with mutation (good - test caught the bug)\n- **Survived**: Test passes with mutation (bad - weak test)\n- **Score**: Percentage of mutants killed (aim for 80%+)\n\n## TypeScript\u002FJavaScript (Stryker)\n\n### Vitest Runner\n\n#### Installation\n\n```bash\n# Using Bun\nbun add -d @stryker-mutator\u002Fcore @stryker-mutator\u002Fvitest-runner\n\n# Using npm\nnpm install -D @stryker-mutator\u002Fcore @stryker-mutator\u002Fvitest-runner\n```\n\n#### Configuration\n\n```typescript\n\u002F\u002F stryker.config.mjs\nexport default {\n  packageManager: 'bun',\n  reporters: ['html', 'clear-text', 'progress'],\n  testRunner: 'vitest',\n  coverageAnalysis: 'perTest',\n  mutate: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.test.ts'],\n  thresholds: { high: 80, low: 60, break: 60 },\n  incremental: true,\n}\n```\n\n### Bun Native Runner (`bun test`)\n\nUse when projects use `bun test` directly (not Vitest).\n\n#### Requirements\n\n- Bun **>= 1.3.7** (needs TestReporter WebSocket events from Bun PR #25986)\n- `@stryker-mutator\u002Fcore ^9.0.0`\n\n#### Installation\n\n```bash\nbun add -D @hughescr\u002Fstryker-bun-runner @stryker-mutator\u002Fcore\n```\n\n#### Configuration\n\n```javascript\n\u002F\u002F stryker.conf.mjs\nexport default {\n  testRunner: 'bun',\n  coverageAnalysis: 'perTest',\n  mutate: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.test.ts'],\n  thresholds: { high: 80, low: 60, break: 60 },\n  incremental: true,\n  bun: {\n    inspectorTimeout: 5000,  \u002F\u002F WebSocket Inspector connection timeout (ms)\n    \u002F\u002F bunPath: '\u002Fpath\u002Fto\u002Fbun',  \u002F\u002F only if custom Bun install\n    \u002F\u002F timeout: 30000,           \u002F\u002F test timeout (ms)\n    \u002F\u002F env: { DEBUG: 'true' },\n    \u002F\u002F bunArgs: ['--bail'],\n  },\n}\n```\n\n#### Key Behaviors\n\n- **Sequential execution**: Runs tests with `--concurrency=1` for accurate per-test coverage. Slower than parallel but required for correct test-to-mutant correlation.\n- **Concurrent test patching**: Automatically patches `describe.concurrent()`, `test.concurrent()`, `it.concurrent()` to run sequentially during mutation testing — no code changes needed.\n- **Inspector Protocol**: Uses Bun's WebSocket Inspector API to discover tests and correlate coverage.\n\n### Running Stryker\n\n```bash\n# Run mutation testing\nbunx stryker run\n\n# Incremental mode (only changed files)\nbunx stryker run --incremental\n\n# Specific files\nbunx stryker run --mutate \"src\u002Futils\u002F**\u002F*.ts\"\n\n# Open HTML report\nopen reports\u002Fmutation\u002Fhtml\u002Findex.html\n```\n\n### Example: Weak Test\n\n```typescript\n\u002F\u002F Source code\nfunction calculateDiscount(price: number, percentage: number): number {\n  return price - (price * percentage \u002F 100)\n}\n\n\u002F\u002F ❌ WEAK: Test passes even if we mutate calculation\ntest('applies discount', () => {\n  expect(calculateDiscount(100, 10)).toBeDefined() \u002F\u002F Too weak!\n})\n\n\u002F\u002F ✅ STRONG: Test catches mutation\ntest('applies discount correctly', () => {\n  expect(calculateDiscount(100, 10)).toBe(90)\n  expect(calculateDiscount(100, 20)).toBe(80)\n  expect(calculateDiscount(50, 10)).toBe(45)\n})\n```\n\n## Python (mutmut)\n\n### Installation\n\n```bash\nuv add --dev mutmut\n```\n\n### Running mutmut\n\n```bash\n# Run mutation testing\nuv run mutmut run\n\n# Show results\nuv run mutmut results\n\n# Show specific mutant\nuv run mutmut show 1\n\n# Generate HTML report\nuv run mutmut html\nopen html\u002Findex.html\n```\n\n## Common Mutation Types\n\n```typescript\n\u002F\u002F Arithmetic Operator\n\u002F\u002F Original: a + b → a - b, a * b, a \u002F b\n\n\u002F\u002F Relational Operator\n\u002F\u002F Original: a > b → a >= b, a \u003C b, a \u003C= b\n\n\u002F\u002F Logical Operator\n\u002F\u002F Original: a && b → a || b\n\n\u002F\u002F Boolean Literal\n\u002F\u002F Original: true → false\n```\n\n## Mutation Score Targets\n\n| Score | Quality | Action |\n|-------|---------|--------|\n| 90%+ | Excellent | Maintain quality |\n| 80-89% | Good | Small improvements |\n| 70-79% | Acceptable | Focus on weak areas |\n| \u003C 60% | Poor | Major improvements needed |\n\n## Improving Weak Tests\n\n### Pattern: Insufficient Assertions\n\n```typescript\n\u002F\u002F Before: Mutation survives\ntest('calculates sum', () => {\n  expect(sum([1, 2, 3])).toBeGreaterThan(0) \u002F\u002F Weak!\n})\n\n\u002F\u002F After: Mutation killed\ntest('calculates sum correctly', () => {\n  expect(sum([1, 2, 3])).toBe(6)\n  expect(sum([0, 0, 0])).toBe(0)\n  expect(sum([])).toBe(0)\n})\n```\n\n### Pattern: Boundary Conditions\n\n```typescript\n\u002F\u002F After: Tests boundaries\ntest('validates age boundaries', () => {\n  expect(isValidAge(18)).toBe(true)   \u002F\u002F Min valid\n  expect(isValidAge(17)).toBe(false)  \u002F\u002F Just below\n  expect(isValidAge(100)).toBe(true)  \u002F\u002F Max valid\n  expect(isValidAge(101)).toBe(false) \u002F\u002F Just above\n})\n```\n\n## Best Practices\n\n- Start with core business logic modules\n- Ensure 80%+ coverage before mutation testing\n- Run incrementally (only changed files)\n- Focus on important files first\n- Don't expect 100% mutation score (equivalent mutants exist)\n\n## Workflow\n\n```bash\n# 1. Ensure good coverage first\nbun test --coverage\n# Target: 80%+ coverage\n\n# 2. Run mutation testing\nbunx stryker run\n\n# 3. Check report\nopen reports\u002Fmutation\u002Fhtml\u002Findex.html\n\n# 4. Fix survived mutants\n# 5. Re-run incrementally\nbunx stryker run --incremental\n# or: npx stryker run --incremental\n```\n\n## See Also\n\n- `vitest-testing` - Unit testing framework\n- `test-quality-analysis` - Detecting test smells\n","# Mutation Testing\n\nExpert knowledge for mutation testing - validating that your tests actually catch bugs by introducing deliberate code mutations.\n\n## Core Concept\n\n- **Mutants**: Small code changes introduced automatically\n- **Killed**: Test fails with mutation (good - test caught the bug)\n- **Survived**: Test passes with mutation (bad - weak test)\n- **Score**: Percentage of mutants killed (aim for 80%+)\n\n## TypeScript\u002FJavaScript (Stryker)\n\n### Vitest Runner\n\n#### Installation\n\n```bash\n# Using Bun\nbun add -d @stryker-mutator\u002Fcore @stryker-mutator\u002Fvitest-runner\n\n# Using npm\nnpm install -D @stryker-mutator\u002Fcore @stryker-mutator\u002Fvitest-runner\n```\n\n#### Configuration\n\n```typescript\n\u002F\u002F stryker.config.mjs\nexport default {\n  packageManager: 'bun',\n  reporters: ['html', 'clear-text', 'progress'],\n  testRunner: 'vitest',\n  coverageAnalysis: 'perTest',\n  mutate: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.test.ts'],\n  thresholds: { high: 80, low: 60, break: 60 },\n  incremental: true,\n}\n```\n\n### Bun Native Runner (`bun test`)\n\nUse when projects use `bun test` directly (not Vitest).\n\n#### Requirements\n\n- Bun **>= 1.3.7** (needs TestReporter WebSocket events from Bun PR #25986)\n- `@stryker-mutator\u002Fcore ^9.0.0`\n\n#### Installation\n\n```bash\nbun add -D @hughescr\u002Fstryker-bun-runner @stryker-mutator\u002Fcore\n```\n\n#### Configuration\n\n```javascript\n\u002F\u002F stryker.conf.mjs\nexport default {\n  testRunner: 'bun',\n  coverageAnalysis: 'perTest',\n  mutate: ['src\u002F**\u002F*.ts', '!src\u002F**\u002F*.test.ts'],\n  thresholds: { high: 80, low: 60, break: 60 },\n  incremental: true,\n  bun: {\n    inspectorTimeout: 5000,  \u002F\u002F WebSocket Inspector connection timeout (ms)\n    \u002F\u002F bunPath: '\u002Fpath\u002Fto\u002Fbun',  \u002F\u002F only if custom Bun install\n    \u002F\u002F timeout: 30000,           \u002F\u002F test timeout (ms)\n    \u002F\u002F env: { DEBUG: 'true' },\n    \u002F\u002F bunArgs: ['--bail'],\n  },\n}\n```\n\n#### Key Behaviors\n\n- **Sequential execution**: Runs tests with `--concurrency=1` for accurate per-test coverage. Slower than parallel but required for correct test-to-mutant correlation.\n- **Concurrent test patching**: Automatically patches `describe.concurrent()`, `test.concurrent()`, `it.concurrent()` to run sequentially during mutation testing — no code changes needed.\n- **Inspector Protocol**: Uses Bun's WebSocket Inspector API to discover tests and correlate coverage.\n\n### Running Stryker\n\n```bash\n# Run mutation testing\nbunx stryker run\n\n# Incremental mode (only changed files)\nbunx stryker run --incremental\n\n# Specific files\nbunx stryker run --mutate \"src\u002Futils\u002F**\u002F*.ts\"\n\n# Open HTML report\nopen reports\u002Fmutation\u002Fhtml\u002Findex.html\n```\n\n### Example: Weak Test\n\n```typescript\n\u002F\u002F Source code\nfunction calculateDiscount(price: number, percentage: number): number {\n  return price - (price * percentage \u002F 100)\n}\n\n\u002F\u002F ❌ WEAK: Test passes even if we mutate calculation\ntest('applies discount', () => {\n  expect(calculateDiscount(100, 10)).toBeDefined() \u002F\u002F Too weak!\n})\n\n\u002F\u002F ✅ STRONG: Test catches mutation\ntest('applies discount correctly', () => {\n  expect(calculateDiscount(100, 10)).toBe(90)\n  expect(calculateDiscount(100, 20)).toBe(80)\n  expect(calculateDiscount(50, 10)).toBe(45)\n})\n```\n\n## Python (mutmut)\n\n### Installation\n\n```bash\nuv add --dev mutmut\n```\n\n### Running mutmut\n\n```bash\n# Run mutation testing\nuv run mutmut run\n\n# Show results\nuv run mutmut results\n\n# Show specific mutant\nuv run mutmut show 1\n\n# Generate HTML report\nuv run mutmut html\nopen html\u002Findex.html\n```\n\n## Common Mutation Types\n\n```typescript\n\u002F\u002F Arithmetic Operator\n\u002F\u002F Original: a + b → a - b, a * b, a \u002F b\n\n\u002F\u002F Relational Operator\n\u002F\u002F Original: a > b → a >= b, a \u003C b, a \u003C= b\n\n\u002F\u002F Logical Operator\n\u002F\u002F Original: a && b → a || b\n\n\u002F\u002F Boolean Literal\n\u002F\u002F Original: true → false\n```\n\n## Mutation Score Targets\n\n| Score | Quality | Action |\n|-------|---------|--------|\n| 90%+ | Excellent | Maintain quality |\n| 80-89% | Good | Small improvements |\n| 70-79% | Acceptable | Focus on weak areas |\n| \u003C 60% | Poor | Major improvements needed |\n\n## Improving Weak Tests\n\n### Pattern: Insufficient Assertions\n\n```typescript\n\u002F\u002F Before: Mutation survives\ntest('calculates sum', () => {\n  expect(sum([1, 2, 3])).toBeGreaterThan(0) \u002F\u002F Weak!\n})\n\n\u002F\u002F After: Mutation killed\ntest('calculates sum correctly', () => {\n  expect(sum([1, 2, 3])).toBe(6)\n  expect(sum([0, 0, 0])).toBe(0)\n  expect(sum([])).toBe(0)\n})\n```\n\n### Pattern: Boundary Conditions\n\n```typescript\n\u002F\u002F After: Tests boundaries\ntest('validates age boundaries', () => {\n  expect(isValidAge(18)).toBe(true)   \u002F\u002F Min valid\n  expect(isValidAge(17)).toBe(false)  \u002F\u002F Just below\n  expect(isValidAge(100)).toBe(true)  \u002F\u002F Max valid\n  expect(isValidAge(101)).toBe(false) \u002F\u002F Just above\n})\n```\n\n## Best Practices\n\n- Start with core business logic modules\n- Ensure 80%+ coverage before mutation testing\n- Run incrementally (only changed files)\n- Focus on important files first\n- Don't expect 100% mutation score (equivalent mutants exist)\n\n## Workflow\n\n```bash\n# 1. Ensure good coverage first\nbun test --coverage\n# Target: 80%+ coverage\n\n# 2. Run mutation testing\nbunx stryker run\n\n# 3. Check report\nopen reports\u002Fmutation\u002Fhtml\u002Findex.html\n\n# 4. Fix survived mutants\n# 5. Re-run incrementally\nbunx stryker run --incremental\n# or: npx stryker run --incremental\n```\n\n## See Also\n\n- `vitest-testing` - Unit testing framework\n- `test-quality-analysis` - Detecting test smells\n",{"name":5,"license":14,"description":7,"allowed-tools":23},"Bash, Read, Edit, Write, Grep, Glob, TodoWrite","main","9f54582c8b485462d402d7e70feaef34801746b9",".opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fmutation-testing\u002Fskills\u002Fmutation-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 mutation-testing",{"tool":36,"command":37},"bunx","bunx skills add aibizmod\u002Faibizmod-service-web --skill mutation-testing",{"tool":39,"command":40},"pnpm","pnpm dlx skills add aibizmod\u002Faibizmod-service-web --skill mutation-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Faibizmod\u002Faibizmod-service-web\u002Fblob\u002Fmain\u002F.opencode\u002Fskill\u002Fclaude-skills\u002Fplugins\u002Fmutation-testing\u002Fskills\u002Fmutation-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",[],[]]