cs-tests
Generate unit tests from code paths. Uses symbolic execution to explore branches, identify edge cases, and auto-generate pytest/unittest test cases.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate unit tests from code paths. Uses symbolic execution to explore branches, identify edge cases, and auto-generate pytest/unittest test cases.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Analyze code structure: parse functions, classes, imports, and complexity metrics. Use to understand a file or project without reading the source code directly.
Extract a specific function, class, or method from a file using Code Scalpel. Use when you need to show a symbol without reading the entire file—saves 95% of context.
Map project architecture: discover modules, build call graphs, visualize structure, trace critical paths. Complete architecture overview with dependency flows.
Verify code compliance with policies and standards: HIPAA, SOC2, PCI-DSS, custom style guides. Validate policy file integrity with cryptographic verification.
Safe refactoring workflow: find all usages, trace dependencies, simulate changes, generate baseline tests, then apply with backup. Behavior-preserving refactor.
Full security audit: detect local vulnerabilities, cross-file taint flows, CVEs in dependencies, and polyglot sink patterns. Complete security scan pipeline.
| name | cs-tests |
| description | Generate unit tests from code paths. Uses symbolic execution to explore branches, identify edge cases, and auto-generate pytest/unittest test cases. |
| allowed-tools | ["mcp__codescalpel__extract_code","mcp__codescalpel__symbolic_execute","mcp__codescalpel__generate_unit_tests"] |
| preamble-tier | 1 |
Auto-generate unit tests by analyzing execution paths through a function. Finds edge cases, branches, and error conditions automatically.
/cs-tests src/utils.py function calculate_tax
/cs-tests src/validation.py function validate_email
/cs-tests src/api.py function handle_request
A test file with:
Supports:
pytest (recommended, modern)unittest (legacy, standard library)def test_calculate_tax_normal():
assert calculate_tax(100) == 10.0
def test_calculate_tax_zero():
assert calculate_tax(0) == 0.0
def test_calculate_tax_negative_raises():
with pytest.raises(ValueError):
calculate_tax(-100)
pytest test_*.pyGenerate tests BEFORE refactoring to create a safety baseline:
/cs-tests src/legacy_code.py function complex_function
# Now safe to refactor—tests will catch breakage
/cs-refactor src/legacy_code.py function complex_function
See CLAUDE.md for the full test generation workflow.