Логотип 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, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

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

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

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем maxmilian. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Loop Engineering у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/maxmilian/loop-engineering/tree/main
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
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, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇