[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75W3PX5DJCFB7VNESC9X2CQ":3,"skill-same:01M75W3PX5DJCFB7VNESC9X2CQ":46},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M75W3PX5DJCFB7VNESC9X2CQ","test-generation",null,"ItWasYou-SAM\u002FSkill-is-All-you-Need","ItWasYou-SAM","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255364315?v=4","01M75VMN2DKTF5V9QPG2D5PBY0","Sam","01M75VMN31FCZMM9RZ4W8ZHCR4",6,"MIT","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F06-code-quality\u002Ftest-generation\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: test-generation\ndescription: >\n  Use this skill when writing unit, integration, regression, or end-to-end tests for existing code.\n  Do not use for performance benchmarking or observability setup.\ntriggers:\n  - \"write tests for this\"\n  - \"add regression tests\"\n  - \"create test suite\" Use this when asked to write unit, integration, regression, or end-to-end tests. Do not use for performance benchmarking or observability setup.\n---\n\n# Test Generation\n\n## Goal\nProduce high-signal tests that verify behavior and catch regressions.\n\n## When to use\n- Writing unit, integration, or E2E tests\n- Adding regression tests for known bugs\n- Covering edge cases and failure paths\n- Creating test plans for new features\n- Improving test coverage\n\n## When not to use\n- Performance benchmarking or load testing\n- Observability or monitoring setup\n- TDD methodology guidance (use test-driven-development)\n- Production incident response\n\n## Process\n1. Identify behavior under test.\n2. Choose the right test level.\n3. Cover happy path, failures, and edge cases.\n4. Prefer deterministic inputs and assertions.\n5. Add regression cases for known bugs.\n6. Note required fixtures or mocks.\n\n## Framework-specific patterns\n\n### Jest \u002F Vitest\n```typescript\nbeforeEach(() => {\n  jest.resetModules()\n  jest.clearAllMocks()\n})\n\njest.useFakeTimers()\njest.advanceTimersByTime(1000)\n\nexpect(component).toMatchInlineSnapshot(`\n  \u003Cdiv>\n    \u003Ch1>Hello\u003C\u002Fh1>\n  \u003C\u002Fdiv>\n`)\n```\n\n### pytest\n```python\n@pytest.fixture\ndef db():\n    conn = create_connection()\n    yield conn\n    conn.close()\n\n@pytest.mark.parametrize(\"input,expected\", [\n    (\"hello\", \"HELLO\"),\n    (\"\", \"\"),\n    (\"123\", \"123\"),\n])\ndef test_uppercase(input, expected):\n    assert uppercase(input) == expected\n\ndef test_api_call(monkeypatch):\n    monkeypatch.setattr(\"requests.get\", mock_get)\n    result = fetch_data()\n    assert result == expected\n```\n\n### Go\n```go\nfunc TestAdd(t *testing.T) {\n    tests := []struct {\n        name     string\n        a, b     int\n        expected int\n    }{\n        {\"positive\", 1, 2, 3},\n        {\"zero\", 0, 0, 0},\n        {\"negative\", -1, -2, -3},\n    }\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            if got := Add(tt.a, tt.b); got != tt.expected {\n                t.Errorf(\"Add(%d, %d) = %d, want %d\", tt.a, tt.b, got, tt.expected)\n            }\n        })\n    }\n}\n```\n\n## Fixture strategy\n\n| Fixture Type | When to Use | Example |\n|--------------|-------------|---------|\n| Inline | Simple, self-contained | `{ name: \"test\" }` |\n| Factory | Multiple similar objects | `createUser(overrides)` |\n| Snapshot | Complex output verification | `toMatchSnapshot()` |\n| Database | Stateful tests | `setUpTestData()` |\n| External service | API integration | Wiremock, VCR |\n\n## Flaky test anti-patterns\n\n| Anti-Pattern | Why It's Flaky | Fix |\n|--------------|----------------|-----|\n| `sleep()` for timing | Race conditions | Event-based waits |\n| Shared mutable state | Test order dependency | Isolate state per test |\n| Real network calls | External dependency | Mock or use VCR |\n| System time dependency | Time zone, DST issues | Mock `Date.now()` |\n| Random data | Non-deterministic | Seed random generators |\n| Parallel test interference | File\u002FDB conflicts | Unique resources per test |\n\n## Output format\n- Test target\n- Level\n- Cases\n- Missing setup\n- Proposed tests\n","# Test Generation\n\n## Goal\nProduce high-signal tests that verify behavior and catch regressions.\n\n## When to use\n- Writing unit, integration, or E2E tests\n- Adding regression tests for known bugs\n- Covering edge cases and failure paths\n- Creating test plans for new features\n- Improving test coverage\n\n## When not to use\n- Performance benchmarking or load testing\n- Observability or monitoring setup\n- TDD methodology guidance (use test-driven-development)\n- Production incident response\n\n## Process\n1. Identify behavior under test.\n2. Choose the right test level.\n3. Cover happy path, failures, and edge cases.\n4. Prefer deterministic inputs and assertions.\n5. Add regression cases for known bugs.\n6. Note required fixtures or mocks.\n\n## Framework-specific patterns\n\n### Jest \u002F Vitest\n```typescript\nbeforeEach(() => {\n  jest.resetModules()\n  jest.clearAllMocks()\n})\n\njest.useFakeTimers()\njest.advanceTimersByTime(1000)\n\nexpect(component).toMatchInlineSnapshot(`\n  \u003Cdiv>\n    \u003Ch1>Hello\u003C\u002Fh1>\n  \u003C\u002Fdiv>\n`)\n```\n\n### pytest\n```python\n@pytest.fixture\ndef db():\n    conn = create_connection()\n    yield conn\n    conn.close()\n\n@pytest.mark.parametrize(\"input,expected\", [\n    (\"hello\", \"HELLO\"),\n    (\"\", \"\"),\n    (\"123\", \"123\"),\n])\ndef test_uppercase(input, expected):\n    assert uppercase(input) == expected\n\ndef test_api_call(monkeypatch):\n    monkeypatch.setattr(\"requests.get\", mock_get)\n    result = fetch_data()\n    assert result == expected\n```\n\n### Go\n```go\nfunc TestAdd(t *testing.T) {\n    tests := []struct {\n        name     string\n        a, b     int\n        expected int\n    }{\n        {\"positive\", 1, 2, 3},\n        {\"zero\", 0, 0, 0},\n        {\"negative\", -1, -2, -3},\n    }\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            if got := Add(tt.a, tt.b); got != tt.expected {\n                t.Errorf(\"Add(%d, %d) = %d, want %d\", tt.a, tt.b, got, tt.expected)\n            }\n        })\n    }\n}\n```\n\n## Fixture strategy\n\n| Fixture Type | When to Use | Example |\n|--------------|-------------|---------|\n| Inline | Simple, self-contained | `{ name: \"test\" }` |\n| Factory | Multiple similar objects | `createUser(overrides)` |\n| Snapshot | Complex output verification | `toMatchSnapshot()` |\n| Database | Stateful tests | `setUpTestData()` |\n| External service | API integration | Wiremock, VCR |\n\n## Flaky test anti-patterns\n\n| Anti-Pattern | Why It's Flaky | Fix |\n|--------------|----------------|-----|\n| `sleep()` for timing | Race conditions | Event-based waits |\n| Shared mutable state | Test order dependency | Isolate state per test |\n| Real network calls | External dependency | Mock or use VCR |\n| System time dependency | Time zone, DST issues | Mock `Date.now()` |\n| Random data | Non-deterministic | Seed random generators |\n| Parallel test interference | File\u002FDB conflicts | Unique resources per test |\n\n## Output format\n- Test target\n- Level\n- Cases\n- Missing setup\n- Proposed tests\n",{},"master","f0b9a39cdf4f3e791e3acb54c8740ca23f704176","06-code-quality\u002Ftest-generation",0,"https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM","https:\u002F\u002Fit-was-you-sam.vercel.app\u002F","AI Engineer ","2026-11-10 22:32:18",{"source":7,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add ItWasYou-SAM\u002FSkill-is-All-you-Need --skill test-generation",{"tool":38,"command":39},"bunx","bunx skills add ItWasYou-SAM\u002FSkill-is-All-you-Need --skill test-generation",{"tool":41,"command":42},"pnpm","pnpm dlx skills add ItWasYou-SAM\u002FSkill-is-All-you-Need --skill test-generation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F06-code-quality\u002Ftest-generation\u002FSKILL.md",true,[],[47,54,61,68,74,80],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":18},"01M75WFD9BZ3S2ZDECD86QP3T9","invoice-organizer","Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and sorting them into logical folders. Turns hours of manual bookkeeping into minutes of automated organization.","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F12-business-productivity\u002Finvoice-organizer\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M75WF96VTQYB6FHW43DK9JZ3","file-organizer","Intelligently organizes your files and folders across your computer by understanding context, finding duplicates, suggesting better structures, and automating cleanup tasks. Reduces cognitive load and keeps your digital workspace tidy without manual effort.","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F12-business-productivity\u002Ffile-organizer\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M75WF5VR42JXJZ5N6152R4P6","developer-growth-analysis","Analyzes your recent Claude Code chat history to identify coding patterns, development gaps, and areas for improvement, curates relevant learning resources from HackerNews, and automatically sends a personalized growth report to your Slack DMs.","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F12-business-productivity\u002Fdeveloper-growth-analysis\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"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":71,"categories":72,"keywords":73,"publishedAt":18},"01M75WF4PKRDZMHWSC90FVJM1R","connect","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F12-business-productivity\u002Fconnect\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"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":77,"categories":78,"keywords":79,"publishedAt":18},"01M75WF1H9N7Y1C5V6TM397ZGJ","twitter-algorithm-optimizer","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F11-brand-marketing\u002Ftwitter-algorithm-optimizer\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"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":83,"categories":84,"keywords":85,"publishedAt":18},"01M75WEZGF264KM1G13P0CTY4C","tailored-resume-generator","https:\u002F\u002Fgithub.com\u002FItWasYou-SAM\u002FSkill-is-All-you-Need\u002Fblob\u002Fmaster\u002F11-brand-marketing\u002Ftailored-resume-generator\u002FSKILL.md",[],[]]