[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77K7JQECPNZTHRYCZ6TB7SB":3,"skill-same:01M77K7JQECPNZTHRYCZ6TB7SB":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M77K7JQECPNZTHRYCZ6TB7SB","unit-test-generator",null,"Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.","jimbou\u002Fskillrace","jimbou","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F75038393?v=4","01M77K3V3GXQ0ZPCK28XKBMFXZ","Dimitrios Stamatios Bouras","01M77K3V49X9CT44G1T1KN621T",0,"CC0-1.0","https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: unit-test-generator\ndescription: Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.\nlicense: CC0-1.0\n---\n\n# Unit Test Generator\n\n> 根据源代码自动生成单元测试，支持多种语言和测试框架。\n>\n> Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.\n\n## When to Use\n\n当用户请求以下操作时使用此 skill：\n- 生成单元测试 \u002F Generate unit tests\n- 为函数\u002F类编写测试 \u002F Write tests for functions\u002Fclasses\n- 创建测试用例 \u002F Create test cases\n- 提高代码覆盖率 \u002F Improve code coverage\n\n## Instructions\n\n### 分析步骤 \u002F Analysis Steps\n\n1. **识别代码** - 确定编程语言和代码结构\n2. **分析功能** - 理解函数\u002F方法的输入、输出和行为\n3. **确定边界** - 识别边界条件和边缘情况\n4. **选择框架** - 根据语言选择合适的测试框架\n5. **生成测试** - 编写全面的测试用例\n\n### 支持的语言和框架 \u002F Supported Languages\n\n| 语言 | 测试框架 |\n|------|----------|\n| Python | pytest, unittest |\n| JavaScript\u002FTypeScript | Jest, Mocha, Vitest |\n| Java | JUnit, TestNG |\n| Go | testing (built-in) |\n| Rust | cargo test (built-in) |\n\n### 测试类型 \u002F Test Types\n\n- **正常路径测试** - 验证预期行为\n- **边界条件测试** - 测试边界值\n- **异常处理测试** - 验证错误处理\n- **空值\u002F空输入测试** - 处理空值情况\n\n### 输出格式 \u002F Output Format\n\n使用 `templates\u002Ftest-report.md` 模板格式化输出。\n\nUse the `templates\u002Ftest-report.md` template to format output.\n\n```markdown\n## 单元测试生成报告 \u002F Unit Test Generation Report\n\n### 分析概述 \u002F Analysis Summary\n[代码分析总结]\n\n### 生成的测试 \u002F Generated Tests\n[测试代码]\n\n### 测试覆盖说明 \u002F Coverage Notes\n- 覆盖的场景\n- 建议补充的测试\n```\n\n## Examples\n\n### 输入 \u002F Input\n\n```python\ndef divide(a: float, b: float) -> float:\n    if b == 0:\n        raise ValueError(\"Cannot divide by zero\")\n    return a \u002F b\n```\n\n### 输出 \u002F Output\n\n## 单元测试生成报告\n\n### 分析概述\n`divide` 函数执行除法运算，包含除零检查。需要测试正常除法、除零异常、边界值等情况。\n\n### 生成的测试\n\n```python\nimport pytest\nfrom your_module import divide\n\nclass TestDivide:\n    \"\"\"Tests for the divide function.\"\"\"\n\n    def test_divide_positive_numbers(self):\n        \"\"\"Test division of positive numbers.\"\"\"\n        assert divide(10, 2) == 5.0\n        assert divide(7, 2) == 3.5\n\n    def test_divide_negative_numbers(self):\n        \"\"\"Test division with negative numbers.\"\"\"\n        assert divide(-10, 2) == -5.0\n        assert divide(10, -2) == -5.0\n        assert divide(-10, -2) == 5.0\n\n    def test_divide_by_zero_raises_error(self):\n        \"\"\"Test that dividing by zero raises ValueError.\"\"\"\n        with pytest.raises(ValueError, match=\"Cannot divide by zero\"):\n            divide(10, 0)\n\n    def test_divide_zero_numerator(self):\n        \"\"\"Test division when numerator is zero.\"\"\"\n        assert divide(0, 5) == 0.0\n\n    def test_divide_float_precision(self):\n        \"\"\"Test division with floating point numbers.\"\"\"\n        assert divide(1, 3) == pytest.approx(0.333333, rel=1e-5)\n```\n\n### 测试覆盖说明\n- ✅ 正常正数除法\n- ✅ 负数除法\n- ✅ 除零异常\n- ✅ 分子为零\n- ✅ 浮点精度\n","# Unit Test Generator\n\n> 根据源代码自动生成单元测试，支持多种语言和测试框架。\n>\n> Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.\n\n## When to Use\n\n当用户请求以下操作时使用此 skill：\n- 生成单元测试 \u002F Generate unit tests\n- 为函数\u002F类编写测试 \u002F Write tests for functions\u002Fclasses\n- 创建测试用例 \u002F Create test cases\n- 提高代码覆盖率 \u002F Improve code coverage\n\n## Instructions\n\n### 分析步骤 \u002F Analysis Steps\n\n1. **识别代码** - 确定编程语言和代码结构\n2. **分析功能** - 理解函数\u002F方法的输入、输出和行为\n3. **确定边界** - 识别边界条件和边缘情况\n4. **选择框架** - 根据语言选择合适的测试框架\n5. **生成测试** - 编写全面的测试用例\n\n### 支持的语言和框架 \u002F Supported Languages\n\n| 语言 | 测试框架 |\n|------|----------|\n| Python | pytest, unittest |\n| JavaScript\u002FTypeScript | Jest, Mocha, Vitest |\n| Java | JUnit, TestNG |\n| Go | testing (built-in) |\n| Rust | cargo test (built-in) |\n\n### 测试类型 \u002F Test Types\n\n- **正常路径测试** - 验证预期行为\n- **边界条件测试** - 测试边界值\n- **异常处理测试** - 验证错误处理\n- **空值\u002F空输入测试** - 处理空值情况\n\n### 输出格式 \u002F Output Format\n\n使用 `templates\u002Ftest-report.md` 模板格式化输出。\n\nUse the `templates\u002Ftest-report.md` template to format output.\n\n```markdown\n## 单元测试生成报告 \u002F Unit Test Generation Report\n\n### 分析概述 \u002F Analysis Summary\n[代码分析总结]\n\n### 生成的测试 \u002F Generated Tests\n[测试代码]\n\n### 测试覆盖说明 \u002F Coverage Notes\n- 覆盖的场景\n- 建议补充的测试\n```\n\n## Examples\n\n### 输入 \u002F Input\n\n```python\ndef divide(a: float, b: float) -> float:\n    if b == 0:\n        raise ValueError(\"Cannot divide by zero\")\n    return a \u002F b\n```\n\n### 输出 \u002F Output\n\n## 单元测试生成报告\n\n### 分析概述\n`divide` 函数执行除法运算，包含除零检查。需要测试正常除法、除零异常、边界值等情况。\n\n### 生成的测试\n\n```python\nimport pytest\nfrom your_module import divide\n\nclass TestDivide:\n    \"\"\"Tests for the divide function.\"\"\"\n\n    def test_divide_positive_numbers(self):\n        \"\"\"Test division of positive numbers.\"\"\"\n        assert divide(10, 2) == 5.0\n        assert divide(7, 2) == 3.5\n\n    def test_divide_negative_numbers(self):\n        \"\"\"Test division with negative numbers.\"\"\"\n        assert divide(-10, 2) == -5.0\n        assert divide(10, -2) == -5.0\n        assert divide(-10, -2) == 5.0\n\n    def test_divide_by_zero_raises_error(self):\n        \"\"\"Test that dividing by zero raises ValueError.\"\"\"\n        with pytest.raises(ValueError, match=\"Cannot divide by zero\"):\n            divide(10, 0)\n\n    def test_divide_zero_numerator(self):\n        \"\"\"Test division when numerator is zero.\"\"\"\n        assert divide(0, 5) == 0.0\n\n    def test_divide_float_precision(self):\n        \"\"\"Test division with floating point numbers.\"\"\"\n        assert divide(1, 3) == pytest.approx(0.333333, rel=1e-5)\n```\n\n### 测试覆盖说明\n- ✅ 正常正数除法\n- ✅ 负数除法\n- ✅ 除零异常\n- ✅ 分子为零\n- ✅ 浮点精度\n",{"name":5,"license":15,"description":7},"main","563b999846bcd88b8373821bd979061a6920cd76","skills\u002Funit-test-generator","https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace","https:\u002F\u002Fgithub.com\u002Fjimbou","2026-07-23 17:50:09",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add jimbou\u002Fskillrace --skill unit-test-generator",{"tool":36,"command":37},"bunx","bunx skills add jimbou\u002Fskillrace --skill unit-test-generator",{"tool":39,"command":40},"pnpm","pnpm dlx skills add jimbou\u002Fskillrace --skill unit-test-generator","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002FSKILL.md",true,[44,50,56,60,64],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"applicability.json","REFERENCE","参考文档",331,"https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002Fapplicability.json",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"Containerfile.base","OTHER","其他",305,"https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002FContainerfile.base",{"path":57,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":58,"sourceHtmlUrl":59},"properties.json",368,"https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002Fproperties.json",{"path":61,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":62,"sourceHtmlUrl":63},"PROVENANCE.md",266,"https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002FPROVENANCE.md",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"repo\u002FREADME.md",12,"https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Funit-test-generator\u002Frepo\u002FREADME.md",[69],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":73,"licenseFileUrl":74,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M77K5CFVCVV6GDZBJ25F53R5","condition-based-waiting","Use when tests have race conditions, timing dependencies, or inconsistent pass\u002Ffail behavior - replaces arbitrary timeouts with condition polling to wait for actual state changes, eliminating flaky tests from timing guesses","MIT","https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Fcondition-based-waiting\u002FLICENSE.upstream","https:\u002F\u002Fgithub.com\u002Fjimbou\u002Fskillrace\u002Fblob\u002Fmain\u002Fskills\u002Fcondition-based-waiting\u002FSKILL.md",[],[]]