test-gen
Use when generating tests for untested code — happy path, edge cases, error handling
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-11
- Stars
- ★ 7
- Forks
- 8
01 前言 Front Matter
- name
- test-gen
- arguments
- [ { "name": "target", "required": true, "description": "File path or function name to test" } ]
- description
- Use when generating tests for untested code — happy path, edge cases, error handling
03 SKILL.md 正文
When to use
- Generating unit tests for a specific function or file (happy path, edge cases, error handling).
- Writing tests first (TDD) before implementing new functionality.
- Use
/test-genfor per-function unit tests; use/test-matrixfor project-wide testing strategy.
Complements
/test-matrix./test-genowns per-function unit tests (happy / edge / error)./test-matrixowns project-wide testing strategy (fuzz / property / load / e2e / mutation) and CI wiring. Use/test-genfor a specific function,/test-matrixat project kickoff or when coverage gaps span paradigms. Seeskills/test-matrix/SKILL.md.
Test Generation Workflow
Step 1: Analyze Target
- Read the target file/function completely
- Identify: inputs, outputs, side effects, dependencies, error paths
- Check existing test files — don't duplicate
Step 2: Detect Framework
- Auto-detect test framework from project:
- Python: pytest (conftest.py, pytest.ini) or unittest
- JS/TS: jest (jest.config), vitest (vitest.config), mocha
- Flutter: flutter_test
- Go: built-in testing
- Match existing test file naming:
test_*.py,*.test.ts,*_test.dart,*_test.go
Step 3: Plan Test Cases
Categories (in order of priority):
- Happy path — normal expected usage (2-3 cases)
- Edge cases — boundaries, empty inputs, max values (2-3 cases)
- Error handling — invalid inputs, missing data, network errors (1-2 cases)
- Integration — only if function interacts with external services (1 case with mock)
Step 4: Write Tests
- Follow existing test patterns in the project
- Use descriptive test names:
test_<function>_<scenario>_<expected> - One assertion per test (prefer)
- Mock external dependencies, not internal logic
- Use fixtures/factories from existing test infrastructure
Step 5: Run & Verify
- Run new tests — all must pass
- Run full test suite — no regressions
- Check coverage delta if coverage tool available
Step 6: Commit
test: add tests for <target>
04 同仓库更多 Skills
wave-audit
3-wave parallel audit — Wave 1 discovery (4 agents), Wave 2 verification (4 agents), Wave 3 cross-optimization (1 synthesizer). Each wave runs agents in parallel. Combines security review, runtime analysis, quality check, and constructor pattern into one unified workflow with evidence grading and Go/No-Go verdict.
vm-provision
End-to-end VPS provisioning — select provider → plan → provision → harden → verify (ssh-check + firewall-diff hard-gate) → handoff. 6 phases, ≥6 AskUserQuestion calls, defensive-only. Stops if either verification primitive fails.
visual-explainer
Generate beautiful, self-contained HTML pages that visually explain systems, code changes, plans, and data. Use when the user asks for a diagram, architecture overview, diff review, plan review, project recap, comparison table, or any visual explanation of technical concepts. Also use proactively when you are about to render a complex ASCII table (4+ rows or 3+ columns) — present it as a styled HTML page instead.
video-gen
Use when generating video from frame sequences — FFmpeg extraction, WebP/AVIF conversion, sprite sheets, scroll-synced playback, video encoding/transcoding. Covers the full pipeline from video source to web-ready frame sequence or optimized video.
test-matrix
Use when a project needs testing BEYOND unit tests — fuzzing, property-based, load, E2E, or mutation. Five-phase hub-and-spoke pipeline composes the right mix per language × critical path × CI target, scaffolds configs + corpus + fixtures, wires CI jobs, and defines the crash/regression triage workflow. Pure-click: every decision except intake is an AskUserQuestion.
spawn-agent
Prepare a composed Agent-tool invocation via kei-spawn. Click-only wizard — pick role, describe task, set scope. Emits ready-to-paste prompt + subagent_type + isolation + DNA.