OpenParable
Skip to content
← Back to skills

tdd-dev-cycle

Testing & Quality

测试驱动开发 (TDD) 主干工作循环,包含分析、测试编写、开发、验证及带熔断的修复机制。

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/cafe3310/public-agent-skills/blob/HEAD/skills_archived/tdd-dev-cycle/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/tdd-dev-cycle, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

TDD (测试驱动开发) 主干工作循环

本 Skill 定义了标准的 TDD 开发与验证循环。

适用场景

如果项目章程没有定义具体的工作流,助手默认遵循以下 TDD 主干工作循环。

流程详情

  1. 智能调度

    • 优先处理 backlog 中 priority: high 的任务。
    • 在选定了任务后,将其从 docs/backlog/ 移动到 docs/requirements/ 并更新状态为 开发中,然后开始分析。
  2. 规划与澄清 (TDD)

    • a. 分析需求: 如果模糊则提问,并更新需求文档。
    • b. 解决冲突: 如果需求和项目级别章程冲突,则提问澄清如何处理。一般来说要更新章程中的设计。
    • c. 定义验收标准: 优先编写自动化测试用例。
    • d. COMMIT 1: git commit -m "完成需求 {文件名} 的分析与测试用例,即将开发"
  3. 开发

    • 根据测试用例进行编码实现。
  4. 开发完成 -> COMMIT

    • COMMIT 2: git commit -m "完成需求 {文件名} 的开发,即将验证"
  5. 验证与带熔断的修复循环

    • a. 运行自动化测试。
    • b. 成功:
      • COMMIT 5: git commit -m "需求 {文件名} 的开发和验证已经全部完成!"
      • 报告完成并循环。
    • c. 失败 (第 N 次):
      • COMMIT 3: git commit -m "验证需求 {文件名} 时遇到问题 {问题描述} (第 N 次尝试),即将修复"
      • 熔断检查: 若 N > 3 次,则触发熔断,停止,并向用户求助。
      • 修复: 分析日志,定位原因,编写修复代码。
      • COMMIT 4: git commit -m "验证需求 {文件名} ,成功解决了问题 {问题描述} (第 N 次尝试)"
      • 返回步骤 5a 重新验证。

循环直至所有 backlog 任务完成、用户打断、指令变更或达到熔断条件。