Логотип Loop Engineering

Loop Engineering

Сообщество
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.

Обзор

Издательmaxmilian
Репозиторийloop-engineering
Название навыкаloop-engineering
Звёзды
30
Форки
2
Встроенные файлы
15
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 15

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Опубликовано на GitHub: maxmilian. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Loop Engineering в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/maxmilian/loop-engineering/tree/main
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/maxmilian/loop-engineering.git \
  .claude/skills/loop-engineering
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Loop Engineering в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Loop Engineering, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Loop Engineering не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

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.

Встроенные файлы

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ 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...

Зачем использовать Loop Engineering в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Loop Engineering — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Loop Engineering в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/maxmilian/loop-engineering/tree/main. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Loop Engineering?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Loop Engineering?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Loop Engineering: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Loop Engineering?

Да. Навык опубликован на GitHub автором maxmilian по лицензии MIT. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇