用测试驱动开发流程编写新功能、修复缺陷并安全重构代码。
复制安装指令,让 AI 自动完成配置 · 推荐新手
请帮我安装 askskill 上的 "tdd-workflow" 技能: 1. 下载 https://raw.githubusercontent.com/affaan-m/ECC/main/skills/tdd-workflow/SKILL.md 2. 保存为 ~/.claude/skills/tdd-workflow/SKILL.md 3. 装好后重载技能,告诉我可以用了
请用 TDD 流程实现“用户可按标签筛选任务”功能。先列出验收标准,再编写单元测试、集成测试和 E2E 测试,最后给出最小实现代码,目标测试覆盖率不低于 80%。
先产出需求拆解与测试用例,再给出通过测试的最小实现代码及覆盖率建议。
我有一个缺陷:购物车在数量为 0 时仍显示总价。请按 TDD 流程处理:先写能复现问题的失败测试,再给出修复方案、补充回归测试,并说明如何验证覆盖率达到 80% 以上。
包含复现缺陷的测试、修复后的代码、回归测试以及覆盖率检查步骤。
请帮助我重构这段旧代码,并严格遵循 TDD。先识别现有行为并补齐特征测试,再提出重构步骤,逐步优化结构,同时保留单元、集成和端到端测试覆盖。
输出当前行为测试、分步重构计划、优化后的代码与测试完整性说明。
This skill ensures all code development follows TDD principles with comprehensive test coverage.
ALWAYS write tests first, then implement code to make tests pass.
HEAD on the active branch and belongs to the current task sequenceAs a [role], I want to [action], so that [benefit]
Example:
As a user, I want to search for markets semantically,
so that I can find relevant markets even without exact keywords.
For each user journey, create comprehensive test cases:
describe('Semantic Search', () => {
it('returns relevant markets for query', async () => {
// Test implementation
})
it('handles empty query gracefully', async () => {
// Test edge case
})
it('falls back to substring search when Redis unavailable', async () => {
// Test fallback behavior
})
it('sorts results by similarity score', async () => {
// Test sorting logic
})
})
npm test
# Tests should fail - we haven't implemented yet
This step is mandatory and is the RED gate for all production changes.
Before modifying business logic or other production code, you must verify a valid RED state via one of these paths:
A test that was only written but not compiled and executed does not count as RED.
Do not edit production code until this RED state is confirmed.
If the repository is under Git, create a checkpoint commit immediately after this stage is validated. Recommended commit message format:
test: add reproducer for <feature or bug>…
帮助用户用 Perl 测试框架编写、运行与改进自动化测试及覆盖率分析。
帮助你设计并实现 F# 单元、属性与集成测试的最佳实践
帮助你用地道 Go 实践编写测试、基准、模糊测试并提升覆盖率。
帮助用户在回答前选择简短、标准或详细版本,控制回复深度与 token 用量。
帮助你为 Spring Boot 项目实施测试驱动开发,覆盖新增、修复与重构场景
调用 Nutrient DWS API 处理文档转换、OCR提取、脱敏签署与表单填写
通过测试驱动开发流程,先写测试再实现功能或修复缺陷。
通过先写失败测试再实现代码,帮助稳定完成功能开发与缺陷修复。
用测试驱动方式编写流程文档,先验证再成稿,提升技能说明的可靠性。
帮助开发者用先写测试再实现代码的方式提升质量与可维护性。
帮助开发者编写关注行为、抗重构且可验证修复意图的高质量测试。
帮助 AI 在隔离工作区运行 Jest/TypeScript 测试,支持测试驱动开发流程。