← ClaudeAtlas

autonomous-loopslisted

Six proven autonomous agent loop patterns with guard rails. Provides reusable patterns for generate->validate->fix, explore->hypothesize->test, and other autonomous workflows. Includes the reviewer-never-authored principle for quality assurance. Use when: (1) Building autonomous agent workflows, (2) Designing self-correcting pipelines, (3) Implementing agent retry/fix loops, (4) Setting up multi-agent review processes, (5) User asks about agent loop patterns.
stevengonsalvez/agents-in-a-box · ★ 14 · AI & Automation · score 71
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