AGENT SKILL

单元测试编写

write-tests

使用项目已有的测试框架,为文件的核心逻辑编写单元测试。当用户要求添加测试或运行 /code:write-tests 时使用。

License 许可
Unlicense
最近更新
2026-11-15
Stars
★ 21
Forks
9

01 前言 Front Matter

name
write-tests
description
Write unit tests for the core logic of a file using the test framework the project already uses. Use when the user asks to add tests or runs /code:write-tests.

02 资源文件 1

03 SKILL.md 正文

Write Tests

Write tests for the target given in the arguments: $ARGUMENTS.

  1. Detect the test framework the project already uses. Do not add a new one.
  2. List the behaviors of the target that carry business meaning: edge cases, boundaries, error paths.
  3. Write one test per behavior. Each test name says why the behavior matters.
  4. Do not test getters, the language or the framework.
  5. Run the tests and show the output.

Every test must be able to fail when the logic it covers changes.

04 同仓库更多 Skills