task-loop

duyet's avatarfrom duyet

Iterative execution methodology. Small steps, verify each, adapt based on results.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 8, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill provides a robust iterative execution framework designed to enhance agent reliability and transparency. By breaking complex objectives into a structured 'Understand-Plan-Execute-Verify' loop, it prevents common AI pitfalls such as over-ambitious single-step executions and unverified failures. It ensures every action is validated against success criteria, making it an essential methodology for high-precision automated problem-solving and long-running task management.

Use Cases

  • Incremental Software Development: Breaking down large feature requests into small, manageable code changes with mandatory test verification after every iteration to ensure system stability.
  • Systematic Debugging and Troubleshooting: Resolving complex technical issues through a step-by-step diagnostic process that adapts its plan based on the real-time results of each command executed.
  • Multi-stage Data Processing: Executing complex data extraction or transformation tasks where each step's output must be verified for accuracy before the agent proceeds to the next phase.
  • Autonomous Project Execution: Managing long-term goals by maintaining a clear state of progress, allowing the agent to resume or pivot effectively if blockers are encountered.
nametask-loop
descriptionIterative execution methodology. Small steps, verify each, adapt based on results.

Task Loop

Duyetbot's loop-based approach to task execution.

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

Iteration Template

### Iteration 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

Progress Format

[x] Step 1: Done (iter 1)
[x] Step 2: Done (iter 2)
[ ] Step 3: Current (iter 3)
[ ] Step 4: Pending

Termination

Success

  • All acceptance criteria met
  • Tests passing
  • Code clean

Stop

  • Blocker requiring human input
  • Max iterations reached
  • Same step failed 3x

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

Don't: Skip Verification

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

Don't: Ignore Failures

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