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.
npx skills add guyulong/cn-agent-skills --skill test-gengit clone --depth 1 https://github.com/guyulong/cn-agent-skillsWrote 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/guyulong/cn-agent-skills/test-gen)<a href="https://agentmods.dev/skills/guyulong/cn-agent-skills/test-gen"><img src="https://agentmods.dev/badge/skills/guyulong/cn-agent-skills/test-gen/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/guyulong/cn-agent-skills/test-gen"><img src="https://agentmods.dev/badge/skills/guyulong/cn-agent-skills/test-gen.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.00008 | $0.00862 |
| Opus 5 | $0.00004 | $0.00431 |
| Sonnet 5 | $0.00002 | $0.00172 |
| Haiku 4.5 | $0.00001 | $0.00086 |
Grade A, and why
test-gen 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 9d 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.
How it starts
The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.
单元测试生成器
使用场景
为函数或类自动生成单元测试代码。
测试框架
Python (pytest)
import pytest
from app.calculator import add, divide
class TestCalculator:
def test_add_positive(self):
assert add(1, 2) == 3
def test_add_negative(self):
assert add(-1, -2) == -3
def test_add_zero(self):
assert add(0, 0) == 0
def test_divide_normal(self):
assert divide(10, 2) == 5.0
def test_divide_by_zero(self):
with pytest.raises(ZeroDivisionError):
divide(10, 0)
@pytest.mark.parametrize("a,b,expected", [
(1, 2, 3),
(0, 0, 0),
(-1, 1, 0),
(100, 200, 300),
])
def test_add_parametrize(self, a, b, expected):
assert add(a, b) == expected
JavaScript (Jest)
const { add, divide } = require('./calculator');
describe('Calculator', () => {
describe('add', () => {
test('正数相加', () => {
expect(add(1, 2)).toBe(3);
});
test('负数相加', () => {
expect(add(-1, -2)).toBe(-3);
});
test('零值相加', () => {
expect(add(0, 0)).toBe(0);
});
});
describe('divide', () => {
test('正常除法', () => {
expect(divide(10, 2)).toBe(5.0);
});
test('除以零抛异常', () => {
expect(() => divide(10, 0)).toThrow('Division by zero');
});
});
});
测试原则
AAA模式
def test_example():
# Arrange - 准备测试数据
user = User(name="张三", age=25)
# Act - 执行被测试的操作
result = user.is_adult()
# Assert - 验证结果
assert result is True
测试命名规范
# 格式: test_<被测函数>_<场景>_<预期结果>
def test_divide_by_zero_raises_error():
pass
def test_login_with_wrong_password_returns_error():
pass
def test_calculate_with_negative_number_returns_positive():
pass
边界值测试
# 数值边界
def test_boundary():
assert process(0) == expected # 最小值
assert process(MAX_VALUE) == expected # 最大值
assert process(-1) == expected # 负数
# 字符串边界
def test_string_boundary():
assert process("") == expected # 空字符串
assert process("a" * 10000) == expected # 超长字符串
# 集合边界
def test_collection_boundary():
assert process([]) == expected # 空列表
assert process([1]) == expected # 单元素
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.
- 9d ago First seen · 138 lines · 8 tokens per session scan A 602a8e3dfe60
test-gen is a skill published in the GitHub repository guyulong/cn-agent-skills (3 stars, last pushed 3mo ago), licensed MIT. It adds 8 tokens to every session and 862 once invoked, about $0.0000 per session on Opus 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-31.
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.
metago-test-generator
Test Generation Engineer - specializes in automatically generating unit tests, boundary case tests, and integration tests from source code.
dart-generate-test-mocks
A Dart testing workflow for creating generated mock objects with Mockito and build_runner. A mock is a controllable stand-in for an external service such as an API or database.
dart-add-unit-test
Organize test files to mirror the lib directory structure to maintain predictability.
flutter-add-widget-test
A guide for writing Flutter widget tests, which check individual interface components and their user interactions. Flutter is a toolkit for building apps from one Dart codebase.
diagnosing-bugs
A method for investigating difficult software bugs and performance slowdowns by building a repeatable feedback loop and testing possible causes.