SuperAPI AI Directory

tdd-dev-cycle

Testing & quality

View repository

Updated 10-15 17:31

About this skill

TDD (Test-Driven Development) trunk work loop

This Skill defines the standard TDD development and verification loop.

Applicable Scenarios

If the project charter does not define a specific workflow, the assistant follows the following TDD trunk work loop by default.

Process Details

  1. Intelligent Scheduling

    • Prioritize handling tasks in the backlog with priority: high .
    • After selecting a task, move it from docs/backlog/ to docs/requirements/ and update the status to 开发中, then begin analysis.
  2. Planning and Clarification (TDD)

    • a. Analyze requirements: If ambiguous, ask questions, and update the requirements document.
    • b. Resolve conflicts: If requirements conflict with the project-level charter, ask for clarification on how to handle it. Generally, update the design in the charter.
    • c. Define acceptance criteria: Prioritize writing automated test cases.
    • d. COMMIT 1: git commit -m "完成需求 {文件名} 的分析与测试用例,即将开发"
  1. Development

    • Implement coding based on the test cases.
  2. Development complete -> COMMIT

    • COMMIT 2: git commit -m "完成需求 {文件名} 的开发,即将验证"
  3. Verification and repair loop with circuit breaking

    • a. Run automated tests。
    • b. Success:
      • COMMIT 5: git commit -m "需求 {文件名} 的开发和验证已经全部完成!"
      • Report completion and loop.
    • c. Failure (attempt N):
      • COMMIT 3: git commit -m "验证需求 {文件名} 时遇到问题 {问题描述} (第 N 次尝试),即将修复"
      • Circuit breaker check: If N > 3 times, trigger the circuit breaker, stop, and ask the user for help.
      • Repair: Analyze logs, locate the cause, and write repair code.
      • COMMIT 4: git commit -m "验证需求 {文件名} ,成功解决了问题 {问题描述} (第 N 次尝试)"
      • Return to step 5a to re-verify.

Loop until all backlog tasks are complete, the user interrupts, the instructions change, or the circuit breaker condition is reached.