← ClaudeAtlas

auto-feedback-looplisted

Implement self-correcting agent loops — run tests, capture failures, feed error context back to the writing agent, and repeat until pass or max-attempts reached. Inspired by Microsoft AutoGen's multi-agent reflection pattern. Use when asked about "auto-feedback loop", "self-correcting agent", "AutoGen reflection", "agent retry on failure", "tdd feedback loop", "automatic fix loop", "agent keeps fixing until tests pass", "feedback-loop script", "run-until-green", or "agent self-correction". Do NOT use for: one-shot test runs — see tdd-workflow. Do NOT use for: multi-agent task assignment — see ai-team-workflow.
phamlongh230-lgtm/yamtam-engine · ★ 3 · AI & Automation · score 65
Install: claude install-skill phamlongh230-lgtm/yamtam-engine
## When to Use - Use when: an agent writes code that fails tests, needs to self-correct without human - Use when: wiring `/tdd-cycle` to run continuously until all checks pass - Use when: building a CI gate that lets the agent fix its own failures - Do NOT use for: infinite retry loops — always set a max attempt limit - Do NOT use for: human-in-the-loop correction — this is fully automated --- ## The AutoGen Reflection Pattern ``` Writer Agent ──► produces output │ ▼ Critic/Test Agent runs checks │ ┌─────────┴─────────┐ │ PASS │ FAIL ▼ ▼ accept extract error context │ ▼ feed error back to Writer │ ▼ Writer revises output │ loop (max N) ``` --- ## feedback-loop.sh — The Core Script ```bash #!/usr/bin/env bash # core/scripts/feedback-loop.sh # Usage: bash core/scripts/feedback-loop.sh <test-cmd> <max-attempts> # Example: bash core/scripts/feedback-loop.sh "npm test" 5 set -uo pipefail TEST_CMD="${1:-npm test}" MAX_ATTEMPTS="${2:-5}" SIGNAL_DIR=".claude/signals" mkdir -p "$SIGNAL_DIR" attempt=1 while [[ $attempt -le $MAX_ATTEMPTS ]]; do echo "=== Att