Logo von Loop Engineering

Loop Engineering

Community
maxmilian
loop-engineering

Design and review autonomous or semi-autonomous agent loops — systems where an agent prompts itself, runs on a schedule or event, and iterates toward a goal without a human at the keyboard. Use this whenever the user wants to build, design, harden, or audit any kind of self-running agent, agentic workflow, control loop, background worker, cron/heartbeat/webhook-driven agent, "Ralph loop", auto-PR-fixer, monitoring agent, or any long-running task that should keep going on its own until done. Trigger this even when the user says "agentic workflow", "automation that runs itself", "an agent that keeps trying until X", or "make my agent stop running away / burning tokens" without using the word "loop". Also use it to review an existing loop's stopping conditions, guardrails, verification, and escalation paths.

Übersicht

Herausgebermaxmilian
Repositoryloop-engineering
Skill-Nameloop-engineering
Sterne
30
Forks
2
Mitgelieferte Dateien
15
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 15 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von maxmilian auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Loop Engineering in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/maxmilian/loop-engineering/tree/main
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maxmilian/loop-engineering.git \
  .claude/skills/loop-engineering
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Loop Engineering in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Loop Engineering automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Loop Engineering nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Loop Engineering

Loop engineering is the discipline that comes after prompt engineering. A prompt optimizes a single interaction. A loop optimizes the autonomous behavior that surrounds it — when the agent runs, what triggers it, how it verifies its own work, when it stops, and when it hands back to a human.

The hard part is never the loop itself. A bare agent loop (call model → run tool → observe → repeat) is ~30 lines and every framework's core is the same. The whole job is the engineering around it: verification, stopping conditions, guardrails, context management, and escalation. Build those wrong and you are one edge case away from an agent that loops forever, burns the budget, or silently ships garbage.

This skill has two modes. Detect which one the user needs:

  • Design mode — the user is building a new loop. Walk the whiteboard, then the seven principles, then hand them a concrete design.
  • Review mode — the user has a loop already (a script, a workflow, an agent). Use the seven principles as a diagnostic checklist and report what's missing.

Most requests are one or the other; some are both. Don't force the framework on a user who just wants a quick answer — but for anything that will run unattended, the failure modes below are real and worth raising.

Principle 0 — Whiteboard before platform

Before writing any code or choosing any framework, answer five questions on paper. If you can answer these, the implementation is a few hours. If you skip them, you are building a demo, not a production loop.

  1. What triggers it? Time (cron), interval (heartbeat), external event (hook), or a goal it chases until met? (See references/loop-patterns.md.)
  2. What does it check each cycle? The single observation that decides whether there's work to do.
  3. What action does it take? Ideally one well-scoped action per cycle.
  4. When does it stop? This must be machine-checkable, not "when it's done."
  5. When does it escalate to a human? The path out when the goal can't be met.

"Write the loop on a whiteboard before you open any platform."

The seven principles

These are the load-bearing ideas, distilled across the field. In design mode build each one in; in review mode check each one off and flag what's absent.

1. Leverage has moved from the prompt to the loop

What the agent does in any single cycle matters less than when it runs, what triggers it, and when it stops. Spend your design effort on the loop's control flow, not on perfecting one prompt.

2. "Done" must be a machine-checkable endpoint

tests pass ✓. improve the code ✗. researched the competitors ✗. covered competitors X, Y, Z, each with at least one named source ✓. A goal without a checkable success condition has no convergence criterion — it just iterates until the budget is gone. Define "done" before the loop starts, and write success/failure criteria into the agent's prompt where it can evaluate them.

3. Verify with deterministic tools, never the agent's self-report

The agent saying "I'm done" is not evidence. A CI run, a test runner, a schema check, a diff against expected output — that is evidence. Verify in layers: per-action, per-iteration, and terminal. The verifier is the part you trust; the agent is the part you check.

Beware the agent gaming the proxy. A success signal is a proxy for the goal, and an agent optimizing to make the signal go green will, if it can, satisfy the signal instead of the goal — delete or skip the failing test, weaken the assertion, edit the validator's config, add continue-on-error, hardcode the expected output. This is reward hacking / Goodhart's law, and it is one of the most common ways an autonomous loop "succeeds" while producing garbage. Defend it: make the verifier and its config read-only / out of reach of the agent, diff every change and reject ones that touch tests/CI/the checker or weaken coverage, and keep an invariant the agent can't edit (e.g. test count must not drop). When you choose a success condition, ask "how would a lazy agent make this green without doing the work?" and close that path.

4. Define all exits and guardrails before going live

A production loop needs, at minimum:

  • a success exit (verifier confirms the goal),
  • a failure exit (unrecoverable error, retry limit hit),
  • a budget exit (max iterations, token cap, wall-clock timeout — whichever trips first),
  • no-progress detection (state stops changing across recent steps → break; a.k.a. loop fingerprinting), and
  • an escalation path (can't reach the goal → stop and alert a human queue, never silently continue).

Success and failure criteria belong in the prompt; budget and no-progress caps belong in the controller code, because you cannot trust the agent to enforce its own ceiling. For hook-triggered loops, add rate limiting / backpressure — a webhook storm (10,000 events → 10,000 runs) can drain a day's budget in minutes.

5. Treat context as a finite resource

Every token spends the model's attention budget, with diminishing returns; recall degrades as context grows ("context rot"). Aim for the smallest set of high-signal tokens. Tool outputs — not the system prompt — are usually the token hog (often the majority of what the agent sees), so trim raw tool results to the fields that matter before they enter context. For long-horizon loops use the three levers in references/context-engineering.md: compaction, structured note-taking, and sub-agent architectures.

6. Use the filesystem as memory; start each cycle with fresh context

Conversation history is a fragile place to keep state — it drifts and rots as it grows ("Ralph Wiggum drift"). Durable state lives outside the context window: in the codebase, a TODO/PROGRESS file, git history, or a state JSON. Each cycle should reconstruct what it needs from that external memory rather than depending on what's still in the conversation. Re-read the state file every cycle instead of trusting a number you saw twenty steps ago. This is what makes a loop survivable across hundreds of iterations and context resets.

7. The hard part is verification, stopping, and escalation — not autonomy

Don't sell or build "fully autonomous." The credible, safe design is semi-autonomous: the agent runs freely up to the point of an irreversible or outward-facing action (publishing, merging, deleting, emailing), then stops and asks. Reversible internal work → automate. Irreversible/external work → gate it behind a human. This is both safer and more trustworthy than full autonomy.

Design mode: produce a concrete loop design

When the user is building a loop, work through this and hand back an actual design, not a lecture:

  1. Run the whiteboard five (Principle 0) with the user. Pin down the trigger pattern using references/loop-patterns.md.
  2. Write the machine-checkable success condition (Principle 2). If you can't write one, the goal is underspecified — surface that now, it's the most common root cause of runaway loops.
  3. Specify all exits and guardrails (Principle 4) with concrete numbers: iteration cap, token/cost budget, wall-clock timeout, no-progress rule.
  4. Choose the verification mechanism (Principle 3) — name the actual tool/check.
  5. Decide the context strategy (Principles 5–6) — what's durable state on disk, what's reconstructed each cycle, when compaction/sub-agents kick in.
  6. Mark the escalation boundary (Principle 7) — exactly which actions stop and wait for a human.
  7. Sketch the control flow — the loop body as pseudocode or a real script, with the exits wired in. Keep the body small; the intelligence is in the guardrails, not the loop.

Review mode: diagnose an existing loop

When the user already has a loop, read it (the script, the policy doc, the agent config) and produce a findings report. Use references/review-checklist.md for the full diagnostic; the short version is one pass per principle:

For each of the seven principles, answer: present / partial / missing, cite where in their code or config it lives (or should), and give the single most valuable fix. Lead with the missing guardrails — a loop with no budget exit or no escalation path is the highest-severity finding. Don't pad the report with principles they already nailed; spend the words on the gaps.

References

Load these as needed — don't pull them all in at once.

  • references/loop-patterns.md — the four trigger patterns (heartbeat, cron, hook, goal), their failure modes, and how production loops combine them.
  • references/context-engineering.md — managing context across long-horizon loops: compaction, structured note-taking, sub-agents, just-in-time retrieval.
  • references/review-checklist.md — the full per-principle diagnostic for review mode, with severity ordering.
  • references/sources.md — the 12 source articles this skill distills, with one-line summaries, for when the user wants to go deeper or cite origins.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Loop Engineering?

Design and review autonomous or semi-autonomous agent loops — systems where an agent prompts itself, runs on a schedule or event, and iterates toward a goal without a human at the keyboard. Use this whenever the user wants to build, design, harden, or audit any kind of self-running agent, agentic workflow, control loop, background worker, cron/heartbeat/webhook-driven agent, "Ralph loop", auto-PR-fixer, monitoring agent, or any long-running task that should keep going on its own until done. Trigger this even when the user says "agentic workflow", "automation that runs itself", "an agent tha...

Warum Loop Engineering in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Loop Engineering besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Loop Engineering in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/maxmilian/loop-engineering/tree/main ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Loop Engineering nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Loop Engineering verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Loop Engineering damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Loop Engineering kostenlos?

Ja. Der Skill wird von maxmilian auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇