用测试驱动开发流程编写新功能、修复缺陷并安全重构代码。
复制安装指令,让 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>…
帮助开发者为代码代理配置性能优化、安全防护与研究优先工作流。
提供数据库迁移、回滚与零停机发布的最佳实践指导,适用于多种 ORM 与 SQL 数据库。
通过双评审智能体对结果进行对抗式校验,提升输出发布前的可靠性
帮助你掌握地道 Rust 模式、所有权与并发实践,编写安全高性能应用。
基于 C++ Core Guidelines 编写、审查并重构更安全现代的 C++ 代码。
为 Claude Code 会话提供系统化校验流程,帮助检查结果正确性与质量。
在开发新功能、修复缺陷或重构时,按测试驱动流程生成高覆盖测试与代码。
通过测试驱动开发流程编写新功能、修复缺陷并安全重构代码。
通过测试驱动开发流程,为新功能、修复和重构生成高覆盖测试与实现方案。
通过测试驱动开发流程,先写测试再实现功能或修复缺陷。
通过先写失败测试再实现代码,帮助稳定完成功能开发与缺陷修复。
用测试驱动方式编写流程文档,先验证再成稿,提升技能说明的可靠性。