establish-a-loop
Produce LOOP_<YYYY-MM-DD>_<slug>.md — a real runnable repro/verify runbook from user logs or prose. Expands to precise CLI/URL ops, builds workspace tools, runs steps 1–4 for real, records SYMPTOM CONFIRMED or VERIFY PASS. Pair with run-the-loop for fixes. Use for /establish-a-loop, "establish a loop", or "create a debug loop".
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- establish-a-loop
- description
- Produce LOOP_<YYYY-MM-DD>_<slug>.md — a real runnable repro/verify runbook from user logs or prose. Expands to precise CLI/URL ops, builds workspace tools, runs steps 1–4 for real, records SYMPTOM CONFIRMED or VERIFY PASS. Pair with run-the-loop for fixes. Use for /establish-a-loop, "establish a loop", or "create a debug loop".
02 资源文件 1
- 脚本establish_a_loop.go71 B
03 SKILL.md 正文
Deliverable: LOOP_<YYYY-MM-DD>_<slug>.md. Pairing: after Phase 4, hand off to
run-the-loop for code/env fixes until GREEN (LOOP step 4b).
When to use
- User pastes logs or prose steps and needs a repeatable repro/verify runbook
- Verification spans build, deploy, run, inspect (local or remote)
- Not when a LOOP doc already exists and the task is fix-only →
run-the-loop
Loop kinds
| Kind | Inspect in steps 1–4 | Establishment complete |
|---|---|---|
| bug-repro (default on log paste) | Symptom present (RED) | SYMPTOM CONFIRMED |
| health-check | Healthy state (GREEN) | VERIFY PASS |
| regression | Symptom then absent post-adjust | SYMPTOM CONFIRMED → VERIFY PASS |
LOOP doc steps (reference)
Build → Deploy → Run → Inspect → Adjust (documented; code/env only in step 5)
▲___________________________________________|
Steps 1–4 run for real (not simulated). Details: references/LOOP-template.md.
Phases
| Phase | Name |
|---|---|
| 1 | Plan |
| 2 | Write LOOP |
| 3 | Run establishment |
| 4 | Handoff |
Phase 1 — Plan
- Classify kind, pick kebab slug, note verification surface.
- Expand to operations (always): copy user paste → User input (verbatim);
derive Derived operations (exact CLI/
curl/playwright-debugURL per row); list Workspace tools for any./cmd/*used (Build + Deploy — neverwhichalone). - Audit prerequisites (non-destructive). BLOCKER → document in Pitfalls; no fixes.
- If symptom vague or step-4 criteria unclear: minimal real trigger, save evidence
under
script/debug/<slug>/out/observation/, add Observation notes.
Bug-repro/regression: do not mkdir/config/install to change the symptom during planning.
Phase 2 — Write LOOP
Create file at resolved path (see template for path rules and all sections):
doc/LOOP_<date>_<slug>.md → else docs/ → else docs/loops/ (mkdir -p)
- Command blocks in steps 1–4 must match Derived operations.
- Steps 1–5: Build (workspace tools), Deploy, Run (trigger only), Inspect, Adjust (instrument | code | env — document only for bug-repro code/env).
- Aux repro:
script/debug/<slug>/viago run;REPRO:+ non-zero on unfixed system. - Every step: fenced
sh+ Verify line.
Phase 3 — Run establishment
Execute LOOP steps 1–4 for real. Append Run log rows with evidence.
- Bug-repro/regression: steps 1–4 without step 5 code/env adjust.
- Set
establishment_statuswhen gate met (see loop kinds table). - Regression: apply step 5 code/env adjust, re-run 3→4b, then VERIFY PASS.
If step 4 fails: update Derived ops / inspect criteria; or instrument-only
Adjust (LOOP_DEBUG: logs), rebuild, repeat Phase 3. No code/env fix for bug-repro
establishment — that is run-the-loop.
| Status | Meaning |
|---|---|
| SYMPTOM CONFIRMED | User's failure reproduced on command |
| VERIFY PASS | Healthy / fixed per step 4b |
| BLOCKED | Prerequisite missing |
Phase 4 — Handoff
Tighten LOOP (timeouts, cleanup, idempotency). Report: path, kind, status, aux scripts.
- SYMPTOM CONFIRMED →
/run-the-loop <fix goal>using step 4b as GREEN gate. - VERIFY PASS (health-check) → close or monitor.
Anti-patterns
- Code/env adjust during bug-repro establishment (before SYMPTOM CONFIRMED)
- Remedies in Run (step 3) that belong in Adjust (step 5)
- GREEN-only inspect for a reported bug
- Loosening inspect assertions to force a gate
- Prose commands ("open the app") without derived URL/CLI
whichfor workspace CLIs when./cmd/<tool>exists- Skipping the real establishment run
- Go code inside LOOP markdown
- Treating SYMPTOM CONFIRMED as "fixed"
Quick start
/establish-a-loop <logs, prose steps, or what to verify>
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".