design-agent-loop

design-agent-loop is a skill for Claude Code, Codex, Cursor from emaraschio/cursor-commands. It costs 157 tokens per session (3,444 once invoked), scanned A, original, MIT.

A design method for a reusable agent workflow, represented as a graph of steps such as planning, acting, checking, retrying, and finishing. It defines what each step needs, produces, and must prove.

In plain words
What is it for?
Use it to design repeatable, verifiable agent routines with test cases, retry limits, spending limits, and approval points.
Why use it?
It exposes how repeated work should proceed and when it should retry, stop, escalate, or require human approval before anything is run.

Skill for Claude CodeCodexCursor

Install

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.

agentmods
npx agentmods add skills/emaraschio/cursor-commands/design-agent-loop
Any agent
npx skills add emaraschio/cursor-commands --skill design-agent-loop
Clone the repo
git clone --depth 1 https://github.com/emaraschio/cursor-commands

Made for: Claude Code, Codex, Cursor.

Wrote 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.

agentmods badge for design-agent-loop

README.md
[![agentmods](https://agentmods.dev/badge/skills/emaraschio/cursor-commands/design-agent-loop.svg)](https://agentmods.dev/skills/emaraschio/cursor-commands/design-agent-loop)
Your own site
<a href="https://agentmods.dev/skills/emaraschio/cursor-commands/design-agent-loop"><img src="https://agentmods.dev/badge/skills/emaraschio/cursor-commands/design-agent-loop.svg" alt="Measured on agentmods" height="20"></a>
Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,444 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00157 $0.03444
Opus 5 $0.00078 $0.01722
Sonnet 5 $0.00031 $0.00689
Haiku 4.5 $0.00016 $0.00344

Measured 5d ago against content hash 01040473edb5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 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.

.cursor/skill-contracts/design-agent-loop/SKILL.md · 214 lines

How it starts

The opening of the file, as written. The whole thing — 214 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Design agent loop

Role

You design the loop a repeated task travels through, not the prompt that runs it once. You take a TASK and its COMPLETION CRITERIA and return a graph: nodes with context, tools, expected output, and evidence; transitions with named triggers; retry and escalation edges with ceilings; human approval gates on irreversible work; five eval cases with a scorecard; and one bottleneck to automate first.

This is a two-step handshake. Step one, you design the graph and stop. Step two, only after a later explicit execute now, you run one test case through the loop and improve the loop from what happened. Approving the graph is not permission to run the workload.

When to use

Use when the user invokes /design-agent-loop, or asks to design a reusable agent routine, workflow graph, or state machine for work that repeats and needs verification between steps. For a single delegated run with no repetition or verify cycle, use define-agent-goal. For raising artifact quality against a real reference, use gauntlet-loop. For choosing which business workflow to automate at all, use automation-roi-audit.

Loop charter

Repetition first, or route away. Graph before prompt. Every node states context, tools, expected output, and evidence. Every edge names its trigger. Retries capped, budget ceilinged, irreversible work gated on a human. Unverifiable steps stay manual. Evals sized to volume. One bottleneck first. Design and halt; run one case only on execute now.

Workflow

Run phases in order. Do not start the underlying TASK while designing, and do not run the loop until a later explicit execute now.

Phase 0: Intake

  1. Require two fields:
    • TASK: the work the loop performs on each pass
    • COMPLETION CRITERIA: the exact, observable definition of done for one pass
  2. Optionally accept: CONSTRAINTS (limits the loop must not cross, such as no production writes or do not close tickets), available tools, BUDGET (wall-clock, token, or spend ceiling), retry preferences, and volume (how often this loop runs). Every constraint the user supplies must survive into the design as a forbidden transition, an approval gate, or an eval fail signal. Never accept a constraint and then leave it out of the graph.
  3. If TASK or COMPLETION CRITERIA is missing, ask one focused question per gap. Do not invent the criteria and do not design against a vague bar like "make it good".
  4. Repetition check. If the work runs once, has no verification step, and has no retry cycle, say so and route to define-agent-goal instead of drawing a graph. Do not build a loop for a one-shot delegation.
  5. Do not execute the TASK, edit code, or run destructive commands in this phase.

Read the full file on GitHub · 214 lines

Files

What ships with it

3 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.

Changes

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.

  1. 5d ago First seen · 214 lines · 157 tokens per session scan A 01040473edb5

Subscribe to this mod's changes

design-agent-loop is a skill published in the GitHub repository emaraschio/cursor-commands (9 stars, last pushed 28d ago), licensed MIT. It adds 157 tokens to every session and 3,444 once invoked, about $0.0008 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.

Related

Other skills, from other repositories

grok-build-supervisor

Initialize the persistent local proxy, then immediately ensure a visible Grok Build TUI for the current workspace when /grokexecute on activates, and continuously supervise that coding-agent session through a user-level Supervisor daemon as the user sends work, waits for completion, reconnects from another host task…

Vanyangyang/cursor-bridge · 103 tokens

cursor-delegate

Delegate bounded light-to-medium implementation, investigation, documentation, configuration, testing, and tooling work to Cursor Bridge after the primary agent owns direction and risk boundaries. Also use when the user explicitly asks to create, keep, continue, inspect, or close the same Cursor execution session…

Vanyangyang/cursor-bridge · 151 tokens

grok-executor-mode

Task-local execution policy applied to ordinary user tasks only after an exact /grokexecute on; the host agent then plans, supervises, corrects, and verifies while all implementation and workspace-mutating execution goes through Grok Build Supervisor. Never activate or deactivate from ordinary requests, task text…

Vanyangyang/cursor-bridge · 73 tokens

deep-research

Conducts multi-step deep research on any topic using iterative search, reflection, and synthesis. Use when the user asks to research, investigate, survey, compare, analyze, deep-dive, or explore a topic in depth. Covers web research, codebase analysis, documentation review, mixed-source investigation, and M3…

madebyaris/advance-minimax-m3-cursor-rules · 72 tokens

incident-triage-harness

Production-style incident triage workflow for logs, metrics, code, safe mitigations, and M3 multimodal visual evidence (screenshots, screen recordings). Use when debugging alerts, regressions, outages, or suspicious runtime behavior.

madebyaris/advance-minimax-m3-cursor-rules · 53 tokens

pm-patrol-routine

Project Manager patrol for GitHub repos. Triages new issues, reviews PRs for completeness (not code quality), verifies fixes match issue requirements, closes resolved issues, and coordinates between engineer and reviewer. Integrates with issue-patrol-routine (Scotty) and review-patrol-routine (Rémy).

Yesterday-AI/skills · 69 tokens