一键导入
test-gen
Generate unit tests for selected code. Use when user says "add tests", "write unit tests", "generate test cases", or highlights code needing test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate unit tests for selected code. Use when user says "add tests", "write unit tests", "generate test cases", or highlights code needing test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Translate Markdown files between Chinese and English. Use when user says "translate this document", "翻译这个文档", "中译英", "英译中".
Format and optimize SQL queries. Use when user pastes SQL, says "format this SQL", "optimize this query", or "beautify SQL".
Generate release notes from git commits. Use when user says "generate release notes", "write changelog for this release", "summarize what's in vX.X".
Analyze code and suggest refactoring improvements. Use when user says "refactor this", "improve this code", "clean up", or "any suggestions for this code".
Generate project README from codebase analysis. Use when user says "write a README", "create README for this project", or initializing a new repo.
Generate pull request description from git diff. Use when user says "generate PR description", "write PR summary", or before opening a pull request.
| name | test-gen |
| description | Generate unit tests for selected code. Use when user says "add tests", "write unit tests", "generate test cases", or highlights code needing test coverage. |
Generate comprehensive unit tests for the selected code.
| Language | Framework |
|---|---|
| JavaScript | Jest / Vitest |
| TypeScript | Jest / Vitest |
| Python | pytest |
| Java | JUnit 5 |
| Go | testing |
| Rust | #[test] |
| Ruby | RSpec |
For each function, generate tests for:
// filename.test.ts
import { describe, it, expect } from 'vitest';
describe('functionName', () => {
// Happy path
it('should return expected result for normal input', () => {
expect(functionName(input)).toBe(expected);
});
// Edge cases
it('should handle empty input', () => {
expect(functionName('')).toBe(expected);
});
// Error cases
it('should throw for invalid input', () => {
expect(() => functionName(invalid)).toThrow();
});
});