用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/InugamiDev/ultrathink-oss --skill test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | test |
| description | Test planning, generation, and execution -- unit, integration, and end-to-end testing workflows |
| layer | hub |
| category | workflow |
| triggers | ["/test","write tests","test this","add test coverage","run the tests","check if tests pass"] |
| inputs | [{"target":"Code, feature, or file(s) to test"},{"testType":"unit | integration | e2e | all (optional, defaults to appropriate type)"},{"framework":"Test framework to use (optional, auto-detected from project config)"}] |
| outputs | [{"testPlan":"Strategy document listing what to test and why"},{"testFiles":"Generated test file(s) with complete test cases"},{"testResults":"Output from running the tests"},{"coverageReport":"Coverage summary for the tested area (if available)"}] |
| linksTo | ["scout","debug","fix","code-review"] |
| linkedFrom | ["fix","refactor","optimize","cook","team","ship"] |
| preferredNextSkills | ["code-review","fix"] |
| fallbackSkills | ["debug","scout"] |
| riskLevel | low |
| memoryReadPolicy | selective |
| memoryWritePolicy | selective |
| sideEffects | ["Creates or modifies test files","Runs test commands","May install test dependencies"] |
Plan, generate, and execute tests that verify code correctness, prevent regressions, and document expected behavior. This skill covers the full testing lifecycle from strategy through execution.
Tests are not bureaucracy. Tests are executable documentation that proves your code works.
Use when you need to decide WHAT to test before writing tests.
tests/ directory, __tests__ folders)# Test Plan: [Target]
## Target
[What is being tested]
## Test Infrastructure
- **Framework**: [name + version]
- **Runner command**: [command]
- **Test location**: [where tests should go]
## Unit Tests
| Test | Input | Expected Output | Edge Case? |
|------|-------|----------------|------------|
| [function] handles valid input | [input] | [output] | No |
| [function] handles empty input | [] | [] or error | Yes |
| [function] handles null | null | throws TypeError | Yes |
## Integration Tests
| Test | Components | Scenario |
|------|-----------|----------|
| [feature] happy path | A + B + C | [description] |
| [feature] error propagation | A + B | [description] |
## Edge Cases to Cover
- [edge case 1]
- [edge case 2]
[thing]: [reason -- e.g., "covered by upstream tests"]
Use when you need to WRITE tests.
Read the target code thoroughly.
Read existing tests in the same area to match conventions.
Generate tests following these principles:
it('returns 404 when user does not exist')Test file structure:
describe('[ModuleName]', () => {
describe('[functionName]', () => {
// Setup shared across this function's tests
beforeEach(() => { /* ... */ });
it('does X when given Y', () => {
// Arrange
const input = createTestInput();
// Act
const result = functionName(input);
// Assert
expect(result).toEqual(expectedOutput);
});
it('throws when given invalid input', () => {
expect(() => functionName(null)).toThrow(ValidationError);
});
it('handles edge case: empty array', () => {
const result = functionName([]);
expect(result).toEqual([]);
});
});
});
Mocking strategy:
Write the test file using the Write tool (new file) or Edit tool (adding to existing).
Use when you need to RUN tests and interpret results.
npm test -- path/to/test.tsnpm test -- --testNamePattern="test name"npm testnpm test -- --coveragefix)/test Plan tests for the authentication module
/test Write unit tests for src/lib/utils/formatDate.ts
/test Run the test suite and report results
/test Write a regression test for the bug fixed in src/lib/orders.ts
/test Improve test coverage for the payment processing module
Target: formatCurrency(amount: number, currency: string): string
Generated tests:
formatCurrency(10.5, 'USD') returns '$10.50'formatCurrency(0, 'USD') returns '$0.00'formatCurrency(-5, 'USD') returns '-$5.00'formatCurrency(1000000, 'USD') returns '$1,000,000.00'formatCurrency(10.5, 'EUR') returns 'EUR10.50' (or locale-appropriate)formatCurrency(10.5, 'INVALID') throws UnsupportedCurrencyErrorformatCurrency(NaN, 'USD') throws InvalidAmountErrorformatCurrency(Infinity, 'USD') throws InvalidAmountErrorTarget: User registration flow (API endpoint + database + email)
Generated tests:
/api/register with valid data creates user and sends welcome email/api/register with existing email returns 409 Conflict/api/register with invalid email returns 400 with validation errors/api/register when email service is down creates user but logs email failureit('does not crash when API returns error without items field (fixes #123)').