一键导入
unit-test-plan
Outline unit tests for a function or module before writing them. Use when the goal mentions writing tests, test plan, or test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Outline unit tests for a function or module before writing them. Use when the goal mentions writing tests, test plan, or test coverage.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review code changes for correctness, error handling, scope creep, and style. Use when the goal mentions reviewing a PR, diff, or file.
Walk through a stack trace or error log to find the root cause. Use when the goal mentions debugging, investigating an error, or tracking down a bug.
Write a Conventional Commits message describing a code change. Use when the goal mentions creating a commit, writing commit message, or committing changes.
Keep effort proportional to risk — prefer the cheapest sufficient workflow, escalate only on evidence, refuse over-analysis on simple tasks. Use when choosing depth, level, or workflow shape.
Map required capabilities to persona roles and available skills. Detect missing skill coverage and decide whether to acquire a skill, request one, or proceed generically. Use when scoping a workflow.
Coordinate multi-persona work with a shared blackboard, role boundaries, hand-off contract, conflict resolution, and final synthesis. Use when a task benefits from more than one persona.
| name | unit-test-plan |
| description | Outline unit tests for a function or module before writing them. Use when the goal mentions writing tests, test plan, or test coverage. |
Outline the cases first; write code second. Test code that codifies the contract is more valuable than test code that incidentally passes.
expect(x).toHaveProperty('foo') proves the shape, not the behaviour. Prefer assertions that would fail if the function silently no-op'd.Function: <name>
Contract: <what it promises>
Cases:
1. happy path: given X, returns Y
2. empty input: given [], returns sentinel (no throw)
3. boundary: given length === MAX, succeeds; MAX+1 throws BoundaryError
4. invalid type: given <wrong shape>, throws ValidationError with field path
5. side effect: on success, calls store.write exactly once with hashed key