auto-feedback-looplisted
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