单元测试编写
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
- 参考文档agents/openai.yaml204 B
03 SKILL.md 正文
Write Tests
Write tests for the target given in the arguments: $ARGUMENTS.
- Detect the test framework the project already uses. Do not add a new one.
- List the behaviors of the target that carry business meaning: edge cases, boundaries, error paths.
- Write one test per behavior. Each test name says why the behavior matters.
- Do not test getters, the language or the framework.
- Run the tests and show the output.
Every test must be able to fail when the logic it covers changes.
04 同仓库更多 Skills
word-count
Counts the words, lines and characters of a text or a file.
slugify
Turns a title or a sentence into a URL slug, lowercase words joined by hyphens with accents removed.
json-format
Validates a JSON file and pretty prints it with two space indentation, or reports where the JSON is invalid.
commit-message
Writes a conventional commit message for the staged git changes.
skills-gateway
Gateway and router to a catalog of skills that are not registered directly. Use it before any task a specialized skill could handle, such as text, JSON or git chores. It finds the right skill and loads its instructions.
decision-log
Record, list, show and supersede architecture decisions that persist across sessions in the shared agent infra state store. Use when the user says "record this decision", "log an ADR", "what did we decide about", "list decisions", or "supersede decision".