agentleFS
LuisHiluyLuisHiluy/claude-code-pipeline-skills/go-loop/SKILL.md

go-loop

Skill0 starsChanged 7 months agoMITView on GitHub

Close the AI media iteration loop autonomously. Generate → verify via quality gate → auto-regen items below threshold → build composite → commit → notify. Use whenever the user finishes a generation batch, says "go", "go loop", "ship it", "close the loop", "run the loop", or asks to automate the generate-verify-regen-commit cycle for AI images or video. Even when the user just says "finish this batch", "we're done generating", or appends /go-loop to any prompt, trigger this skill to close the loop properly without babysitting. Applies Boris Cherny's /go pattern to AI media pipelines.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run your verification script (see the verify skill for a CLIP-based implementation):

    line 29
  2. Distinctive:

    Read the verdict JSON. If Claude just generated multiple items, iterate.

    line 35
  3. Very specific:

    Look at failed_metrics — targeted fix per metric:

    line 40
  4. Very specific:

    Run /simplify on any supporting code Claude wrote (prompt builders, batch scripts, helper utilities).

    line 56
  5. Distinctive:

    Only send if the channel is configured.

    line 92
  6. Very specific:

    Respect file locks: If /lockscenes is active, respect the guard.

    line 99
  7. Distinctive:

    If FAIL after 2 passes: stop, summarize, ask: Don't auto-escalate to a different generator without user input.

    line 100
  8. Very specific:

    When /go-loop completes, print a compact summary (no headers, no celebration):

    line 104

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/go-loop — Iteration Loop Closer

Boris Cherny's /go pattern applied to AI media pipelines: when invoked, Claude tests its own work end-to-end, simplifies, commits, and pings you. No babysitting.

The Loop

GENERATE → VERIFY → [regen if FAIL, max 2 passes] → COMPOSITE → COMMIT → NOTIFY

When to Invoke

Invoke at the end of any generation task. Safe to chain after batch generators, direct API calls, or MCP tool calls.

Example prompts:

  • regen shot-06 with updated prompt /go-loop
  • generate remaining CGI shots using approved refs /go-loop
  • try shot-08 variants for energy match /go-loop

Execution

Step 1 — Verify what was just generated

Run your verification script (see the verify skill for a CLIP-based implementation):

python3 scripts/verify.py <ITEM_ID> --json

Read the verdict JSON. If Claude just generated multiple items, iterate.

Step 2 — Regen if FAIL (max 2 passes)

For any item with verdict FAIL:

  • Look at failed_metrics — targeted fix per metric:
    • character fail → ensure character refs are passed to the generator
    • palette fail → check world/palette assignment, enforce palette hint in prompt
    • prompt_match fail → revise prompt wording, tighten focal length
    • composite fail → cross-check frame selection
  • Regen via same path. Do NOT burn credits if a prompt fix alone would resolve.
  • Re-verify. If still FAIL after 2 regens → surface to user, do NOT continue loop.

Step 3 — Build composite

python3 scripts/assemble.py --composite <ITEM_ID>

Step 4 — Simplify (optional)

Run /simplify on any supporting code Claude wrote (prompt builders, batch scripts, helper utilities). Skip for pure generation work.

Step 5 — Commit

Summary commit with:

  • Items touched (IDs)
  • Pre/post quality scores
  • Regen count per item
  • References used

Commit message format:

<item-ids>: <short description>

Quality deltas: shot-06 0.31→0.42 (GOOD), shot-08 0.28→PASS, shot-11 FAIL after 2 regens

Co-Authored-By: Claude <noreply@anthropic.com>

Step 6 — Notify (optional)

Send summary to the user via your preferred channel (Telegram, Slack, email). Format:

/go-loop complete

<N> items verified, <M> regenned
Results:
  shot-06: GOOD (0.42)
  shot-08: PASS (0.31)
  shot-11: FAIL after 2 passes — needs manual review

Composite: runs/composites/latest.png
Commit: <hash>

Only send if the channel is configured. Otherwise skip silently.

Invariants (don't break these)

  1. Never regen more than 2x per item per invocation. Burns credits; if still failing, the prompt or reference is the issue — hand back to user.
  2. Never skip verification. The whole point is the tight loop. No verification = no /go.
  3. Always pass references to the generator. Double-check before regen.
  4. Respect file locks. If /lockscenes is active, respect the guard.
  5. If FAIL after 2 passes: stop, summarize, ask. Don't auto-escalate to a different generator without user input.

Output format to user

When /go-loop completes, print a compact summary (no headers, no celebration):

shot-06 GOOD 0.42 (1 regen)
shot-08 PASS 0.31 (0 regens)
shot-11 FAIL — 2 regens, character metric stuck at 0.48
composite: runs/composites/2026-04-16.png
commit: a7b3c9d
notified

Related Skills

  • verify — the underlying quality gate
  • clip-feedback — for single-clip intent analysis
  • nb2-batch — for batch-generating reference grids
  • lockscenes — for locking approved items during assembly

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.