Borrowing it
Nothing to install: this file belongs to zhangloveyan/backend-skill. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/zhangloveyan/backend-skill/main/.claude/skills/proj-gen-test/SKILL.mdgit clone --depth 1 https://github.com/zhangloveyan/backend-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/zhangloveyan/backend-skill/proj-gen-test)<a href="https://agentmods.dev/skills/zhangloveyan/backend-skill/proj-gen-test"><img src="https://agentmods.dev/badge/skills/zhangloveyan/backend-skill/proj-gen-test/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/zhangloveyan/backend-skill/proj-gen-test"><img src="https://agentmods.dev/badge/skills/zhangloveyan/backend-skill/proj-gen-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.00806 |
| Opus 5.5 | $0.00013 | $0.00322 |
| Sonnet 5.5 | $0.00006 | $0.00161 |
| Haiku 4.5 | $0.00003 | $0.00081 |
Grade A, and why
proj-gen-test scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
生成测试代码
适用场景
- 为 Service 层生成单元测试
- 为 Controller 层生成单元测试
- 为完整流程生成集成测试
- 提高测试覆盖率
测试类型选择
| 类型 | 场景 | 特点 |
|---|---|---|
| 单元测试 | 测试单个方法逻辑 | 快速、Mock 依赖 |
| 集成测试 | 测试完整流程 | 真实数据库、慢 |
建议: 核心业务逻辑用单元测试,关键流程用集成测试。
测试框架
| 框架 | 用途 |
|---|---|
| JUnit 5 | 测试框架 |
| Mockito | Mock 框架 |
| AssertJ | 断言库 |
| SpringBootTest | 集成测试 |
前置检查
生成测试前,先确认任务文档:
- 全流程任务文档存在
- “代码审查”已完成
- 将“生成测试”状态标记为进行中
生成测试前,检查目标模块的 pom.xml 是否包含测试依赖:
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
如缺失,自动添加到 pom.xml 的 <dependencies> 中,然后再生成测试代码。
测试模板
测试命名规范
方法名_场景_预期结果
示例:
- create_Success
- create_DuplicateName_ThrowException
- getDetail_Found
- getDetail_NotFound_ThrowException
- update_Success
- delete_NotFound_ThrowException
测试原则
- 单一职责 - 每个测试只测一个场景
- 独立性 - 测试之间互不依赖
- 可重复 - 多次运行结果一致
- 自验证 - 测试自动判断通过/失败
- 及时性 - 与代码同步编写
测试覆盖要求
| 层级 | 覆盖要求 |
|---|---|
| Service | 核心业务逻辑 100% |
| Controller | 主要接口 80% |
| Utils | 工具方法 100% |
同步任务文档
- 产物清单记录测试代码路径或测试报告路径
- 流程状态总览标记“生成测试”为已完成
- 更新下一步指令为“运行测试并记录结果”
注意事项
- Mock 外部依赖 - 数据库、Redis、第三方接口
- 测试边界条件 - null、空集合、边界值
- 测试异常场景 - 业务异常、系统异常
- 保持测试简洁 - 避免测试代码过于复杂
相关模板
- 单元测试模板:见上方 Service/Controller 测试模板
- 集成测试模板
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 129 lines · 32 tokens per session scan A 751bba7cd525
proj-gen-test is a skill published in the GitHub repository zhangloveyan/backend-skill (103 stars, last pushed 23d ago), licensed MIT. It adds 32 tokens to every session and 806 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
proj-gen-test compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| proj-gen-testzhangloveyan/backend-skill | Skill | 103 | 23d ago | MIT | A | 32 | Claude Code |
| test-masterJeffallan/claude-skills | Skill | 12k | 7d ago | MIT | A | 104 | Claude Code |
| migrate-xunit-to-xunit-v3dotnet/skills | Skill | 5.8k | yesterday | MIT | A | 149 | Claude Code |
| go-testingGentleman-Programming/gentle-ai | Skill | 8.4k | yesterday | MIT | A | 26 | Claude Code, Codex |
| principle-test-behavior-not-implementationmichael-denyer/pstack-claude | Skill | 4.1k | yesterday | MIT | A | 50 | Claude Code |
| dart-testdartsim/dart | Skill | 1.2k | yesterday | BSD-2-Clause | A | 18 | Claude Code, Codex |
| test-generatorrshankras/claude-code-apple-skills | Skill | 864 | 2d ago | MIT | A | 33 | Claude Code |