dual-looplisted
Install: claude install-skill richfrem/agent-plugins-skills
# Dual-Loop (Inner/Outer Agent Delegation)
The **Dual-Loop** architecture splits work between a strategic **Outer Loop** (Supervisor/Director) and an execution-focused **Inner Loop** (tactical coding sub-agent). The Outer Loop organizes tasks, delegates via Strategy Packets, verifies output, and generates Correction Packets.
---
## 1. Setup & Interactive Orientation (Outer Loop)
1. **Decomposition**: Break work down into atomic, testable Work Packages (WPs).
2. **Interactive CLI & Model Selection**: Ask user for preferred CLI (`agy`, `claude`, `copilot`, `codex`, `llama`) and model. Consult `references/cheapest_models.json`.
3. **Workspace Isolation**: Receive isolated git worktree or directory branch from orchestrator.
---
## 2. Strategy Packet Generation & Dispatch
1. Author Strategy Packet (`handoffs/task_packet_NNN.md`):
- Scope, target files, acceptance criteria, and explicit "NO GIT" rule for the Inner Loop.
2. Dispatch sub-agent with standard input redirected (`< /dev/null` to prevent `SIGTTIN` halts):
```bash
python scripts/run_agent.py handoffs/task_packet_001.md <target_file> handoffs/result.md \
"Execute strategy packet exactly." --cli <cli> --model "<model>" < /dev/null
```
---
## 3. Supervised Verification Gates
Upon completion signal, the Outer Loop verifies output:
1. **Delta Audit**: Run `git diff` to verify only authorized paths were modified; zero stub placeholders (`TODO`, `TBD`).
2. **Automated Test Run**: Run unit and integration t