loop-design-check
Lets your agent design or check operational loops. It ensures agents achieve goals without failures or unwanted behaviors.
What it does
This tool helps you create or check a 'loop' for repetitive AI tasks. It ensures the AI follows the defined goal and doesn't get stuck or produce incorrect results.
When to use it
- ✓When creating a task that the AI needs to repeat many times.
- ✓When you suspect an AI's repetitive task is stuck or producing wrong results.
- ✓To ensure the AI understands and follows a clear, measurable goal.
Example of what to ask your AI
“I want to create a loop for the AI to automatically review my weekly reports and notify me of any inconsistencies.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It works by defining a clear goal that the AI can verify on its own. Then, the tool helps set up the loop so the AI tries to achieve this goal, with mechanisms to prevent it from getting lost or malfunctioning.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add affaan-m/ECC --skill loop-design-checkOr download just the file:
curl -L https://raw.githubusercontent.com/affaan-m/ECC/main/skills/loop-design-check/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
Loop Design + Review
Premise. An LLM is a feed-forward system: prompt in → tokens out, with no built-in "steer toward the goal" across turns. To make it behave like a goal-oriented system, you wrap a feedback loop around it. This skill helps you write that loop correctly and review it so it won't run away.
When to use / not
Use it when:
- You want to hand a repeating task to an agent that runs over and over (write→test, test→fix, fix→verify…).
- You already have a loop and worry it spins, cheats, or runs a wrong answer to completion.
Don't use it for:
- A one-off task → just do it; don't wrap a loop around it.
- A plain timer / poll → use
/loop; no design needed. - How to wire the loop architecture (pipelines → DAGs, long-run recovery) → that's the mechanism layer; see
autonomous-loops/continuous-agent-loop. This skill only covers "is the goal right, and will it run away" — it does not re-explain mechanism.
Red-line premise: two levels of feedback
| Level | Who owns it | What it does |
|---|---|---|
| Execution (low) | machine / agent | Measures "how far from the literal goal" and grinds it to zero. The machine is strong here. |
| Judgment (high) | human | Decides "is this goal itself right, should it change, should it stop." The machine can't step outside its own loop to question the goal. |
A thermostat can feed back "how far from 26°C," but when you have a fever and want 28°C it can't judge whether 26 is the right target — it just grinds toward 26. "What to set today" is always the human's call. Handing judgment / sign-off / the last switch to the machine = removing the high-level feedback = it sprints, fast and hard, toward a goal no one questioned → wrong output.
Action 1 — Write a loop (5 steps)
Step 0 · Subtract first: should you even build it? (4-condition gate, any miss = veto)
① the task repeats weekly or more ② verification can be automated ③ the token budget can take it ④ the agent has tools that actually run and see the result
Miss any one → don't build a loop; do it by hand or another way.
What stops most people isn't "can I write a loop," it's "does my repo deserve one." A repo that deserves a loop has a reconciliation baseline (golden sample / upstream total) + tests + a lint guard. A repo that doesn't deserve a loop will only have its errors amplified by one.
Step 1 · Define a machine-decidable goal (the hard part — the loop lives or dies here)
The whole loop rides on the comparator's "is it done yet?" The comparator can only work if your exit condition can be judged yes/no by a machine.
- Bad: Vague ("make it good," "write it sharper") → the comparator can't judge → either it never passes (stuck retrying) or it guesses (passes/blocks at random).
- Good: Decidable ("all 96 unit tests green AND a change-list is produced," "module-02 fields filled, pytest passes, business logic untouched") → one check settles it; the loop converges cleanly.
Five-point goal framework:
- Done-criterion is machine-verifiable.
- Boundary conditions defined alongside the done-criterion ("what it must NOT do") — anti-Goodhart; missing boundaries = a license to cheat.
- Has a failure fallback — retry cap N + escalate to a human when exceeded.
- Goal is layered.
- Prefer reconciliation over assertion for the done-criterion — anchor to external fact (golden sample / upstream total / financial tie-out / platform back-office numbers) before your own assertions. "All tests pass" can be gamed (loosen asserts, fake mocks, swallow exceptions); "diff vs the reference < 0.01" can't.
Self-check: read the goal to someone who doesn't know the domain — can they run one command and tell whether it's done? If not, it isn't decidable enough. Go back.
Step 2 · Pick the loop type
| Your task | Loop type (cybernetic) | How it stops |
|---|---|---|
| Has a clear "done" test (write to done / a batch of images processed) | servo (/goal-style closed-loop) |
stops on reaching the goal |
| No endpoint, must keep maintaining a state (inventory alert / scheduled health check) | regulator (/loop-style thermostat) |
never stops; acts only on change (dead-band suppresses noise) |
| Periodic sampling, stop on a condition (watch a PR until CI is green) | regulator with an exit | stops when the exit condition holds |
…
FAQ
What is an AI 'loop'?
It's like giving the AI a continuous task. Instead of asking for something once, you set it up to repeat an action, check the result, and continue until the goal is met or something goes wrong.
Why might an AI get lost or produce wrong results?
Without a clear, verifiable goal, the AI might guess what you want, repeat the same thing endlessly (spin), or find 'shortcuts' to seem finished without delivering the correct outcome.
What's the difference between the 'execution level' and 'judgment level'?
The execution level is the AI trying to achieve the goal step-by-step. The judgment level is you (human) deciding if the goal itself is correct, if the AI is on the right track, or if it needs to stop. The AI cannot judge the goal, only follow it.
Details
Original description by the author
Design a goal-oriented agent loop or review one for failure modes: spinning, Goodhart-gaming the verifier, or running a wrong answer to completion. Covers machine-decidable goals, loop types, plan/build/judge skeletons, and runaway prevention; mechanism wiring lives in autonomous-loops. Use when designing, writing, or checking an agent loop. 中文触发:写 loop、设计 loop、做一个 loop、检查 loop 对不对、loop 体检、loop 会不
repo: affaan-m/ECC
Popularity
- GitHub stars
- 280k
- Ranking position
- #228
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
accessibility
Helps your agent create interfaces that everyone can use. Ensures websites and apps work well for people with disabilities, like those who are blind or have reduced mobility.
affaan-m/ECC
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC
Similar skills
mcp-builder
Helps your agent create servers that connect LLMs to external services. Essential for integrating APIs and services using Python or Node/TypeScript.
anthropics/skills
prepare-mcp-integration
Prepares vendor (MCP) integrations through research and human approval. It follows a guided process for new integrations.
paperclipai/paperclip
first-task
Guides the agent on the user's first task. It interprets the initial answer, clarifies the goal, and proposes a plan or single task for approval.
paperclipai/paperclip