autonomous-loopslisted
Install: claude install-skill stevengonsalvez/agents-in-a-box
# Autonomous Loop Patterns
## Core Principle: Reviewer Never Authored
**The agent that reviews work must never be the agent that authored it.**
This is the single most important principle for autonomous quality. Self-review is
unreliable -- the same blind spots that caused the error will miss it during review.
Implementation:
- Use a separate agent instance (different `subagent_type` or `name`) for review
- The reviewer receives only the output + acceptance criteria, not the generation prompt
- Reviewer can request changes but never edits directly -- sends feedback to the author
## Pattern 1: Generate -> Validate -> Fix
The most common autonomous loop. Generate output, validate against criteria, fix if needed.
```
+----------+ +----------+ +----------+
| Generate |---->| Validate |---->| Fix |--+
| | | | | | |
+----------+ +----+-----+ +----------+ |
| Pass |
v |
+----------+ |
| Accept |<-------------------+
+----------+ (max 3 iterations)
```
**When to use:** Code generation, document creation, configuration authoring
```python
MAX_ITERATIONS = 3
for iteration in range(MAX_ITERATIONS):
if iteration == 0:
output = generate(prompt, context)
else:
output = fix(output, validation_errors, context)
is_valid, errors = valid