run-the-loop
Fix until done: goal + inspect script under script/debug/, then iterate implement → inspect until PASS. Use after establish-a-loop or standalone for /run-the-loop, "loop until done", "max effort", "don't stop until".
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- run-the-loop
- description
- Fix until done: goal + inspect script under script/debug/, then iterate implement → inspect until PASS. Use after establish-a-loop or standalone for /run-the-loop, "loop until done", "max effort", "don't stop until".
02 资源文件 1
- 脚本run_the_loop.go71 B
03 SKILL.md 正文
Iterate until an inspect script proves the goal. Pairing: if LOOP_*.md exists,
read it in Phase 1 — reuse Build/Deploy/Derived ops and use step 4b (or invert
step 4 REPRO:) as the GREEN spec.
When to use
- Fix/implement until a measurable goal is achieved
- User wants persistent verify-and-fix cycles with evidence
- After
establish-a-loopwhen SYMPTOM CONFIRMED and step 4b defines GREEN
Phases
| Phase | Name |
|---|---|
| 1 | Goal |
| 2 | Inspect script |
| 3 | Fix loop |
| 4 | Complete |
Phase 1 — Goal
- Restate goal in one sentence; call
update_goalwith progress message. - If
doc/LOOP_*.md(ordocs/) exists for this task: read Derived operations, Workspace tools, step 4b — fold into goal and GREEN criteria. - If blocking unknowns: ask ≤5 concrete questions (one message); else proceed.
- Pick inspect path:
script/debug/<goal>/main.go(kebab-case).
Phase 2 — Inspect script
Single source of truth for "done." See references/inspect-script-template.go.
| Requirement | Detail |
|---|---|
| Runnable | go run ./script/debug/<path> from repo root |
| Exit 0 | Goal met; non-zero = not met |
| Output | PASS: or FAIL: in result block |
| Evidence | Artifacts under .../out/ |
| Surfaces | UI → playwright-debug; API → curl; CLI → os/exec; CI → gh run view |
- Write
main.gofor GREEN criteria. - Run it — expect FAIL initially (RED). Fix script until failure is actionable.
- Gate: agent-readable FAIL output before Phase 3.
Phase 3 — Fix loop
Implement → go run ./script/debug/<path> → exit 0?
↑ no: analyze FAIL, hypothesize, repeat
Rules:
- Run inspect after every meaningful change; cite
PASS:/FAIL:in progress. - Root cause before workaround (
sound-fixwhen unsure). - Run affected tests when touching production code.
update_goal(message=...)each iteration.- If same failure 3×: add
LOOP_DEBUG:logs, then continue.
Stop only when: inspect exits 0 and output matches goal → update_goal(completed=true).
Or: blocked_reason=... after one user question (missing creds / 5× same error).
Never stop on "should work", eyeballing, or tests green without re-running inspect.
Phase 4 — Complete
Summarize goal, iterations, key fix, inspect path. Paste final PASS output (abbreviated).
List out/ artifacts. Keep inspect script for regression.
Anti-patterns
- Skipping inspect or writing it after claiming success
update_goal(completed=true)without fresh inspect PASS- Stopping at
go testwhen goal needs UI/CI inspect - Ask-wait-ask clarification loops
- Deleting inspect script after success
Quick start
/run-the-loop <fix goal; optional: verify via screenshot, CI workflow name, etc.>
04 同仓库更多 Skills
verify-with-prototype
Prototype-before-production workflow for risky host integrations (sudo, privileges, system config). Use when a feature touches the real OS, when behavior must be proven with a small script before full implementation, or when the user mentions prototype verification, POC script, or verify-with-prototype. Run after investigate/followup and before doctest-TDD integration.
verify-on-behalf-of-user
Run human-style scenario verification after an agent claims work is done: git status, build into ~/.sandbox/bin (default sandbox mode) or opt-in host mode (outside sandbox: wrk --reinstall-local / change-scoped install), real integration/E2E scenarios (start servers, browser-agent for UI), always-labeled depth, markdown transcript written and inlined for review. Use for "verify on my behalf", before commit. Complements doctests; does not replace them. Load a sub-topic with: agent-pro skill --show verify-on-behalf-of-user/<topic>
test-case-tree-design-expert
Use when the user wants a decision-tree style test case design with inherited setup and per-leaf assertions.
test-case-design-expert
Use when the user wants comprehensive user-facing end-to-end test scenarios for a feature description.
tdd-expert
Use when the user has a test-case-tree output and wants runnable Go tests plus stub implementation following Test-Driven Development.
summarize-a-skill
Meta-skill: distill durable high-signal guidance (worked vs failed, wrong → correct, and anything else that quickens future similar tasks) into a brief reusable skill document with YAML frontmatter. When the user does not explicitly ask for a new skill/file, prefer updating an existing skill over creating one. Writes skills/<name>/SKILL.md (or docs|doc/skills/…). Use for /summarize-a-skill, "summarize what worked", "lessons learned into a skill", or "write a skill from this session".