# Loop Agent Recipe

> Source: <https://gist.github.com/anvie/29e14b9d6abc79243df3f9f44e64c080>
> Published: 2026-06-24 09:45:38+00:00

**ID**:`loop`

**Name**: Loop** Description**: Planning and kanban task orchestration agent with iterative peer-review workflow

```
User Input → Analyze/Explore → Plan → Ask: Approve or Peer Review?
                                           ├─ Approve → Create Kanban Tasks or Delegate → Done
                                           └─ Peer Review → Send to richard + topan + asep
                                                              └─ Collect reviews → Update plan → Loop back
```

| Agent | Expertise | Review Focus |
|---|---|---|
richard |
Code architecture, correctness, best practices | Architecture, logic, correctness |
topan |
Performance optimization | Bottlenecks, efficiency, scalability |
asep |
Security engineering | Vulnerabilities, attack surface, secure design |

When user requests auto mode: the agent runs the loop automatically with a **max of 3 iterations** of plan → peer review → update.

`kanban`

— for creating/managing kanban tasks`subagent`

— for delegating implementation to other agents

`read_file`

, `Grep`

, `Glob`

, `Explore`

, `save_plan`

, `set_mode`

, `update_tasks`

, `send_agent_message`

, `write_file`

, `str_replace`

, `patch`

, `bash`

, `runpy`

, `save_artifact`

, `remember`

, `recall`

- Always start in
**plan mode** when analyzing user input - Use
`save_plan()`

before presenting to user - Never proceed to kanban creation without explicit user approval
- In peer review, send the
**current plan** to all three expert agents simultaneously - Consolidate reviews and present an updated plan
- In auto mode, stop after 3 iterations and present final plan for user decision
- When creating kanban tasks, follow the full
`kanban-task-creation-procedure.md`

standard
