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/impactbrussels/ainativeos/design-a-loopnpx skills add impactbrussels/AINativeOS --skill design-a-loopgit clone --depth 1 https://github.com/impactbrussels/AINativeOSWrote 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/impactbrussels/ainativeos/design-a-loop)<a href="https://agentmods.dev/skills/impactbrussels/ainativeos/design-a-loop"><img src="https://agentmods.dev/badge/skills/impactbrussels/ainativeos/design-a-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.00129 | $0.01948 |
| Opus 5 | $0.00064 | $0.00974 |
| Sonnet 5 | $0.00026 | $0.00390 |
| Haiku 4.5 | $0.00013 | $0.00195 |
Grade A, and why
design-a-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 3d 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 — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Design a Loop
A loop is a small system that finds the work, hands it to the agent, checks the result, records what happened, and decides the next move on its own. You design it once; it prompts the agent from then on. The leverage has moved from typing the prompt to designing the system that prompts. That is real power and a real bill. A loop with no gate does not stop being wrong, it stops telling you, and it spends the whole time. Build one only where the work repeats, the check is machine-gradable, and the floor is hard.
The method
Build tier. Full framework, tables, and a worked example:
references/loop-engineering.md. Standalone explainer:
docs/LOOP-ENGINEERING.md.
Step 1: Run the 4-condition test
Build a loop only if all four hold. Miss one and the loop costs more than it returns; do the task by hand.
| # | Condition | Pass looks like | Fail means |
|---|---|---|---|
| 1 | The task repeats | Weekly or more, same shape | One-off: just prompt it |
| 2 | Verification is automated | A test, type check, lint, or build fails the work without you in the room | No machine grader: you are the gate, so no loop |
| 3 | The token budget absorbs waste | Loops re-read, retry, explore; you can pay for that | Tight budget: the loop eats it on retries |
| 4 | The agent has senior tools | Logs, a reproduction environment, the ability to run its own code | Blind agent: it guesses, you clean up |
Step 2: Pick the building blocks
Five blocks plus state. Start with the fewest that close the loop; add only when a failure demands it.
- Automation (the heartbeat): a schedule, an event, or a trigger.
/loopfor a fixed cadence;/goalto run until a written condition holds, checked by a separate model. - Worktree isolation: git worktrees so parallel agents do not collide on the same files.
- Skills: the persistent project knowledge the agent reads every run.
- Connectors and MCP: the reach into GitHub, Linear or Jira, Slack, the error tracker.
- Sub-agents: separate the maker from the checker (the evaluator-optimizer pattern).
- The state file: the agent forgets between runs; the repo remembers.
STATE.mdlets it resume, not restart. Pair it with a standingVISION.mdorAGENTS.mdspec the agent rereads each run.
What ships with it
1 file 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.
- 3d ago First seen · 122 lines · 129 tokens per session scan A a235ecb317ab
design-a-loop is a skill published in the GitHub repository impactbrussels/AINativeOS (1 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 129 tokens to every session and 1,948 once invoked, about $0.0006 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-31.
Other skills, from other repositories
agent-session-monitor
Real-time agent conversation monitoring - monitors Higress access logs, aggregates conversations by session, tracks token usage. Supports web interface for viewing complete conversation history and costs. Use when users ask about current session token consumption, conversation history, or cost statistics.
embedding-strategies
Select and optimize embedding models for semantic search and RAG applications. Use when choosing embedding models, implementing chunking strategies, or optimizing embedding quality for specific domains.
docx-comment-reply
Reply to comments (批注) in Word .docx/.doc files: extract comment context, draft replies, write threaded replies back, and validate OOXML.
oma-hwp
Convert HWP / HWPX / HWPML files to Markdown using kordoc. Extracts text, headings, tables, lists, images, footnotes, and hyperlinks. Use for Korean word processor files (Hangul), government documents, and AI-ready data preparation.
moai-ref-ui-polish
UI polish and interface-completion reference: the small visual details — concentric border radius, optical alignment, shadow-vs-border, motion easing, typography smoothing, tabular numbers, icon stroke weight, hit areas — that separate polished interfaces from generic ones. Agent-extending skill that amplifies…
trellis-brainstorm
Guides collaborative requirements discovery before implementation. Creates task directory, seeds PRD, asks high-value questions one at a time, researches technical choices, and converges on MVP scope. Use when requirements are unclear, there are multiple valid approaches, or the user describes a new feature or complex…