task-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Task Loop

任务循环

Duyetbot's loop-based approach to task execution.
Duyetbot基于循环的任务执行方法。

Philosophy

核心理念

  • Small steps: Each iteration = one meaningful change
  • Verification: Every change validated before continuing
  • Visibility: Progress tracked and communicated
  • Adaptability: Plan adjusts based on what's learned
  • 小步推进:每次迭代 = 一个有意义的变更
  • 验证机制:每次变更在继续前都要经过验证
  • 进度可见:进度被跟踪并同步
  • 灵活适配:根据学习到的内容调整计划

Loop Structure

循环结构

┌──────────────┐
│  UNDERSTAND  │  What's current state?
└──────┬───────┘
┌──────────────┐
│     PLAN     │  What's single next step?
└──────┬───────┘
┌──────────────┐
│   EXECUTE    │  One change only
└──────┬───────┘
┌──────────────┐
│    VERIFY    │  Did it work?
└──────┬───────┘
   Complete? ──NO──► Loop
      YES
     DONE
┌──────────────┐
│  UNDERSTAND  │  当前状态是什么?
└──────┬───────┘
┌──────────────┐
│     PLAN     │  下一步的单一动作是什么?
└──────┬───────┘
┌──────────────┐
│   EXECUTE    │  仅执行一项变更
└──────┬───────┘
┌──────────────┐
│    VERIFY    │  执行成功了吗?
└──────┬───────┘
   Complete? ──NO──► 循环
      YES
     完成

Iteration Template

迭代模板

markdown
undefined
markdown
undefined

Iteration N

第N次迭代

State: What's done / pending Goal: What this iteration accomplishes
Execution: [1] Action → Result
Verify:
  • Works as expected
  • Tests pass
Next: What comes after
undefined
状态:已完成/待处理事项 目标:本次迭代要达成的成果
执行步骤: [1] 操作 → 结果
验证:
  • 符合预期
  • 测试通过
下一步:后续计划
undefined

Progress Format

进度格式

[x] Step 1: Done (iter 1)
[x] Step 2: Done (iter 2)
[ ] Step 3: Current (iter 3)
[ ] Step 4: Pending
[x] 步骤1:已完成(迭代1)
[x] 步骤2:已完成(迭代2)
[ ] 步骤3:进行中(迭代3)
[ ] 步骤4:待处理

Termination

终止条件

Success

成功终止

  • All acceptance criteria met
  • Tests passing
  • Code clean
  • 所有验收标准均满足
  • 测试全部通过
  • 代码整洁规范

Stop

主动停止

  • Blocker requiring human input
  • Max iterations reached
  • Same step failed 3x
  • 遇到需要人工介入的阻塞问题
  • 达到最大迭代次数
  • 同一步骤连续失败3次

Anti-Patterns

反模式示例

Don't: Giant Iterations

避免:巨型迭代

BAD:  Iteration 1: Implement entire feature
GOOD: Iteration 1: Data model
      Iteration 2: Core logic
      Iteration 3: Error handling
      Iteration 4: Tests
BAD:  Iteration 1: Implement entire feature
GOOD: Iteration 1: Data model
      Iteration 2: Core logic
      Iteration 3: Error handling
      Iteration 4: Tests

Don't: Skip Verification

避免:跳过验证

BAD:  Execute → Execute → Execute → Check
GOOD: Execute → Verify → Execute → Verify
BAD:  Execute → Execute → Execute → Check
GOOD: Execute → Verify → Execute → Verify

Don't: Ignore Failures

避免:忽略失败

BAD:  Test failed, moving on
GOOD: Test failed, investigating cause
BAD:  Test failed, moving on
GOOD: Test failed, investigating cause