loop-design-check

A skill for designing and checking goal-directed loops in which an agent repeatedly performs work and receives feedback. It also checks whether the goal, stopping rules, boundaries, and human review are sound.

In plain words
What is it for?
Use it when turning a recurring task into an agent loop or auditing an existing loop for clear verification, safe limits, fallback behavior, and human approval.
Why use it?
It helps prevent automated work from repeating pointlessly, optimizing the wrong target, exceeding limits, or deciding on its own when a human should intervene.

Skill for Claude CodeCodex

Part of the docs-governance plugin — 8 skills, 7 commands, 6 agents, 1 hook shipped together

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/seekers2001/docs-governance/loop-design-check
Any agent
npx skills add Seekers2001/docs-governance --skill loop-design-check
Clone the repo
git clone --depth 1 https://github.com/Seekers2001/docs-governance

Made for: Claude Code, Codex.

Or install docs-governance, the plugin that ships this one along with the rest of its 8 skills, 7 commands, 6 agents, 1 hook.

Per session 242 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,937 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.00242 $0.02937
Opus 5 $0.00121 $0.01469
Sonnet 5 $0.00048 $0.00587
Haiku 4.5 $0.00024 $0.00294

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

Security

Grade A, and why

loop-design-check 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.

skills/loop-design-check/SKILL.md · 127 lines

How it starts

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

Loop 设计 + 体检

一句话前提:LLM 本身是前馈系统(prompt 进 → token 出,跨轮之间没有内建的"朝目标纠偏"能力)。要它表现得像目标导向系统,得在外面包一条反馈回路(loop)。这个 skill 帮你写对这条回路、并体检它不会跑飞。

何时用 / 不用

  • 想把一个重复任务交给 agent 自动反复跑(写完测、测完修、改完验…)。
  • 已经写了个 loop,但担心它空转 / 作弊 / 跑飞,要体检。

不用

  • 一次性任务 → 直接做,别套循环。
  • 纯定时提醒 / 轮询 → 用 /loop 命令即可,不需要"设计"。
  • "怎么搭循环的工程架构(管道→DAG、长跑恢复)" → 那是机制层,看 autonomous-loops / continuous-agent-loop本 skill 只管"目标定得对不对、会不会跑飞"这层判断,不重写机制。

红线前提:两层反馈(先记死,违反则全盘皆输)

谁管 干什么
执行层(低层) 机器 / agent 测"离字面目标还差多少",死磕缩到 0。机器很强。
判断层(高层) 判"这目标本身对不对、要不要改、要不要停"。机器跳不出自己的回路质疑目标。

空调能反馈"离 26 度差多少",但你发烧想要 28 度时,它判断不了"26 度对不对"——只会死磕 26。"今天该设几度"永远是人。 把判断 / 验收 / 最后一格交给机器 = 撤掉高层反馈 = 机器照着没人质疑的目标又快又狠地狂奔 → 出错。


动作一:写一个 loop(5 步)

步 0 · 先做减法:该不该建?(四条件入场券,缺一票否决)

① 任务每周以上重复 ② 验证能自动化 ③ token 预算扛得住 ④ agent 有"能真跑起来看结果"的工具

任一不满足 → 别建 loop,手动做或换别的方式。

卡住大多数人的不是"会不会写循环",是"你那个仓库配不配得上一个循环"。配得上的仓库 = 有对账基线(golden sample / 上游合计)+ 单测 + lint 守护。配不上循环的仓库,循环只会放大错。

步 1 · 定一个"可判定"的目标(最吃劲,loop 成败全在这)

整条回路靠"比较器"那句"达成了吗"。比较器能不能干活,全看你给的退出条件能不能被机器清楚判 yes/no。

  • ❌ 模糊("把这个做好""写高级点")→ 比较器没法判 → 要么永远不放行(卡死反复重试),要么瞎放行/瞎拦截。
  • ✅ 可判定("96 个单测全绿且出改动清单""模块02字段补全、pytest 全过、没改业务逻辑")→ 一查就知道,回路干净收敛。

目标定义五条框架:

  1. 完成标准可被机器验证
  2. 边界条件和完成标准一起定义("不能怎么做")——防 Goodhart,缺边界 = 给 agent 发作弊许可证。
  3. 有失败降级方案——重试上限 N + 超了升级人工。
  4. 目标分层
  5. 完成标准优先"对账型"而非"断言型"——锚外部事实(golden sample / 上游合计 / 财务勾稽 / 平台后台数字),其次才是自己写的断言。"测试全过"能被钻(改松断言、注水 mock、吞异常);"和 VBA 差异 < 0.01"钻不了。

自检:把目标念给一个不懂业务的人,他能不能跑一条命令就判出"到没到"?不能 → 还不够可判定,回来改。

步 2 · 选回路类型

你的任务 回路(控制论对应) 怎么停
有明确"完成"判据(写到 done / 一批图处理完 / researcher 出 findings) servo/goal 型,闭环伺服) 到目标就停
没终点、要持续维持(库存预警 / 报表定时体检) regulator/loop 型,恒温器) 不停,有变化才动作([SILENT] 死区压噪声)
周期采样、满足条件就停(盯 PR 直到 CI 绿) 带退出的 regulator 退出条件满足就停
要"确保某事按时发生" 把上面包进 /schedule cron 到点触发

经验法则:有"完成"判据 → servo;要持续维持没终点 → regulator;要"按时发生" → regulator 包进 schedule。 (/goal 本质就是一个总返回 block 的 Stop 钩子:agent 想停但"不准停"直到达标——是 veto,不是 push。)

Read the full file on GitHub · 127 lines

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. 3d ago First seen · 127 lines · 242 tokens per session scan A 711e70d4d330

Subscribe to this mod's changes

loop-design-check is a skill published in the GitHub repository Seekers2001/docs-governance (11 stars, last pushed 20d ago), licensed MIT. It adds 242 tokens to every session and 2,937 once invoked, about $0.0012 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

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.

microsoft/vscode · 53 tokens

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…

microsoft/vscode · 71 tokens