一键导入
test-generation
Generate comprehensive tests with good coverage strategy. Use when writing unit tests, integration tests, or test plans for existing or new code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate comprehensive tests with good coverage strategy. Use when writing unit tests, integration tests, or test plans for existing or new code.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Prove bug fixes with fail-then-pass validation. Use when debugging regressions, user-reported bugs, flaky behavior, race conditions, UI stream issues, or any fix where the user asks to reproduce the issue first, validate the fix, avoid masking symptoms, or show that the old behavior fails and the new behavior passes.
System design, task decomposition, and technical planning. Use when designing new features, planning refactors, breaking down large tasks, or creating technical specifications.
Systematic code review covering correctness, security, performance, and maintainability. Use when reviewing pull requests, auditing code changes, or assessing code quality.
Structured data exploration, transformation, and analysis. Use when working with datasets, CSV/JSON processing, database queries, data visualization, or ETL pipelines.
Systematic root cause analysis and bug fixing. Use when diagnosing errors, crashes, unexpected behavior, test failures, or any "it's not working" scenario.
Systematic web research with source triangulation, structured synthesis, and citations. Use when the task requires investigating topics, comparing options, finding documentation, or answering questions that need external knowledge.
| name | Test Generation |
| description | Generate comprehensive tests with good coverage strategy. Use when writing unit tests, integration tests, or test plans for existing or new code. |
You are writing tests. Focus on testing behavior and edge cases, not implementation details.
If the task involves multiple test cases, fixtures, or validation steps, start with a todo plan before writing tests. Use it to track analysis, implementation, and verification rather than keeping the plan implicit.
read — read the code under test and existing test filessearch — find related tests, test utilities, mock patterns in the codebaseexecute — run tests to verify they pass, check coverageedit — write new test files or add test casestodo — track test case creation progressUse read to analyze the code under test, then plan with todo:
todo({ todoList: [
{ id: 1, title: "Analyze code and map branches", status: "in-progress" },
{ id: 2, title: "Check existing test patterns", status: "not-started" },
{ id: 3, title: "Write happy path tests", status: "not-started" },
{ id: 4, title: "Write edge case tests", status: "not-started" },
{ id: 5, title: "Write error path tests", status: "not-started" },
{ id: 6, title: "Run and verify all tests pass", status: "not-started" }
]})
read to study the function/module thoroughlysearch to find existing test utilities, mocks, and fixturessearch to find how tests are written in this projectUse edit to create test files. Cover:
Happy path: Normal usage with typical inputs Edge cases: Empty inputs, nulls, boundary values, single-element collections, unicode Error paths: Invalid inputs, missing fields, service failures, timeouts State transitions: Initial → after action → expected state (for stateful code)
execute to run the new teststodo as you complete each test grouptodo as mandatory for multi-step test work; only skip it for truly tiny one-test changes