test-generator

test-generator is a skill for Claude Code, Codex from Nikolahuang/nova-cli. It costs 17 tokens per session (658 once invoked), scanned A, original, MIT.

A tool that creates unit tests for individual functions, integration tests for cooperating components, and end-to-end tests for complete user flows.

In plain words
What is it for?
Use it to examine existing code, create test files for supported languages and frameworks, run the tests, and check coverage.
Why use it?
It reduces the effort of starting a test suite and helps cover normal inputs, edge cases, errors, and larger workloads.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to examine existing code, create test files for supported languages and frameworks, run the tests, and check coverage.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nikolahuang/nova-cli/test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Nikolahuang/nova-cli --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/Nikolahuang/nova-cli

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/nikolahuang/nova-cli/test-generator/github.svg)](https://agentmods.dev/skills/nikolahuang/nova-cli/test-generator)
Your own site
<a href="https://agentmods.dev/skills/nikolahuang/nova-cli/test-generator"><img src="https://agentmods.dev/badge/skills/nikolahuang/nova-cli/test-generator/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.

agentmods 80×15 button for test-generator

Your own site · 80×15
<a href="https://agentmods.dev/skills/nikolahuang/nova-cli/test-generator"><img src="https://agentmods.dev/badge/skills/nikolahuang/nova-cli/test-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 658 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00017 $0.00658
Opus 5.5 $0.00007 $0.00263
Sonnet 5.5 $0.00003 $0.00132
Haiku 4.5 $0.00002 $0.00066

Measured 1mo ago against content hash 284a29bdb44d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-generator 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 1mo 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.

extensions/skills/test-generator/SKILL.md · 88 lines

What it actually says

你是一个专业的测试工程师,擅长为各种代码生成高质量的测试用例。

测试生成策略

1. 理解被测代码

  • 使用 read_file 读取目标文件
  • 分析函数/类的职责和输入输出
  • 识别边界条件和异常情况

2. 确定测试类型

  • 单元测试: 测试单个函数或类
  • 集成测试: 测试多个组件的协作
  • 端到端测试: 测试完整用户流程

3. 测试用例设计

  • 正常路径: 标准输入和预期输出
  • 边界值: 空值、最大值、最小值
  • 异常情况: 错误输入、异常处理
  • 性能测试: 大数据量、并发场景

实现步骤

  1. 分析代码结构

    使用 search_file 查找测试文件命名模式(*.test.*, *.spec.*)
    使用 read_file 读取被测代码
    识别函数、类、方法的签名
    
  2. 生成测试文件

    根据项目类型选择合适的测试框架:
    - Node.js: Jest, Mocha, Vitest
    - Python: pytest, unittest
    - Go: testing
    - Rust: cargo test
    
  3. 编写测试用例

    • 为每个公共函数/方法生成测试
    • 包括正向和反向测试
    • 添加清晰的测试描述
    • 使用有意义的断言消息
  4. 验证测试

    • 运行生成的测试
    • 检查覆盖率
    • 修复失败的测试

输出格式

🧪 测试生成报告

目标文件: src/utils.ts 测试文件: src/utils.test.ts

生成的测试用例
  1. 函数: formatDate(date: Date): string

    • ✅ 正常日期格式化
    • ✅ 无效日期处理
    • ✅ 边界值测试(最小/最大日期)
  2. 函数: calculateTotal(items: Item[]): number

    • ✅ 空数组返回 0
    • ✅ 正常计算总和
    • ✅ 大数据量性能测试
测试统计
  • 总测试函数: X
  • 覆盖率: X%
  • 预计执行时间: Xs
下一步
  1. 运行测试: npm test
  2. 检查覆盖率报告
  3. 根据结果调整测试
Changes

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.

  1. 1mo ago First seen · 88 lines · 17 tokens per session scan A 284a29bdb44d

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository Nikolahuang/nova-cli (14 stars, last pushed 6mo ago), licensed MIT. It adds 17 tokens to every session and 658 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.

Related

Other skills, from other repositories

plugin-test

A testing guide for Zhin.js plugins using Vitest, a JavaScript and TypeScript testing framework. It focuses on checking command and tool behavior, ordinary business logic, and the plugin package’s required structure.

zhinjs/zhin · 51 tokens

knowledge-engineering-quality-and-delivery-unit-integration-and-shared-test-harnesses

A testing guide for the CLI and web interfaces, covering unit, integration, end-to-end, and real-process test setup with shared fixtures and cleanup.

echoVic/blade-code · 184 tokens

testing-strategy

Write comprehensive test suites with proper structure, mocking strategies, fixtures, and coverage goals. Use when implementing unit tests, integration tests, or e2e tests. Triggers on: tests, testing, unit test, integration test, e2e, jest, vitest, pytest, mocking, TDD.

parisgroup-ai/imersao-ia-setup · 66 tokens

tsq-testing

A guide to planning and writing software tests, including unit tests, integration tests, end-to-end tests, test coverage, and the Given-When-Then format. TDD means writing a failing test, making it pass with the smallest change, then cleaning up the code.

sonature-lab/timsquad · 85 tokens

test-generation

Generate a test strategy and starter test stubs for given modules across unit, integration, and e2e layers (pytest/jest/playwright). Trigger on: generate tests, test plan, test strategy, coverage plan, test scaffolding.

sarveshtalele/mcp-skills-registry · 51 tokens

Testing Strategy

Create comprehensive test plans with unit, integration, and E2E test cases.

Xiaowen-Jiang/agent-enterprise · 18 tokens