agentleFS
TheMattBermanTheMattBerman/loop-kit/skills/loop-builder/SKILL.md

loop-builder

Skill9 starsChanged 5 months agoMITView on GitHub

Design, map, and operationalize AI agent loops from scratch. Use when the user asks: "turn this workflow into a loop", "design a loop for X", "build me a goal routine", "help me spec a recurring automation", "create a recurring agent", "map this repeating job", or "what would this look like as a loop?" Do NOT use when the user wants to audit, critique, or triage an existing loop spec (route that to loop-doctor instead).

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. criscatalyst/loop-builder★ 2same name
    2. AndyMelnykov/pm-loops★ 1same name
    3. opascope/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If that cannot be answered concretely, produce a prompt or checklist instead of a loop.

    line 29
  2. Distinctive:

    Operationalize: add state file, graduation decision, rollback rules, reviewer gate.

    line 36
  3. Distinctive:

    When the user has not provided a clean loop spec, onboard the idea first:

    line 40
  4. Distinctive:

    Ask at most 3 follow-up questions -- only for missing done criteria, source access, approval boundary, or whether this is a loop at all.

    line 46
  5. Distinctive:

    Use results as inspiration.

    line 55
  6. Very specific:

    Add to the minimum viable set: catalog_pattern, maturity, inputs, tools_and_permissions, state_location, run_artifacts, steps, …

    line 92
  7. Very specific:

    When the user skips loop-doctor, apply the same fail-closed test internally: if done/check/source is weak, downgrade and say so.

    line 128
  8. Distinctive:

    Use the checkpoint runtime when a spec is ready:

    line 189
  9. Very specific:

    Never create background operation or a recurring schedule.

    line 197

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “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

Loop Builder

Describe a recurring workflow or agent idea and get a mapped loop, a runnable dry-run prompt, and the smallest safe operating spec.

Core test before building anything:

What does done mean, and how will the agent check?

If that cannot be answered concretely, produce a prompt or checklist instead of a loop.

Modes

  • Map: rough idea in, loop map + 1-3 sharp questions out.
  • Spec: answers in, minimum viable or expanded spec out.
  • Dry run: spec in, copy-paste launcher + first-run checklist out.
  • Operationalize: add state file, graduation decision, rollback rules, reviewer gate.

Start Here

When the user has not provided a clean loop spec, onboard the idea first:

python3 shared/scripts/loop_onboard.py "<rough workflow, pain, or goal>"

Ask at most 3 follow-up questions -- only for missing done criteria, source access, approval boundary, or whether this is a loop at all.

To find matching patterns from the loop library:

python3 shared/scripts/select_loop_patterns.py "<loop job description>"

Use results as inspiration; adapt to the user's real source and approval constraints.

Onboarding Output

For rough ideas, produce this before the full spec:

## Loop Map
- Working name: / User goal: / Recurring job: / Trigger: / Source of truth:
- Output packet: / Done means: / How it checks: / Human decision:
- Risk level: / Recommended archetype: / Best first version:

## Missing Answers (up to 3)

## Recommendation
Prompt first / manual loop / repeat-ready manual loop / do not build yet: <reason>

Forced Fields by Risk

Minimum viable spec -- L1-L2 loops (internal, read-only, no external actions):

archetype:
trigger:
source_of_truth:
done_criteria:
verification_method:
hard_stops:
output_packet:
approval_boundary:
no_op_condition:
first_manual_dry_run:

Expanded spec -- L3-L4 or any loop with customer, production, or external-action scope:

Add to the minimum viable set: catalog_pattern, maturity, inputs, tools_and_permissions, state_location, run_artifacts, steps, maker_checker_split, stop_conditions, risks, rollback_or_reversal, schedule_decision, approval_artifact.

Archetypes and Reusable Mechanics

Full patterns in shared/references/archetype-playbook.md. One line each:

  • Decision Queue: ranks messy open work into named choices.
  • Review Queue: approve/fix/reject verdict packets for drafts or assets.
  • Verification: iterates toward a measurable, machine-checkable bar.
  • Operating: recurring repo/product/client ops with human approval gates.
  • Customer Deployment: one client workflow, idea to staged rollout evidence.
  • Build Promotion: converts shipped work into proof, caveats, and promo options.
  • Compound Learning: repeated corrections become skills, templates, or gates.
  • Adversarial Review: independent critic checks a plan before commitment.

Reusable mechanics (add only what the risk requires): source freeze, state ledger, maker/checker split, no-op terminal, bounded pass, evidence packet, approval gate, regression capture, dry-run first, downgrade rule.

The Handoff Contract (Loop Builder + Loop Doctor)

Either skill can run standalone. Recommended path: run loop-doctor first, then bring the verdict here to produce the full design.

Verdict routing:

loop-doctor verdictloop-builder action
goProduce full spec and dry-run launcher; include STATE.md skeleton only when recurrence memory, queue, or trend tracking is needed.
fix-then-goSurface ranked fixes first; build only after fixes are confirmed.
downgrade-to-promptDecline the build; return a single-use prompt or checklist.
not-a-loopDecline the build; explain why; return the better artifact.

When the user skips loop-doctor, apply the same fail-closed test internally: if done/check/source is weak, downgrade and say so.

Pointers to Loop Composition IP

Full worked examples in shared/references/loop-composition.md. Do not duplicate.

  • Loop-stack / packet-handoff model: one loop per stage, typed output packet, no back-reads across stages. Use when the workflow spans more than two bounded jobs.
  • Claim-ledger gate: per-claim source binding before any artifact goes public; required for numerical, client, or high-risk-vertical claims.
  • Deterministic-hygiene vs. semantic-editorial two-tier gate: Tier 1 automated hygiene runs first; Tier 2 rendered/human editorial review runs only after Tier 1 passes. Neither tier substitutes for the other.

Required Output for a Finished Design

## Loop Map
<Job, trigger, source, output, done/check, human decision, best first version.>

## Loop Spec
<Minimum viable or expanded YAML block per risk level.>

## Done and Verification
Done means: / How it checks: / Evidence required: / Maker/checker split:

## Hard Stops
Max time / items / attempts / spend: / Blocked condition:

## Human Boundary
Allowed: / Requires approval: / Forbidden:

## First Manual Dry Run
<Steps to run once before scheduling.>

## First Run Checkpoint
- Source freeze:
- Allowed actions:
- Forbidden actions:
- Hard stops:
- Required evidence:
- Run action:
- Terminal states:
- Schedule graduation rule:

## First Run Result
- Terminal state:
- Evidence:
- Verifier results:
- Blockers:
- Next decision:
- Schedule recommendation:

## Callable Prompt
<Copy-paste prompt for Codex or Claude.>

## STATE.md Skeleton
<Only when the loop needs recurrence memory, queue tracking, or trend data.>

Use the checkpoint runtime when a spec is ready:

python3 shared/scripts/validate_spec.py spec.md
python3 shared/scripts/checkpoint_run.py init --spec spec.md --out .loop-kit/<loop-slug>
python3 shared/scripts/checkpoint_run.py close --run .loop-kit/<loop-slug>/runs/<run-id> --verdict manual_pass --evidence <id> --verifier-result <type>:pass

Never create background operation or a recurring schedule. A clean first run can only return safe_to_consider_scheduling.

References

  • shared/references/loop-onboarding.md: question bank and risk ladder.
  • shared/references/archetype-playbook.md: archetype inputs, gates, outputs.
  • shared/references/loop-spec-template.md: spec templates (both tiers).
  • shared/references/loop-launcher-template.md: first-run launcher format.
  • shared/references/example-loop-packets.md: good and bad loop map examples.
  • shared/references/loop-red-flags.md: failure modes and downgrade rules.
  • shared/references/loop-library-analysis.md: maturity taxonomy and pitfalls.
  • shared/references/loop-composition.md: loop-stack, claim-ledger, two-tier gate.

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.