Skip to content
Back to skills

Dual Loop

ASecurity

(Industry standard: Sequential Agent / Agent as a Tool) Inner/outer agent delegation pattern via strategy packets, with verification and correction loops.

  • 7 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentspythonbashgitbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned October 3, 2026

npx -y skills add richfrem/agent-plugins-skills --skill dual-loop --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dual Loop?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Dual Loop
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/richfrem-dual-loop-agent-plugins-skills/badge)](https://www.skillsdirectory.com/skills/richfrem-dual-loop-agent-plugins-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: dual-loop
plugin: agent-orchestration
description: "(Industry standard: Sequential Agent / Agent as a Tool) Inner/outer agent delegation pattern via strategy packets, with verification and correction loops."
allowed-tools: Bash, Read, Write
---

# Dual-Loop (`dual-loop`)

Splits work between a strategic Outer Loop (Supervisor) and an execution-focused Inner Loop (tactical coding sub-agent).

## Contents

- [Constraints](#constraints)
- [Quick start](#quick-start)
- [Workflow](#workflow)
- [Verification](#verification)
- [References](#references)

## Constraints

- **Inner loop isolation**: Inner Loop agents are strictly forbidden from running `git` commands.
- **Background execution**: Always redirect standard input (`< /dev/null`) to avoid `SIGTTIN` hangs.
- **Verification gate**: Outer Loop must mechanically verify tests and diffs before merging.
- **Single commit rule**: Commits and merges are executed exclusively by the Outer Loop.

## Quick start

```bash
# Dispatch sub-agent with strategy packet
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
```

## Workflow

1. **Decomposition**: Break work into atomic, testable Work Packages.
2. **Model Selection**: Select companion backend (`agy`, `claude`, `copilot`, `codex`, `llama`) via [cheapest_models.json](references/cheapest_models.json).
3. **Strategy Packet**: Author `handoffs/task_packet_NNN.md` in isolated worktree specifying scope and "NO GIT" rule.
4. **Supervised Review**: Outer Loop audits `git diff` for authorized paths and zero stub placeholders.
5. **Retrospective**: Conduct post-run assessment using [post_run_survey.md](references/post_run_survey.md); escalate repeat friction to triple-loop.

## Verification

```bash
# Verify delta and ensure zero stub placeholders
git -C <WORKTREE_PATH> diff --stat
# Run automated tests against worktree output
pytest <TEST_TARGET>
```

## References

- [acceptance-criteria.md](references/acceptance-criteria.md) — Verification gates and criteria.
- [fallback-tree.md](references/fallback-tree.md) — Escalation protocol for loop stalls and timeouts.
- [post_run_survey.md](references/post_run_survey.md) — Post-run self-assessment survey.
- [cheapest_models.json](references/cheapest_models.json) — Multi-model latency and cost parameters.
- [diagrams/dual_loop_architecture.mmd](references/diagrams/dual_loop_architecture.mmd) — Inner/outer loop architecture diagram.

Files in this skill

  • SKILL.md2.8 KB
  • acceptance-criteria.md869 B
  • evals/evals.json724 B
  • evals/results.tsv301 B
  • fallback-tree.md1.5 KB
  • references/acceptance-criteria.md42 B
  • references/diagrams/dual_loop_architecture.mmd58 B
  • references/fallback-tree.md36 B
  • requirements.txt22 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.