[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71H8AGMD70WVZFDB92C7Q1Q":3,"skill-same:01M71H8AGMD70WVZFDB92C7Q1Q":78},{"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":36,"linkOnly":37,"markdownContent":38,"markdownBody":39,"frontMatter":40,"refName":41,"commitSha":42,"skillDirectory":43,"forksCount":44,"repositoryHtmlUrl":45,"repositoryHomepageUrl":6,"ownerHtmlUrl":46,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":47,"install":48,"resources":61},"01M71H8AGMD70WVZFDB92C7Q1Q","zod-contract-testing",null,"Validates Zod schema parsing at boundaries. Tests valid\u002Finvalid inputs, schema evolution, refinement coverage, and compound state matrices (2^N optional field combinations).","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],"testing","contract","zod contract testing","contract testing","zod","evolution","matrices","refinement","at","compound","state","valid","combinations","schema","tests","parsing","invalid","coverage","2026-11-10 10:12:30",false,"---\nname: zod-contract-testing\ndescription: \"Validates Zod schema parsing at boundaries. Tests valid\u002Finvalid inputs, schema evolution, refinement coverage, and compound state matrices (2^N optional field combinations).\"\n---\n\n# Zod Contract Testing\n\nTest schemas at boundaries — not just happy-path inputs.\n\nSchemas define contracts between systems. A schema that accepts invalid data is a security hole. A schema that rejects valid data is a broken integration. This skill teaches you to systematically test schemas at system boundaries.\n\n**When to use**: Testing API request\u002Fresponse schemas, WebSocket message validation, database record parsing, external data ingestion, any Zod schema at a system boundary.\n\n**When not to use**: Internal type assertions, UI component props, type definitions without runtime validation.\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"The type system ensures correctness\" | TypeScript doesn't exist at runtime | Test Zod parsing with real data |\n| \"I tested valid inputs\" | Invalid inputs cause production errors | Test rejection of invalid inputs |\n| \"Refinements are simple\" | `.refine()` failures are easy to miss | Test BOTH passing and failing cases |\n| \"Optional fields are optional\" | 2^N combinations have hidden bugs | Use compound state matrix |\n\n---\n\n## What To Protect (Start Here)\n\nBefore generating schema tests, identify which data integrity decisions apply to your code:\n\n| Decision | Question to Answer | If Yes → Use |\n|----------|--------------------|--------------|\n| Invalid data must be rejected with specific errors | What malformed inputs could reach this boundary? | `testInvalidInput` with `expectedPath` |\n| Schema changes must not break old data | Is there serialized\u002Fstored data in the old format? | `testSchemaEvolution` |\n| Version upgrades must be backward compatible | Do multiple schema versions coexist in production? | `generateVersionCompatibilityMatrix` |\n| Optional field combinations have hidden bugs | Does this schema have 3+ optional fields with interacting refinements? | `generateCompoundStateMatrix` |\n| Refinements must reject specific threats | What invalid-but-plausible input does each `.refine()` guard against? | `testRefinement` |\n\n**Do not generate tests for decisions the human hasn't confirmed.** A schema test that checks \"valid input passes\" without naming the threat it guards against is slop — it'll pass even if the schema accepts everything.\n\n---\n\n## Included Utilities\n\n```typescript\nimport {\n  testValidInput,\n  testInvalidInput,\n  testSchemaEvolution,\n  generateVersionCompatibilityMatrix,\n  assertVersionCompatibility,\n  testRefinement,\n  generateCompoundStateMatrix,\n  formatStateMatrix,\n  applyCompoundState,\n} from '.\u002Fschema-boundary.ts';\n```\n\n## Core Workflow\n\n### Step 1: Test Valid Inputs\n\nVerify the schema accepts all valid input shapes:\n\n```typescript\nimport { z } from 'zod';\n\nconst UserSchema = z.object({\n  name: z.string(),\n  age: z.number().optional(),\n});\n\nit('accepts valid user', () => {\n  testValidInput(UserSchema, { name: 'Alice', age: 30 });\n  testValidInput(UserSchema, { name: 'Bob' });  \u002F\u002F age optional\n});\n```\n\n### Step 2: Test Invalid Inputs\n\nVerify the schema rejects invalid data and errors at the correct path:\n\n```typescript\nit('rejects missing required field', () => {\n  testInvalidInput(UserSchema, {}, 'name');  \u002F\u002F Error at 'name' path\n});\n\nit('rejects wrong type', () => {\n  testInvalidInput(UserSchema, { name: 123 }, 'name');\n});\n\nit('rejects unknown fields with strict schema', () => {\n  const StrictUserSchema = UserSchema.strict();\n  testInvalidInput(StrictUserSchema, { name: 'Alice', role: 'admin' });\n});\n```\n\n### Step 3a: Test Schema Evolution\n\nWhen schemas change, old serialized data must still parse:\n\n```typescript\n\u002F\u002F Old schema: { name: string }\n\u002F\u002F New schema: { name: string, email?: string }\n\nconst NewUserSchema = z.object({\n  name: z.string(),\n  email: z.string().email().optional(),\n});\n\nit('backward compatible with old data', () => {\n  const oldData = { name: 'Alice' };  \u002F\u002F No email field\n  testSchemaEvolution(NewUserSchema, oldData);\n});\n```\n\n### Step 3b: Build Version Compatibility Matrix\n\nFor evolving contracts, check `vN -> vN+1` and `vN -> vN+2` explicitly:\n\n```typescript\nconst versions = [\n  { version: 'v1', schema: V1Schema, fixtures: [v1Payload] },\n  { version: 'v2', schema: V2Schema, fixtures: [v2Payload] },\n  { version: 'v3', schema: V3Schema, fixtures: [v3Payload] },\n];\n\nconst matrix = generateVersionCompatibilityMatrix(versions);\n\n\u002F\u002F Enforce only adjacent upgrades (vN -> vN+1)\nassertVersionCompatibility(versions, 1);\n\n\u002F\u002F Optionally enforce two-hop upgrades (vN -> vN+2)\nassertVersionCompatibility(versions, 2);\n```\n\n### Step 4: Test Refinements\n\nEvery `.refine()` MUST have tests for both passing and failing cases:\n\n```typescript\nconst PositiveNumberSchema = z.object({\n  value: z.number().refine(n => n > 0, 'Value must be positive'),\n});\n\nit('refinement: positive vs non-positive', () => {\n  testRefinement(\n    PositiveNumberSchema,\n    { value: 10 },           \u002F\u002F Passing case\n    { value: -5 },           \u002F\u002F Failing case\n    'must be positive',      \u002F\u002F Expected error message\n  );\n});\n```\n\n### Step 5: Generate Compound State Matrix\n\nFor schemas with N optional fields, there are 2^N possible combinations. For 3-4 fields, test exhaustively. For 5+, switch to pairwise coverage (see decision table below):\n\n```typescript\n\u002F\u002F Cell schema: value?, candidates?, isGiven?\n\u002F\u002F 2^3 = 8 combinations\n\nconst matrix = generateCompoundStateMatrix(['value', 'candidates', 'isGiven']);\nconsole.log(formatStateMatrix(matrix));\n\u002F*\n| # | value | candidates | isGiven | Label |\n|---|-------|------------|---------|-------|\n| 0 | -     | -          | -       | (empty) |\n| 1 | Y     | -          | -       | value |\n| 2 | -     | Y          | -       | candidates |\n| 3 | Y     | Y          | -       | value + candidates |\n| 4 | -     | -          | Y       | isGiven |\n| 5 | Y     | -          | Y       | value + isGiven |\n| 6 | -     | Y          | Y       | candidates + isGiven |\n| 7 | Y     | Y          | Y       | value + candidates + isGiven |\n*\u002F\n```\n\n### Step 6: Apply Matrix to Schema Tests\n\nGenerate test inputs from the matrix:\n\n```typescript\nconst CellSchema = z.object({\n  value: z.number().optional(),\n  candidates: z.array(z.number()).optional(),\n  isGiven: z.boolean().optional(),\n}).refine(\n  cell => !(cell.isGiven && cell.value === undefined),\n  'Given cells must have a digit value',\n);\n\ndescribe('cell schema compound states', () => {\n  const matrix = generateCompoundStateMatrix(['value', 'candidates', 'isGiven']);\n  const template = { value: 5, candidates: [1, 3, 7], isGiven: true };\n\n  for (const entry of matrix) {\n    const input = applyCompoundState(entry, template);\n    const shouldFail = input.isGiven && input.value === undefined;\n\n    it(`${entry.label}: ${shouldFail ? 'rejects' : 'accepts'}`, () => {\n      if (shouldFail) {\n        testInvalidInput(CellSchema, input);  \u002F\u002F Object-level .refine() reports at root path\n      } else {\n        testValidInput(CellSchema, input);\n      }\n    });\n  }\n});\n```\n\n---\n\n## Compound State Matrix Decision\n\n| Optional Fields | Combinations | Testing Approach |\n|-----------------|--------------|------------------|\n| 0-2 | 1-4 | Enumerate manually |\n| 3 | 8 | Use matrix, manageable |\n| 4 | 16 | Use matrix, essential |\n| 5+ | 32+ | Switch to [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) — covers all field pairs in near-minimal test cases |\n\n---\n\n## Violation Rules\n\n### missing_invalid_input_test\nEvery Zod schema MUST have tests for invalid inputs, not just valid ones.\n**Severity**: must-fail\n\n### missing_refinement_coverage\nEvery `.refine()` or `.superRefine()` MUST have tests for both the passing AND failing case.\n**Severity**: must-fail\n\n### missing_compound_state_test\nSchemas with 3+ optional fields SHOULD use compound state matrix. For 5+ fields, switch to [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) rather than testing all 2^N individually.\n**Severity**: should-fail\n\n### schema_not_at_boundary\nZod parsing MUST happen at system boundaries (API handlers, WebSocket messages, database reads), not inside business logic.\n**Severity**: should-fail\n\n### type_assertion_instead_of_parse\nUse `Schema.parse()` or `Schema.safeParse()`, NEVER `as Type` casts for external data.\n**Severity**: must-fail\n\n---\n\n## Companion Skills\n\nThis skill teaches **testing methodology**, not Zod API usage. For broader methodology:\n\n- Search `zod` on [skills.sh](https:\u002F\u002Fskills.sh) for schema authoring, transforms, error handling, and framework integrations\n- Our utilities work with any Zod version (v3, v4) via the `ZodLikeSchema` interface — no version lock-in\n- Schemas with 5+ optional fields produce 32+ combinations — use [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) for near-minimal coverage of all field pairs\n- Schema parsing at boundaries often logs errors — use [observability-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fobservability-testing) to assert structured log output on validation failures\n- Schema evolution testing pairs with resilience — use [fault-injection-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Ffault-injection-testing) for retry and circuit breaker testing around schema-validated endpoints\n\n---\n\n## Quick Reference\n\n| Utility | When | Example |\n|---------|------|---------|\n| `testValidInput` | Verify acceptance | `testValidInput(schema, { name: 'Alice' })` |\n| `testInvalidInput` | Verify rejection | `testInvalidInput(schema, {}, 'name')` |\n| `testSchemaEvolution` | Backward compat | `testSchemaEvolution(newSchema, oldData)` |\n| `generateVersionCompatibilityMatrix` | Version matrix | `generateVersionCompatibilityMatrix(versions)` |\n| `assertVersionCompatibility` | Enforce vN->vN+K | `assertVersionCompatibility(versions, 2)` |\n| `testRefinement` | Pass + fail | `testRefinement(schema, passing, failing, message)` |\n| `generateCompoundStateMatrix` | Optional fields | `generateCompoundStateMatrix(['a', 'b', 'c'])` |\n| `applyCompoundState` | Generate input | `applyCompoundState(entry, template)` |\n\nSee [patterns.md](.\u002Freferences\u002Fpatterns.md) for Zod-specific patterns, boundary testing methodology, and integration with TypeScript strict mode.\n","# Zod Contract Testing\n\nTest schemas at boundaries — not just happy-path inputs.\n\nSchemas define contracts between systems. A schema that accepts invalid data is a security hole. A schema that rejects valid data is a broken integration. This skill teaches you to systematically test schemas at system boundaries.\n\n**When to use**: Testing API request\u002Fresponse schemas, WebSocket message validation, database record parsing, external data ingestion, any Zod schema at a system boundary.\n\n**When not to use**: Internal type assertions, UI component props, type definitions without runtime validation.\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"The type system ensures correctness\" | TypeScript doesn't exist at runtime | Test Zod parsing with real data |\n| \"I tested valid inputs\" | Invalid inputs cause production errors | Test rejection of invalid inputs |\n| \"Refinements are simple\" | `.refine()` failures are easy to miss | Test BOTH passing and failing cases |\n| \"Optional fields are optional\" | 2^N combinations have hidden bugs | Use compound state matrix |\n\n---\n\n## What To Protect (Start Here)\n\nBefore generating schema tests, identify which data integrity decisions apply to your code:\n\n| Decision | Question to Answer | If Yes → Use |\n|----------|--------------------|--------------|\n| Invalid data must be rejected with specific errors | What malformed inputs could reach this boundary? | `testInvalidInput` with `expectedPath` |\n| Schema changes must not break old data | Is there serialized\u002Fstored data in the old format? | `testSchemaEvolution` |\n| Version upgrades must be backward compatible | Do multiple schema versions coexist in production? | `generateVersionCompatibilityMatrix` |\n| Optional field combinations have hidden bugs | Does this schema have 3+ optional fields with interacting refinements? | `generateCompoundStateMatrix` |\n| Refinements must reject specific threats | What invalid-but-plausible input does each `.refine()` guard against? | `testRefinement` |\n\n**Do not generate tests for decisions the human hasn't confirmed.** A schema test that checks \"valid input passes\" without naming the threat it guards against is slop — it'll pass even if the schema accepts everything.\n\n---\n\n## Included Utilities\n\n```typescript\nimport {\n  testValidInput,\n  testInvalidInput,\n  testSchemaEvolution,\n  generateVersionCompatibilityMatrix,\n  assertVersionCompatibility,\n  testRefinement,\n  generateCompoundStateMatrix,\n  formatStateMatrix,\n  applyCompoundState,\n} from '.\u002Fschema-boundary.ts';\n```\n\n## Core Workflow\n\n### Step 1: Test Valid Inputs\n\nVerify the schema accepts all valid input shapes:\n\n```typescript\nimport { z } from 'zod';\n\nconst UserSchema = z.object({\n  name: z.string(),\n  age: z.number().optional(),\n});\n\nit('accepts valid user', () => {\n  testValidInput(UserSchema, { name: 'Alice', age: 30 });\n  testValidInput(UserSchema, { name: 'Bob' });  \u002F\u002F age optional\n});\n```\n\n### Step 2: Test Invalid Inputs\n\nVerify the schema rejects invalid data and errors at the correct path:\n\n```typescript\nit('rejects missing required field', () => {\n  testInvalidInput(UserSchema, {}, 'name');  \u002F\u002F Error at 'name' path\n});\n\nit('rejects wrong type', () => {\n  testInvalidInput(UserSchema, { name: 123 }, 'name');\n});\n\nit('rejects unknown fields with strict schema', () => {\n  const StrictUserSchema = UserSchema.strict();\n  testInvalidInput(StrictUserSchema, { name: 'Alice', role: 'admin' });\n});\n```\n\n### Step 3a: Test Schema Evolution\n\nWhen schemas change, old serialized data must still parse:\n\n```typescript\n\u002F\u002F Old schema: { name: string }\n\u002F\u002F New schema: { name: string, email?: string }\n\nconst NewUserSchema = z.object({\n  name: z.string(),\n  email: z.string().email().optional(),\n});\n\nit('backward compatible with old data', () => {\n  const oldData = { name: 'Alice' };  \u002F\u002F No email field\n  testSchemaEvolution(NewUserSchema, oldData);\n});\n```\n\n### Step 3b: Build Version Compatibility Matrix\n\nFor evolving contracts, check `vN -> vN+1` and `vN -> vN+2` explicitly:\n\n```typescript\nconst versions = [\n  { version: 'v1', schema: V1Schema, fixtures: [v1Payload] },\n  { version: 'v2', schema: V2Schema, fixtures: [v2Payload] },\n  { version: 'v3', schema: V3Schema, fixtures: [v3Payload] },\n];\n\nconst matrix = generateVersionCompatibilityMatrix(versions);\n\n\u002F\u002F Enforce only adjacent upgrades (vN -> vN+1)\nassertVersionCompatibility(versions, 1);\n\n\u002F\u002F Optionally enforce two-hop upgrades (vN -> vN+2)\nassertVersionCompatibility(versions, 2);\n```\n\n### Step 4: Test Refinements\n\nEvery `.refine()` MUST have tests for both passing and failing cases:\n\n```typescript\nconst PositiveNumberSchema = z.object({\n  value: z.number().refine(n => n > 0, 'Value must be positive'),\n});\n\nit('refinement: positive vs non-positive', () => {\n  testRefinement(\n    PositiveNumberSchema,\n    { value: 10 },           \u002F\u002F Passing case\n    { value: -5 },           \u002F\u002F Failing case\n    'must be positive',      \u002F\u002F Expected error message\n  );\n});\n```\n\n### Step 5: Generate Compound State Matrix\n\nFor schemas with N optional fields, there are 2^N possible combinations. For 3-4 fields, test exhaustively. For 5+, switch to pairwise coverage (see decision table below):\n\n```typescript\n\u002F\u002F Cell schema: value?, candidates?, isGiven?\n\u002F\u002F 2^3 = 8 combinations\n\nconst matrix = generateCompoundStateMatrix(['value', 'candidates', 'isGiven']);\nconsole.log(formatStateMatrix(matrix));\n\u002F*\n| # | value | candidates | isGiven | Label |\n|---|-------|------------|---------|-------|\n| 0 | -     | -          | -       | (empty) |\n| 1 | Y     | -          | -       | value |\n| 2 | -     | Y          | -       | candidates |\n| 3 | Y     | Y          | -       | value + candidates |\n| 4 | -     | -          | Y       | isGiven |\n| 5 | Y     | -          | Y       | value + isGiven |\n| 6 | -     | Y          | Y       | candidates + isGiven |\n| 7 | Y     | Y          | Y       | value + candidates + isGiven |\n*\u002F\n```\n\n### Step 6: Apply Matrix to Schema Tests\n\nGenerate test inputs from the matrix:\n\n```typescript\nconst CellSchema = z.object({\n  value: z.number().optional(),\n  candidates: z.array(z.number()).optional(),\n  isGiven: z.boolean().optional(),\n}).refine(\n  cell => !(cell.isGiven && cell.value === undefined),\n  'Given cells must have a digit value',\n);\n\ndescribe('cell schema compound states', () => {\n  const matrix = generateCompoundStateMatrix(['value', 'candidates', 'isGiven']);\n  const template = { value: 5, candidates: [1, 3, 7], isGiven: true };\n\n  for (const entry of matrix) {\n    const input = applyCompoundState(entry, template);\n    const shouldFail = input.isGiven && input.value === undefined;\n\n    it(`${entry.label}: ${shouldFail ? 'rejects' : 'accepts'}`, () => {\n      if (shouldFail) {\n        testInvalidInput(CellSchema, input);  \u002F\u002F Object-level .refine() reports at root path\n      } else {\n        testValidInput(CellSchema, input);\n      }\n    });\n  }\n});\n```\n\n---\n\n## Compound State Matrix Decision\n\n| Optional Fields | Combinations | Testing Approach |\n|-----------------|--------------|------------------|\n| 0-2 | 1-4 | Enumerate manually |\n| 3 | 8 | Use matrix, manageable |\n| 4 | 16 | Use matrix, essential |\n| 5+ | 32+ | Switch to [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) — covers all field pairs in near-minimal test cases |\n\n---\n\n## Violation Rules\n\n### missing_invalid_input_test\nEvery Zod schema MUST have tests for invalid inputs, not just valid ones.\n**Severity**: must-fail\n\n### missing_refinement_coverage\nEvery `.refine()` or `.superRefine()` MUST have tests for both the passing AND failing case.\n**Severity**: must-fail\n\n### missing_compound_state_test\nSchemas with 3+ optional fields SHOULD use compound state matrix. For 5+ fields, switch to [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) rather than testing all 2^N individually.\n**Severity**: should-fail\n\n### schema_not_at_boundary\nZod parsing MUST happen at system boundaries (API handlers, WebSocket messages, database reads), not inside business logic.\n**Severity**: should-fail\n\n### type_assertion_instead_of_parse\nUse `Schema.parse()` or `Schema.safeParse()`, NEVER `as Type` casts for external data.\n**Severity**: must-fail\n\n---\n\n## Companion Skills\n\nThis skill teaches **testing methodology**, not Zod API usage. For broader methodology:\n\n- Search `zod` on [skills.sh](https:\u002F\u002Fskills.sh) for schema authoring, transforms, error handling, and framework integrations\n- Our utilities work with any Zod version (v3, v4) via the `ZodLikeSchema` interface — no version lock-in\n- Schemas with 5+ optional fields produce 32+ combinations — use [pairwise-test-coverage](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fpairwise-test-coverage) for near-minimal coverage of all field pairs\n- Schema parsing at boundaries often logs errors — use [observability-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fobservability-testing) to assert structured log output on validation failures\n- Schema evolution testing pairs with resilience — use [fault-injection-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Ffault-injection-testing) for retry and circuit breaker testing around schema-validated endpoints\n\n---\n\n## Quick Reference\n\n| Utility | When | Example |\n|---------|------|---------|\n| `testValidInput` | Verify acceptance | `testValidInput(schema, { name: 'Alice' })` |\n| `testInvalidInput` | Verify rejection | `testInvalidInput(schema, {}, 'name')` |\n| `testSchemaEvolution` | Backward compat | `testSchemaEvolution(newSchema, oldData)` |\n| `generateVersionCompatibilityMatrix` | Version matrix | `generateVersionCompatibilityMatrix(versions)` |\n| `assertVersionCompatibility` | Enforce vN->vN+K | `assertVersionCompatibility(versions, 2)` |\n| `testRefinement` | Pass + fail | `testRefinement(schema, passing, failing, message)` |\n| `generateCompoundStateMatrix` | Optional fields | `generateCompoundStateMatrix(['a', 'b', 'c'])` |\n| `applyCompoundState` | Generate input | `applyCompoundState(entry, template)` |\n\nSee [patterns.md](.\u002Freferences\u002Fpatterns.md) for Zod-specific patterns, boundary testing methodology, and integration with TypeScript strict mode.\n",{"name":5,"description":7},"main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":49,"prompt":59,"zipAvailable":60},[50,53,56],{"tool":51,"command":52},"npx","npx skills add JSGforever\u002Fskillguard --skill zod-contract-testing",{"tool":54,"command":55},"bunx","bunx skills add JSGforever\u002Fskillguard --skill zod-contract-testing",{"tool":57,"command":58},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill zod-contract-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing\u002FSKILL.md",true,[62,68,74],{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fpatterns.md","REFERENCE","参考文档",1679,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing\u002Freferences\u002Fpatterns.md",{"path":69,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":72,"sourceHtmlUrl":73},"schema-boundary.spec.ts","SCRIPT","脚本",16435,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing\u002Fschema-boundary.spec.ts",{"path":75,"resourceType":70,"resourceTypeDesc":71,"sizeBytes":76,"sourceHtmlUrl":77},"schema-boundary.ts",11285,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--zod-contract-testing\u002Fschema-boundary.ts",[79,106,117,144,163,183],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":36},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[],[86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","when","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":110,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":36},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[],[114,115,116],"data","data exfiltrator","files",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":36},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer","react","streaming",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":36},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[],[133,151,141,142,152,153,154,155,156,157,124,158,159,137,139,160,140,143,161,162],"react performance optimizer","react performance","performance optimizer","app","nextjs","expert","re","render","2025","code","router","strategies",{"skillNo":164,"name":165,"nameZh":6,"description":166,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":167,"categories":168,"keywords":169,"publishedAt":36},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[],[170,143,171,172,173,174,133,124,175,176,177,139,140,141,178,142,179,180,181,182],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","server","read",{"skillNo":184,"name":185,"nameZh":6,"description":186,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":187,"categories":188,"keywords":189,"publishedAt":36},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[],[190,191,192,193,194,195,196,131,156,18,197,198,140,162,199,182,200,201,202,203],"github actions pipeline builder","actions","github actions","pipeline builder","github","builder","pipeline","ci","workflows","run","release","write","edit","git"]