Agent skill · Testing & QA

unit-test-generator

Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.

JackyST0github.com/JackyST0GitHub ↗
claude-codecopilotcursorCC0-1.0
Install
npx skills add JackyST0/awesome-agent-skills --skill unit-test-generator --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 3 KB
Bundled scripts: none
Path: examples/unit-test-generator/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 613
Language: Shell

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Unit Test Generator > 根据源代码自动生成单元测试,支持多种语言和测试框架。 > > Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks. ## When to Use 当用户请求以下操作时使用此 skill: - 生成单元测试 / Generate unit tests - 为函数/类编写测试 / Write tests for functions/classes - 创建测试用例 / Create test cases - 提高代码覆盖率 / Improve code coverage ## Instructions ### 分析步骤 / Analysis Steps 1. **识别代码** - 确定编程语言和代码结构 2. **分析功能** - 理解函数/方法的输入、输出和行为 3. **确定边界** - 识别边界条件和边缘情况 4. **选择框架** - 根据语言选择合适的测试框架 5. **生成测试** - 编写全面的测试用例 ### 支持的语言和框架 / Supported Languages | 语言 | 测试框架 | |------|----------| | Python | pytest, unittest | | JavaScript/TypeScript | Jest, Mocha, Vitest | | Java | JUnit, TestNG | | Go | testing (built-in) | | Rust | cargo test (built-in) | ### 测试类型 / Test Types - **正常路径测试** - 验证预期行为 - **边界条件测试** - 测试边界值 - **异常处理测试** - 验证错误处理 - **空值/空输入测试** - 处理空值情况 ### 输出格式 / Output Format 使用 `templates/test-report.md` 模板格式化输出。 Use the `templates/test-report.md` template to format output. ```markdown ## 单元测试生成报告 / Unit Test Generation Report ### 分析概述 / Analysis Summary [代码分析总结] ### 生成的测试 / Generated Tests [测试代码] ### 测试覆盖说明 / Coverage Notes - 覆盖的场景 - 建议补充的测试 ``` ## Examples ### 输入 / Input ```pyth

What's inside
Steps it walks through
  1. When to Use
  2. Instructions
  3. 分析步骤 / Analysis Steps
  4. 支持的语言和框架 / Supported Languages
  5. 测试类型 / Test Types
  6. 输出格式 / Output Format
  7. Examples
  8. 输入 / Input
  9. 输出 / Output
  10. 单元测试生成报告
  11. 分析概述
  12. 生成的测试
  13. 测试覆盖说明
Ships with 1 file
  • templates/test-report.md
More from awesome-agent-skills
All skills →
About this skill
What does the unit-test-generator skill do?

Automatically generate unit tests based on source code, supporting multiple languages and testing frameworks.

How do I install it?

Run `npx skills add JackyST0/awesome-agent-skills --skill unit-test-generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From JackyST0/awesome-agent-skills, a repository with 613 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going