loop-forge
Turn a one-line description of a repetitive task into a reusable, self-guarding slash command. loop-forge diagnoses the task into one of 5 loop shapes (Batch / Pipeline / Refine / Watch / Explore), interviews for the blanks, and auto-injects two safety devices the user didn't know they needed — an independent verifier (maker ≠ checker) and a hardstop (a budget/count/cooldown ceiling) — then previews the result and stamps it as a `/command` they can run forever. Use when the user says "/loop", "/loop-forge", "/make-it-loop", "automate this", "make this repeatable", "turn this into a command", "do this for all 100 items", "do X every time Y happens", "generate several and pick the best", or otherwise wants to capture a recurring task as a reusable slash command instead of re-typing the prompt by hand. Works in any language: it interviews the user and writes the stamped command in the user's own language. Non-goal — it does not schedule unattended runs (launchd/cron) or publish externally
sangrokjung · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add sangrokjung/claude-forge --skill loop-forgeAbout this skill
name: loop-forge
description: |
Turn a one-line description of a repetitive task into a reusable, self-guarding
slash command. loop-forge diagnoses the task into one of 5 loop shapes (Batch /
Pipeline / Refine / Watch / Explore), interviews for the blanks, and auto-injects
two safety devices the user didn't know they needed — an independent verifier
(maker ≠ checker) and a hardstop (a budget/count/cooldown ceiling) — then previews
the result and stamps it as a /command they can run forever. Use when the user
says "/loop", "/loop-forge", "/make-it-loop", "automate this", "make this
repeatable", "turn this into a command", "do this for all 100 items", "do X every
time Y happens", "generate several and pick the best", or otherwise wants to
capture a recurring task as a reusable slash command instead of re-typing the
prompt by hand. Works in any language: it interviews the user and writes the
stamped command in the user's own language. Non-goal — it does not schedule
unattended runs (launchd/cron) or publish externally on its own; it stamps the
reusable command and stops there.
loop-forge — stamp a guarded, reusable loop (/loop-forge)
Picture an engraving shop. A customer who can't engrave walks in and just describes the seal they keep needing — "I want to do this over and over." The artisan ① recognizes which of 5 standard molds (loop shapes) it is, ② asks what letters to cut (the blanks), ③ cuts them into a proven mold, ④ automatically fits a "misprint detector" (the verifier) and an "out-of-ink stop" (the hardstop), ⑤ pulls one test impression to show the customer, and ⑥ once they approve, hands back a reusable
/commandthey can stamp again any time — the same in Claude Code and in any other agent via a paste-able prompt.
What this tool actually does
Someone who doesn't code can't author a reusable /command that makes an AI repeat
a task reliably. loop-forge closes that gap. It takes a vague one-liner and stamps
it into a reusable slash command, while automatically attaching the two safety
devices a non-developer doesn't even know to ask for:
- Verifier (maker ≠ checker) — the loop's output is re-checked in a pass that is separate from the pass that produced it, so the loop can't grade its own homework.
- Hardstop — a budget/count/cooldown ceiling, so a loop can't quietly break while burning tokens.
That auto-injection is the decisive difference from a plain prompt generator or a developer-facing skill builder.
Before → after (the elevator demo):
User: "I want to summarize 100 shop reviews into 3 lines each"
│
loop-forge:
1. Diagnoses → Batch loop
2. Interviews → where are the items? per-item task? where does output land? a cap?
3. Auto-injects → verifier (count in == count out + independent spot re-check)
+ hardstop (max_items budget + per-item fail cap + abort at 20% failure)
4. Previews → "here's how it will run" (+ optional 1-item sample)
5. Stamps → /review-summary (reusable forever; safety baked in)
When it triggers
/loopor/loop "<one-line situation>"(full command/loop-forge; alias/make-it-loop)- "automate this" / "make this repeatable" / "turn this into a command"
- "summarize all 100 reviews" / "do this for every item"
- "do X every time an email arrives" / "alert me when a condition is met"
- "generate a few options and pick the best one"
- any time you'd rather capture a recurring task as a reusable
/commandthan re-type the prompt by hand
Triggers are matched on intent, in any language — the same phrasing in Korean, Spanish, Japanese, etc. activates the skill, and the whole interaction then runs in that language (see "Runs in your language" below).
Runs in your language (English asset, multilingual behavior)
Every file in this skill is English — there is no per-language copy. At runtime the
orchestrator detects the user's language from their one-liner and conducts the
entire interaction in it: the analogy, every interview question, the missing-slot
re-asks, the default-value confirmations, and the dry-run preview. The stamped
/command's human-readable prose (description, procedure, verifier/hardstop
explanations) is written in the user's language, while the structural tokens
(frontmatter keys, the archetype id, registry field names, and the ASCII slug
name) stay canonical so any teammate's harness can still parse it. This is
LLM-driven — there is no translation table.
The 5 loop shapes (everything this tool stamps)
Non-developer work reduces to five shapes. There is no sixth — never invent one (YAGNI). If a request doesn't fit, diagnose the nearest shape or ask one branch question.
| Shape | One line | Catalog |
|---|---|---|
| Batch | Same task across N items, none skipped | references/archetypes/batch.md |
| Pipeline | Pass through ordered stages A→B→C | references/archetypes/pipeline.md |
| Refine | Make → evaluate → fix, repeated | references/archetypes/refine.md |
| Watch ⚠ most dangerous | Watch a target, act when a condition fires | references/archetypes/watch.md |
| Explore | Diverge into N candidates → converge to best K | references/archetypes/explore.md |
6-stage orchestration (the main flow)
Follow the flow exactly; each stage calls a specific asset (lazy-loaded).
Read the complete source ↗Helper-script paths (install-portable): the
tools/andreferences/paths below are relative to this skill's own directory. If a relative call can't find a file, resolve it under the skill root —$HOME/.claude/skills/loop-forge/…forinstall.shinstalls, or${CLAUDE_PLUGIN_ROOT}/skills/loop-forge/…for marketplace (/plugin install) installs. Every helper is optional: if it's still unavailable (orpython3is missing), perform the step yourself from the referenced doc —classify_signals.pyis only a hint andcheck_safety.pyonly re-ch