loop-runner
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 4
- Forks
- 0
02 资源文件 3
- 参考文档references/adapt.md2.9 KB
- 参考文档references/run-protocol.md2.6 KB
- 脚本scripts/loop.sh20.5 KB
03 SKILL.md 正文
/loop-run — execute a Loop Library loop
Loop Library (https://signals.forwardfuture.ai/loop-library/) publishes loops as prose — a prompt, an English verification, and steps. Prose can't loop on its own. This skill adds the machine contract the catalog lacks and actually runs the six-step cycle (Observe → Choose → Act → Verify → Record → Repeat/stop), enforced by hooks. It's the execution layer to the catalog's design layer. Architecturally it's the /goal skill specialized for bounded, verifiable loops.
What a running loop does
When you start a loop in a directory:
- A state file is written at
~/.claude/state/loop/<sha-of-cwd>.jsonand a JSONL ledger beside it (.jsonl). - A beads issue is created (
bd create --type=task --priority=2, labelsworkflow:loop+actor:agent) and claimed; its id is stored in state. - The
UserPromptSubmithook~/.claude/skills/hooks/loop-injector.shinjects a<system-reminder>each turn: the loop prompt (as untrusted data), current iteration vs. max, no-progress streak, the exact verify step, the stop predicates, and the rule "don'tcompleteuntil verify passes or a stop fires." - The
Stophook~/.claude/skills/hooks/loop-stop-gate.shrunscheck-stopwhen you try to end the turn: if a stop predicate fired it lets you stop (and points you atcomplete); otherwise it blocks and feeds the next cycle back — so the loop actually loops across turns. Capped atLOOP_STOP_MAX(default 6) per session, fails open, kill switchLOOP_STOP_MAX=0.
Verification is hybrid-but-honest
- Machine mode (
--verify "<cmd>"): the only road tocompleteis the command exiting 0, or a stop predicate firing. Reproducible; this is what makes a loop trustworthy. - Self mode (no
--verify): the agent judges the prose criterion. The steering says so out loud,completerequires--evidence "<proof>", and the stop predicates still bound it — a self-graded loop can never run forever or silently fake rigor.
verify (did this iteration succeed?) and the optional --stop "target=<cmd>" (is the whole loop done?) are different axes — set both when they differ.
Subcommands
Always invoke via Bash:
bash ~/.claude/skills/loop-runner/scripts/loop.sh <subcommand> [args]
| Subcommand | Effect |
|---|---|
start <slug> [--prompt "…"|--file f.json] [--verify "<cmd>"] [--stop "max-iter=N,no-progress=M,target=<cmd>"] [--title …] |
Pull a loop from the live catalog by slug (or load --file/--prompt); write state + ledger; open the bd issue. No --verify ⇒ self mode. Stop defaults: max-iter=10,no-progress=2. |
verify |
Machine: run the verify cmd, log exit + output tail. Self: print the criterion + how to record evidence. |
record "<action>" [--evidence …] [--verify-exit N] [--decision continue|stop|blocked] |
Append one ledger line; bump iteration; update the no-progress streak (resets on a verify pass). |
check-stop |
Print continue or stop:<reason> (target met / max-iter / no-progress). |
continue |
Print the next-cycle steering block (the seam for the future /loop / ScheduleWakeup bridge). |
status / show / list / ledger |
Inspect the active loop, raw state, all loops on record, or the run trajectory. |
pause / resume |
Suspend / re-enable the gate without losing state. |
abort ["reason"] |
End the loop unfinished; keep the ledger; mark the bd issue deleted. |
complete [--evidence …] [--force] |
Mark done — refused unless machine-verify last exited 0, OR a stop predicate fired, OR (self) --evidence was given. Closes the bd issue. |
How to invoke from /loop-run …
| User said | Run |
|---|---|
/loop-run <slug> |
start <slug> — if the loop is fuzzy (docs/copy/cleanup) it's fine to run self mode; if it has a natural test/build, propose a --verify command and confirm with the user before starting. |
/loop-run <slug> --verify "<cmd>" / with --stop … |
pass through to start. |
| "run this loop until the tests pass" | start … --verify "<test cmd>" --stop "target=<test cmd>". |
/loop-run status / ledger / pause / resume / abort / complete |
the matching subcommand (for complete, do the completion audit first). |
| find a loop first | the loop-library catalog is the discovery layer; resolve a slug there (or curl …/catalog.json), then start it here. |
Report the script's stdout to the user in 1–2 sentences; for start, mention the bd id and verify mode.
Binding a prose loop to a machine contract
Catalog loops carry no runnable check. Before start, decide the machine contract — see references/adapt.md. The six-step cycle the injector enforces is in references/run-protocol.md.
What this is NOT
- Not the catalog/discovery/audit tool — that's Loop Library itself (find/adapt/Loop-Doctor). This skill runs a loop you've already chosen.
- Not an unattended scheduler (yet). v1 loops in-session via the Stop-gate; the
continueverb exists so bridging to/looporScheduleWakeupis a one-liner later. - Not a way to skip approval — destructive/external/consequential actions inside a loop still need user sign-off; the steering says so every turn.
04 同仓库更多 Skills
zi-search
暂无简介
visualise
Render inline interactive visuals — SVG diagrams, HTML widgets, charts, and explainers — directly in the conversation. Use this skill whenever the user asks to visualize, diagram, chart, illustrate, or explain something visually, or when an explanation would genuinely benefit from a spatial/interactive diagram rather than text. Also triggers for: flowcharts, architecture diagrams, data visualizations, interactive explainers, comparison layouts, UI mockups, and any request containing 'show me', 'draw', 'map out', 'visualize', or 'diagram'. Even when the user doesn't explicitly ask for a visual, use this skill proactively when the topic has spatial, sequential, or systemic relationships that a diagram would clarify better than prose.
video
When the user wants to create, generate, or produce video content using AI tools or programmatic frameworks. Also use when the user mentions 'video production,' 'AI video,' 'Remotion,' 'Hyperframes,' 'HeyGen,' 'Synthesia,' 'Veo,' 'Runway,' 'Kling,' 'Pika,' 'video generation,' 'AI avatar,' 'talking head video,' 'programmatic video,' 'video template,' 'explainer video,' 'product demo video,' 'video pipeline,' or 'make me a video.' Use this for video creation, generation, and production workflows. For video content strategy and what to post, see social-content. For paid video ad creative, see ad-creative.
manim-video
Production pipeline for mathematical and technical animations using Manim Community Edition. Creates 3Blue1Brown-style explainer videos, algorithm visualizations, equation derivations, architecture diagrams, and data stories. Use when users request: animated explanations, math animations, concept visualizations, algorithm walkthroughs, technical explainers, 3Blue1Brown style videos, or any programmatic animation with geometric/mathematical content.
video-use
Edit any video by conversation. Transcribe, cut, color grade, generate overlay animations, burn subtitles — for talking heads, montages, tutorials, travel, interviews. No presets, no menus. Ask questions, confirm the plan, execute, iterate, persist. Production-correctness rules are hard; everything else is artistic freedom.
ui-improver
暂无简介