Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/bainianlaoyao/agent-loop-designer/agent-loopnpx skills add bainianlaoyao/agent-loop-designer --skill agent-loopgit clone --depth 1 https://github.com/bainianlaoyao/agent-loop-designerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/bainianlaoyao/agent-loop-designer/agent-loop)<a href="https://agentmods.dev/skills/bainianlaoyao/agent-loop-designer/agent-loop"><img src="https://agentmods.dev/badge/skills/bainianlaoyao/agent-loop-designer/agent-loop.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00061 | $0.01136 |
| Opus 5 | $0.00030 | $0.00568 |
| Sonnet 5 | $0.00012 | $0.00227 |
| Haiku 4.5 | $0.00006 | $0.00114 |
Grade A, and why
agent-loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Loop
Role
Design one artifact: loop.md. It fixes the decisions a loop must settle and
leaves execution to the user's external goal mode. Do not run the loop, write
executors, generate launcher code, or prescribe mechanics such as while
blocks, phases, tool dispatch, or state layout.
Use assets/loop-template.md as the blank output shape when drafting a new
loop.md. Use references/review-checklist.md during review, whenever a
residual appears, or when subagent policy is in scope.
Output Shape
loop.md is a design contract. Include only sections that are needed for the
task, but keep the spine:
- Goal & Success Signal - one goal and an observable completion test. Avoid vague signals such as "done", "looks good", or "task complete".
- Termination Conditions - max iterations or budget, the concrete shape of no progress, and the goal-achievement check.
- Progress Invariant - the bounded quantity every path advances toward an exit. A path that neither terminates nor advances is undeliverable.
- Approval Gates - only for irreversible actions. State the gated action, grant consequence, and deny consequence. Do not gate separable safe work.
- Measurement Domain - match verification to the output domain: code uses tests, visual work uses renders/screenshots, interactive work is driven, and data work uses queries or checks.
- Residual Routing - route iteration failures to LOCAL (retry in loop), PLANNER (re-scope), or HUMAN (escalate).
- Subagent Using Policy (only if dispatching subagents) - define the dispatch contract, not the dispatch mechanism: trigger, role capability, input contract, output contract and acceptance check, concurrency, failure routing, and sub-task termination.
For the exact blank document, copy the shape from assets/loop-template.md.
Workflow
compile goal -> survey role capability -> grill -> draft -> review -> user diff -> accept
- Compile goal - extract task, success signal, risk surface, and output domains.
- Survey role capability - before grilling subagent selection, inspect the current platform's available role capabilities and tool boundaries. Use this as the strawman for any subagent dispatch contract. Skip this only when the loop will not dispatch subagents.
- Grill - resolve one design branch at a time with 2-3 related questions. Each question includes a recommended answer for the user to accept or correct. Push back on vague answers with a sharper strawman.
- Draft - write Goal, Termination, and Progress Invariant first; then fill the needed optional sections from the decision log.
- Review - read
references/review-checklist.md; fix LOCAL residuals in place, re-scope PLANNER residuals, and escalate HUMAN residuals. - User diff - change only the sections the user names.
- Accept - deliver when the user accepts and no residuals remain.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 111 lines · 61 tokens per session scan A f4842113af75
agent-loop is a skill published in the GitHub repository bainianlaoyao/agent-loop-designer (11 stars, last pushed 2mo ago), licensed MIT. It adds 61 tokens to every session and 1,136 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
local-ai-agents
Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…
chronicle
Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…
imagegen
Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…