| name | loop-writer |
| description | Write a custom control policy only when current runtime composition APIs cannot express it. |
Loop Writer
Use this only for a control policy that the shipped high-level APIs cannot express.
Read docs/canonical-api.md, current exports, the implementation, and the nearest test before writing code.
Do not copy signatures from this skill.
Choose The Existing Path First
| Need | Existing path |
|---|
| One product chat turn | handleChatTurn(...) |
| One task or bounded multi-turn task | runAgentTask(...) or runAgentTaskStream(...) |
| Two or more actors taking turns | defineConversation(...) and runConversation(...) |
| A driver coordinating workers | supervise(...) or superviseSurface(...) |
| Parallel or fixed composition | fanout(...), pipeline(...), panel(...), verify(...), or loopUntil(...) |
| Parallel repository workers with isolated branches | worktreeFanout(...) |
| Repeated work in a graded tool environment | runAgentic(...) |
| Equal-budget comparison over that environment | runBenchmark(...) |
| Low-level round policy with custom planning and stopping | runAgentRounds(...) |