Skip to main content

write-tests

Write high-quality tests with required pre-writing analysis of logic, inputs, invariants, and failure modes.

来源信息

仓库
sunpar/agentic_coding_tools
最近来源活动
2026年2月13日 11:00
检测到的 SKILL.md 语言
英语
星标
1
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
write-tests
description
Write high-quality tests with required pre-writing analysis of logic, inputs, invariants, and failure modes.
disable-model-invocation
true
# Write Tests ## Required Pre-Writing Analysis Before writing tests, answer: 1. What is the core logic or algorithm? 2. What are the inputs and outputs, including edge/boundary/invalid cases? 3. What invariants must always hold? 4. What failure modes are realistic (bad data, misuse, race conditions)? ## Test Rules - Test behavior, not implementation details. - Minimize mocking; mock only true external dependencies. - Avoid tautological tests (mock X, assert X with no logic in between). - Exercise real branches and error paths. - Use concrete, realistic data. - Name tests with clear hypotheses. ## Verification Checklist - Could each test fail if corresponding logic were broken? - Are core decisions being tested, not only wiring? - Are happy path, edge cases, error conditions, and boundaries covered? - If mocks were removed, would meaningful logic remain under test? ## Output 1. Present the pre-writing analysis. 2. Add or update tests based on that analysis. 3. Run tests and confirm pass/fail status. 4. Report the verification checklist with conclusions.
在 GitHub 查看