[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EEZPARDVM5P9VX4SJ2WV8Z":3,"skill-same:01M6EEZPARDVM5P9VX4SJ2WV8Z":53},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6EEZPARDVM5P9VX4SJ2WV8Z","fast-check",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ffast-check\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24,25],"fast","check","fast check","2026-11-10 10:12:30",false,"# fast-check\n\n## Overview\n\nfast-check is a property-based testing framework — instead of writing specific test cases, you describe properties that should always hold, and fast-check generates thousands of random inputs to try to break them. When it finds a failing input, it automatically shrinks it to the minimal reproducing case. Catches edge cases you'd never think to test: empty strings, negative numbers, Unicode, massive arrays, boundary values.\n\n## When to Use\n\n- Functions with many possible inputs (parsers, validators, serializers)\n- Finding edge cases in business logic (pricing, permissions, date handling)\n- Testing serialization\u002Fdeserialization roundtrips (encode → decode = original)\n- Verifying mathematical properties (commutativity, associativity)\n- Replacing hand-written test cases with generated ones\n\n## Instructions\n\n### Setup\n\n```bash\nnpm install -D fast-check\n```\n\n### Basic Properties\n\n```typescript\n\u002F\u002F math.test.ts — Property-based testing for math functions\nimport fc from \"fast-check\";\nimport { describe, it, expect } from \"vitest\";\n\ndescribe(\"sort\", () => {\n  it(\"should produce an array of same length\", () => {\n    fc.assert(\n      fc.property(fc.array(fc.integer()), (arr) => {\n        const sorted = [...arr].sort((a, b) => a - b);\n        return sorted.length === arr.length;\n      })\n    );\n  });\n\n  it(\"should produce ordered output\", () => {\n    fc.assert(\n      fc.property(fc.array(fc.integer()), (arr) => {\n        const sorted = [...arr].sort((a, b) => a - b);\n        for (let i = 1; i \u003C sorted.length; i++) {\n          expect(sorted[i]).toBeGreaterThanOrEqual(sorted[i - 1]);\n        }\n      })\n    );\n  });\n\n  it(\"should contain the same elements\", () => {\n    fc.assert(\n      fc.property(fc.array(fc.integer()), (arr) => {\n        const sorted = [...arr].sort((a, b) => a - b);\n        expect(sorted).toEqual(expect.arrayContaining(arr));\n        expect(arr).toEqual(expect.arrayContaining(sorted));\n      })\n    );\n  });\n});\n```\n\n### Roundtrip Testing\n\n```typescript\n\u002F\u002F serialization.test.ts — Encode\u002Fdecode roundtrips\nimport fc from \"fast-check\";\nimport { encode, decode } from \".\u002Fmy-codec\";\n\nit(\"decode(encode(x)) === x for any string\", () => {\n  fc.assert(\n    fc.property(fc.string(), (original) => {\n      const encoded = encode(original);\n      const decoded = decode(encoded);\n      expect(decoded).toEqual(original);\n    })\n  );\n});\n\nit(\"JSON roundtrip preserves data\", () => {\n  fc.assert(\n    fc.property(fc.jsonValue(), (value) => {\n      const json = JSON.stringify(value);\n      const parsed = JSON.parse(json);\n      expect(parsed).toEqual(value);\n    })\n  );\n});\n```\n\n### Custom Arbitraries\n\n```typescript\n\u002F\u002F business.test.ts — Custom data generators for domain objects\nimport fc from \"fast-check\";\n\n\u002F\u002F Generate realistic user objects\nconst userArbitrary = fc.record({\n  id: fc.uuid(),\n  name: fc.string({ minLength: 1, maxLength: 100 }),\n  email: fc.emailAddress(),\n  age: fc.integer({ min: 13, max: 120 }),\n  role: fc.constantFrom(\"admin\", \"user\", \"viewer\"),\n  createdAt: fc.date({ min: new Date(\"2020-01-01\"), max: new Date() }),\n});\n\n\u002F\u002F Generate realistic money amounts\nconst moneyArbitrary = fc.record({\n  amount: fc.integer({ min: 0, max: 1_000_000 }),  \u002F\u002F Cents\n  currency: fc.constantFrom(\"USD\", \"EUR\", \"GBP\"),\n});\n\nit(\"discount should never result in negative price\", () => {\n  fc.assert(\n    fc.property(\n      moneyArbitrary,\n      fc.integer({ min: 0, max: 100 }),  \u002F\u002F Discount percentage\n      (price, discountPercent) => {\n        const discounted = applyDiscount(price, discountPercent);\n        expect(discounted.amount).toBeGreaterThanOrEqual(0);\n      }\n    )\n  );\n});\n\nit(\"total should equal sum of line items\", () => {\n  fc.assert(\n    fc.property(\n      fc.array(moneyArbitrary, { minLength: 1, maxLength: 50 }),\n      (items) => {\n        const total = calculateTotal(items);\n        const expected = items.reduce((sum, item) => sum + item.amount, 0);\n        expect(total).toBe(expected);\n      }\n    )\n  );\n});\n```\n\n### Shrinking (Automatic Minimal Reproduction)\n\n```typescript\n\u002F\u002F When a property fails, fast-check automatically finds the SMALLEST failing input\n\nit(\"handles edge cases in URL parsing\", () => {\n  fc.assert(\n    fc.property(fc.webUrl(), (url) => {\n      const parsed = parseUrl(url);\n      expect(parsed.protocol).toBeTruthy();\n      \u002F\u002F If this fails on a complex URL, fast-check shrinks it to\n      \u002F\u002F the simplest URL that still fails, e.g., \"http:\u002F\u002Fa\"\n    })\n  );\n});\n```\n\n## Examples\n\n### Example 1: Test a parser for edge cases\n\n**User prompt:** \"My CSV parser breaks on weird inputs. Find all the edge cases.\"\n\nThe agent will write properties like \"parse(serialize(data)) === data\", generate random CSV data with edge cases (commas in fields, newlines, empty cells, Unicode), and identify failing inputs.\n\n### Example 2: Verify pricing logic\n\n**User prompt:** \"Test our discount calculation to make sure it never produces negative prices or rounding errors.\"\n\nThe agent will generate random prices, discount percentages, and coupon combinations, then verify invariants (non-negative, correct rounding, order doesn't matter).\n\n## Guidelines\n\n- **Think in properties, not examples** — \"sorted output is ordered\" not \"sort([3,1,2]) = [1,2,3]\"\n- **Roundtrip is the easiest property** — `decode(encode(x)) === x`\n- **`fc.assert` runs 100 iterations by default** — increase with `{ numRuns: 1000 }`\n- **Shrinking is automatic** — failed inputs are minimized to the simplest case\n- **Built-in arbitraries cover most needs** — `string`, `integer`, `array`, `record`, `date`, `uuid`, `emailAddress`\n- **`constantFrom` for enums** — `fc.constantFrom(\"a\", \"b\", \"c\")`\n- **`fc.pre(condition)` for preconditions** — skip inputs that don't meet criteria\n- **Combine with example-based tests** — properties find unknowns, examples verify knowns\n- **Seed for reproducibility** — failed runs print a seed; re-run with same seed to reproduce\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FTerminalSkills\u002Fskills\u002Ffast-check",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill fast-check",{"tool":45,"command":46},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill fast-check",{"tool":48,"command":49},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill fast-check","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FTerminalSkills\u002Fskills\u002Ffast-check\u002FSKILL.md",true,[],[54,66,76,85,91,98],{"skillNo":55,"name":56,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":62,"publishedAt":26},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[59],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[63,64,65],"model","model hierarchy","model hierarchy skill",{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":72,"publishedAt":26},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[71],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},[73,74,75],"MCP","zoom","zoom mcp",{"skillNo":77,"name":78,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":26},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[82,83,84,74],"sdk","zoom apps sdk","apps",{"skillNo":86,"name":87,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":26},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[87],{"skillNo":92,"name":93,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":97,"publishedAt":26},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[96],{"categoryNo":60,"categoryName":61,"taxonomyType":20,"taxonomyTypeDesc":21},[93],{"skillNo":99,"name":100,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":26},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[100]]