Logotipo de Loop Engineering

Loop Engineering

Comunidad
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.

Descripción general

Editormaxmilian
Repositorioloop-engineering
Nombre de la habilidadloop-engineering
Estrellas
30
Forks
2
Archivos incluidos
15
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 15 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por maxmilian en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Loop Engineering en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/maxmilian/loop-engineering/tree/main
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maxmilian/loop-engineering.git \
  .claude/skills/loop-engineering
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Loop Engineering en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Loop Engineering automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Loop Engineering no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

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.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA 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...

¿Por qué usar Loop Engineering en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Loop Engineering está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Loop Engineering en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/maxmilian/loop-engineering/tree/main. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Loop Engineering?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Loop Engineering?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Loop Engineering con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Loop Engineering?

Sí. maxmilian la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇