用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill unit-test-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | unit-test-generator |
| description | Generates comprehensive unit tests for functions and classes in multiple languages |
| allowed-tools | ["Read","Grep","Write","Bash"] |
| version | 1.0.0 |
| author | GLINCKER Team |
| license | Apache-2.0 |
| keywords | ["testing","unit-tests","tdd","quality-assurance"] |
Automatically generates comprehensive unit tests for your code, supporting multiple programming languages and testing frameworks.
This skill creates high-quality unit tests by:
When asked to generate tests:
Identify target code:
Detect language and framework:
Analyze logic:
Create tests covering:
Happy Path Tests:
Edge Cases:
Error Conditions:
Integration Points:
Follow framework-specific conventions:
Python (pytest):
import pytest
from module import function_to_test
class TestFunctionName:
def test_happy_path(self):
# Arrange
input_data = "valid input"
# Act
result = function_to_test(input_data)
# Assert
assert result == expected_value
def test_edge_case_empty_input(self):
with pytest.raises(ValueError):
function_to_test("")
JavaScript (Jest):
describe('functionName', () => {
test('should handle valid input', () => {
// Arrange
const input = 'test';
// Act
const result = functionName(input);
// Assert
expect(result).toBe(expected);
});
test('should throw error on invalid input', () => {
expect(() => functionName(null)).toThrow();
});
});
Ensure generated tests:
Present the generated tests and:
User Request: "Generate tests for the calculate_discount function"
Source Code:
def calculate_discount(price: float, discount_percent: int) -> float:
if discount_percent < 0 or discount_percent > 100:
raise ValueError("Discount must be between 0 and 100")
return price * (1 - discount_percent / 100)
Generated Tests:
import pytest
from shopping import calculate_discount
class TestCalculateDiscount:
def test_valid_discount(self):
"""Test normal discount calculation"""
result = calculate_discount(100.0, 20)
assert result == 80.0
def test_zero_discount(self):
"""Test with no discount"""
result = calculate_discount(100.0, 0)
assert result == 100.0
def test_full_discount(self):
"""Test with 100% discount"""
result = calculate_discount(100.0, 100)
assert result == 0.0
def test_negative_discount_raises_error(self):
"""Test that negative discount raises ValueError"""
with pytest.raises(ValueError, match="between 0 and 100"):
calculate_discount(100.0, -10)
def test_discount_over_100_raises_error(self):
"""Test that discount > 100 raises ValueError"""
with pytest.raises(ValueError, match="between 0 and 100"):
calculate_discount(, )
():
result = calculate_discount(, )
result ==
User Request: "Create unit tests for the UserValidator class"
Generated Approach:
When using this skill:
Adapts to detected setup:
| Language | Framework | Test File Location |
|---|---|---|
| Python | pytest | tests/test_*.py |
| Python | unittest | tests/test_*.py |
| JavaScript | Jest | __tests__/*.test.js |
| TypeScript | Jest | __tests__/*.test.ts |
| Go | testing | *_test.go (same dir) |
| Rust | built-in | tests/ or inline |
Want to add support for a new language or framework?
Apache License 2.0 - See LICENSE
GLINCKER Team
Converted and distributed by TomeVault — claim your Tome and manage your conversions.