test
Test generation and execution with coverage analysis. Use when: "test", "write tests", "run tests", "coverage", "unit test", "test this", "add tests"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Test generation and execution with coverage analysis. Use when: "test", "write tests", "run tests", "coverage", "unit test", "test this", "add tests"
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Full codebase audit: architecture health, dependencies, complexity, tech debt. Use when: "audit", "health check", "codebase analysis", "tech debt", "architecture review", "dependency check", "code quality"
Structured brainstorming with multiple approaches and tradeoffs. Use when: "brainstorm", "explore options", "what are my options", "compare approaches", "pros and cons", "which is better", "how should I", "alternatives"
Build error diagnosis and resolution. Use when: "build failed", "compile error", "bundler error", "fix build", "npm error", "type error", "won't compile"
Scaffold a new application with interactive dialogue. Use when: "create", "build me", "make an app", "new project", "scaffold", "generate app", "start new"
Generate a new custom skill from natural language description. Use when: "create skill", "new skill", "make a skill", "add command", "custom workflow", "skill template", "generate skill"
Systematic debugging with hypothesis-driven investigation. Use when: "debug", "not working", "bug", "broken", "error", "unexpected behavior", "fix issue", "investigate"
| name | test |
| description | Test generation and execution with coverage analysis. Use when: "test", "write tests", "run tests", "coverage", "unit test", "test this", "add tests" |
| argument-hint | <file/feature|coverage|watch> |
| user-invocable | true |
| disable-model-invocation | true |
$ARGUMENTS
This command generates tests, runs existing tests, or checks test coverage.
/test - Run all tests
/test [file/feature] - Generate tests for specific target
/test coverage - Show test coverage report
/test watch - Run tests in watch mode
When asked to test a file or feature:
Analyze the code
Generate test cases
Write tests
## 🧪 Tests: [Target]
### Test Plan
| Test Case | Type | Coverage |
|-----------|------|----------|
| Should create user | Unit | Happy path |
| Should reject invalid email | Unit | Validation |
| Should handle db error | Unit | Error case |
### Generated Tests
`tests/[file].test.ts`
[Code block with tests]
---
Run with: `npm test`
🧪 Running tests...
✅ auth.test.ts (5 passed)
✅ user.test.ts (8 passed)
❌ order.test.ts (2 passed, 1 failed)
Failed:
✗ should calculate total with discount
Expected: 90
Received: 100
Total: 15 tests (14 passed, 1 failed)
/test src/services/auth.service.ts
/test user registration flow
/test coverage
/test fix failed tests
describe('AuthService', () => {
describe('login', () => {
it('should return token for valid credentials', async () => {
// Arrange
const credentials = { email: 'test@test.com', password: 'pass123' };
// Act
const result = await authService.login(credentials);
// Assert
expect(result.token).toBeDefined();
});
it('should throw for invalid password', async () => {
// Arrange
const credentials = { email: 'test@test.com', password: 'wrong' };
// Act & Assert
await expect(authService.login(credentials)).rejects.toThrow('Invalid credentials');
});
});
});