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 commands/emaraschio/cursor-commands/design-agent-loopgit clone --depth 1 https://github.com/emaraschio/cursor-commandsWrote 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/commands/emaraschio/cursor-commands/design-agent-loop)<a href="https://agentmods.dev/commands/emaraschio/cursor-commands/design-agent-loop"><img src="https://agentmods.dev/badge/commands/emaraschio/cursor-commands/design-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.00051 | $0.01743 |
| Opus 5 | $0.00026 | $0.00872 |
| Sonnet 5 | $0.00010 | $0.00349 |
| Haiku 4.5 | $0.00005 | $0.00174 |
Grade A, and why
design-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 4d 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 — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Overview
Design the loop, not the prompt. Intake TASK and COMPLETION CRITERIA, draw the node graph (input, plan, act, verify, retry or escalate, done), specify context / tools / expected output / evidence per node, label every transition trigger, cap retries and budget, gate irreversible nodes on human approval, keep unverifiable steps manual, design five eval cases with a scorecard, and pick one bottleneck to automate first. Two-step handshake: design only until the user says execute now, then run one test case and improve the loop. Full workflow: .cursor/skill-contracts/design-agent-loop/SKILL.md (user install: ~/.cursor/skill-contracts/design-agent-loop/SKILL.md).
Defaults
| Setting | Default |
|---|---|
| Required intake | TASK and COMPLETION CRITERIA |
| Optional intake | CONSTRAINTS, tools, BUDGET, volume (constraints must reach the graph) |
| Graph spine | input to plan to act to verify to retry | escalate to done |
| Node fields | Context, tools, expected output, evidence (all four required) |
| Max retries | 3 per retry edge |
| Budget | None beyond retry caps unless the user sets one (state it explicitly) |
| Eval cases | 5 (happy path, retry, escalate, exhaustion, malformed input) |
| Execution | Design only; one test case after an explicit execute now |
| Examples | Generic names only (task-a, node-1) |
Steps
- Read
.cursor/skill-contracts/design-agent-loop/SKILL.mdfor the full agent contract; if that file is missing, read~/.cursor/skill-contracts/design-agent-loop/SKILL.md. - Execute phases in order (Intake → Graph draft → Node specification → Transitions → Controls → Eval design → Bottleneck → Deliver and halt); do not skip the repetition check and do not run the loop before an explicit
execute now. - Report the loop in chat using the deliverable template, ending with the two-step handshake; on a later
execute now, run exactly one eval case and propose loop revisions.
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.
- 4d ago First seen · 63 lines · 51 tokens per session scan A 99605b180e1a
design-agent-loop is a command published in the GitHub repository emaraschio/cursor-commands (9 stars, last pushed 27d ago), licensed MIT. It adds 51 tokens to every session and 1,743 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-31.
Other commands, from other repositories
analyze-deps
Analyze the project's dependency tree, identify unused or duplicate dependencies, and suggest optimizations.
usage-report
Generate a comprehensive team usage and spending report for the current billing cycle.
check-coverage
Check test coverage, identify gaps, and suggest which code needs tests.
fix-issue
Command "fix-issue" from HKTITAN/cursor-best-practices, covering steps and rules.
handle-pr-comments
Fetch all PR comments, classify by severity, and present for user approval before acting.
create-pr
Commit changes and create a PR with proper formatting.