dsh-test-first
Skill4 starsChanged 3 months agoMITView on GitHub
修复 bug 或实现新功能时使用:先写失败测试,再最小实现,最后重构。
In this repository18 other files it gives its agents.
- dsh-changelogSkill
- dsh-chinese-docsSkill
- dsh-code-reviewSkill
- dsh-debug-sessionSkill
- dsh-dependency-auditSkill
- dsh-doc-syncSkill
- dsh-git-commitSkill
- dsh-office-artifactsSkill
- dsh-plugin-clientSkill
- dsh-plugin-devSkill
- dsh-plugin-i18nSkill
- dsh-plugin-publishSkill
- dsh-preset-authoringSkill
- dsh-pr-reviewSkill
- dsh-refactor-safeSkill
- dsh-skill-adapterSkill
- dsh-task-breakdownSkill
- dsh-webapp-testingSkill
The file
Files
测试优先(红 → 绿 → 重构)
流程
- 红:先写一个描述期望行为的测试,运行确认它失败(证明测试真的在测)
- 绿:写最小实现让测试通过,不做任何多余设计
- 重构:在绿灯下改善结构,每步都保持测试通过
边界用例表(写测试时逐项过)
- 空输入、单元素、满容量
- 错误类型、缺字段、超长输入
- 重复调用、并发调用
- 权限不足、文件不存在、网络失败
运行
- Node 内置:
node --test - 项目用 vitest/jest 时跟随项目配置
- 只测公共行为,不测内部实现细节;覆盖率数字不设硬指标,关键路径必须覆盖
修复 bug 的额外要求
先写一个能复现该 bug 的失败测试,再修复;提交信息里写清复现路径。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

