一键导入
write-tests
Use when writing, updating, or reviewing automated tests. Use for unit tests, behavior changes, regression tests, and testability refactors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when writing, updating, or reviewing automated tests. Use for unit tests, behavior changes, regression tests, and testability refactors.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when refactoring code to improve testability, separate side effects, remove hidden dependencies, or introduce dependency injection.
Use when the user proposes a technical solution, asks for architectural feedback, asks whether an approach is good, or wants a Staff+/Principal-level engineering review. Do not use for small mechanical edits.
Use when creating a human-facing report, implementation plan, architecture comparison, codebase review, PR review, migration analysis, testability audit, performance investigation, or stakeholder summary where visual structure, diagrams, tables, or collapsible sections make the result easier to review. Do not use for canonical repository documentation, small answers, README files, AGENTS.md, SKILL.md, or files intended for clean git diffs.
Use when a task spans multiple logical changes and the user wants the working tree prepared for review or later commits.
| name | write-tests |
| description | Use when writing, updating, or reviewing automated tests. Use for unit tests, behavior changes, regression tests, and testability refactors. |
Write tests before or alongside behavior changes.
Prefer fast, deterministic tests.
Test behavior, not implementation details.
Avoid module mocking when dependency injection can express the seam.
Isolate side effects behind explicit dependencies.
Side effects include:
When tests are hard to write, stop and propose the smallest refactor that makes the behavior testable.
Prefer small pure functions for core behavior.
Prefer dependency injection over intercepting imports.
Do not introduce broad mocking frameworks unless the repository already requires them.
Follow the repository's existing test runner and assertion style.
If there is no established test style and this is a TypeScript or Node.js project, prefer:
node:testnode:asserttest() onlydescribeitFor non-trivial assertions:
actual... variableexpected... variableSimple primitive assertions may stay inline when they are already clear.
For regression tests:
After changing tests, run the relevant test command when possible.
If the full test suite is expensive, run the smallest meaningful test command and explain what was validated.