用测试驱动开发流程编写新功能、修复缺陷并安全重构代码。
复制安装指令,让 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>…
扫描 Claude Code 配置中的安全漏洞、误配与注入风险并给出检查结果
帮助用户搭建 WireGuard VPN、配置客户端并安全远程访问家庭网络。
读取计划文档并拆解步骤,生成可直接粘贴的 /orchestrate 链式提示词
为 Spring Boot 与 Quarkus 服务生成并统一应用 Java 编码规范。
帮助你设计 Quarkus 3 后端架构模式,覆盖消息、REST、数据访问与异步处理。
将界面截图或设计稿批量转换为 Vue 3 组件代码,适配常见组件库。
通过测试驱动开发流程,先写测试再实现功能或修复缺陷。
通过先写失败测试再实现代码,帮助稳定完成功能开发与缺陷修复。
用测试驱动方式编写流程文档,先验证再成稿,提升技能说明的可靠性。
帮助开发者用先写测试再实现代码的方式提升质量与可维护性。
帮助你为 Spring Boot 项目实施测试驱动开发,覆盖新增、修复与重构场景
帮助开发者编写关注行为、抗重构且可验证修复意图的高质量测试。