test-generator
从现有代码生成单元测试
编写有用的测试需要时间,而且经常遗漏边界情况。此技能帮助 Claude、Codex 和 Claude Code 生成符合项目约定的测试。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "test-generator" from https://skillstore.io/skills/curiouslearner-test-generator.md and its manifest at https://skillstore.io/api/skills/curiouslearner-test-generator/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“test-generator”。 为 parser utility 生成测试,覆盖有效、空、格式错误和边界输入。
预期结果:
- 按 parser 行为分组的测试大纲。
- 覆盖有效输入、空输入、格式错误输入和边界值的用例。
- 关于预期错误和需要创建的 fixture 的说明。
正在使用“test-generator”。 改进调用外部依赖的 user service 的测试。
预期结果:
- 针对外部依赖的 mock 策略。
- 服务行为的正向和负向测试场景。
- 对返回值、抛出错误和依赖调用的断言。
安全审计
安全The static findings are false positives caused by Markdown code fences and example JavaScript test names. No evidence found of command execution, system reconnaissance, prompt injection, or malicious intent in SKILL.md.
风险因素
⚙️ 外部命令 (3)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/curiouslearner-test-generator/audits/8?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/curiouslearner-test-generator?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/curiouslearner-test-generator?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/curiouslearner-test-generator/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/curiouslearner-test-generator.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
CuriousLearner. (2026). test-generator security audit report (audit version 8) [Author version unspecified]. Skillstore. https://skillstore.io/skills/curiouslearner-test-generator/audits/8BibTeX 引用
@techreport{curiouslearner-curiouslearner-test-generator-2026,
author = {CuriousLearner},
title = {test-generator security audit report (audit version 8)},
institution = {Skillstore},
year = {2026},
number = {8},
url = {https://skillstore.io/skills/curiouslearner-test-generator/audits/8},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "test-generator security audit report (audit version 8)"
version: "unspecified"
type: report
authors:
- name: "CuriousLearner"
date-released: "2026-07-06"
url: "https://skillstore.io/skills/curiouslearner-test-generator/audits/8"
identifiers:
- type: other
value: "skillstore:curiouslearner-test-generator:audit:8"
description: "Skillstore immutable audit report identifier"
比较变体
2 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
curiouslearner-test-generator
2026-09-09
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
为新代码增加覆盖率
按照项目当前的测试风格,为新模块创建初始单元测试。
扩展边界情况测试
识别需要更强断言的边界值、无效输入和错误路径。
标准化测试模式
帮助团队在各服务之间应用一致的命名、结构和 mocking 模式。
试试这些提示
Use test-generator on this file and draft unit tests for the main public functions.
Use test-generator for this module. Match the assertion style, file naming, and setup patterns from the existing test directory.
Use test-generator to add tests for edge cases, invalid inputs, async failures, and mocked dependencies in this component.
Use test-generator to review this subsystem, identify missing coverage, and propose a prioritized test plan with representative examples.
最佳实践
- 提供目标文件和附近的测试,以便 agent 匹配本地约定。
- 要求覆盖边界情况和错误路径,而不仅仅是成功路径测试。
- 提交前审查生成的测试,尤其是 mock 和预期值。
避免
- 在未检查断言是否符合真实需求的情况下使用生成的测试。
- 请求广泛覆盖率,却未指定目标模块或行为。
- 添加依赖实现细节而非公共行为的脆弱测试。
常见问题
此技能可以识别哪些测试框架?
它可以为整个项目创建测试吗?
它会执行生成的测试吗?
它会保证 80% 覆盖率吗?
它可以 mock 外部依赖吗?
它对私有代码库安全吗?
开发者详情
许可证
MIT
Skillstore 修订
r1
版本提示
作者未声明版本。
引用
d11af420e07cd866fe39cfa937efef3223896c06
维护新鲜度
2026/7/22
使用量
6 次下载 · 245 次浏览
文件结构
📄 SKILL.md