Design the engineered loop for a medium/large (semi-)autonomous AI-coding task by decomposing it into gated sub-loops, emitted as a runnable .loop/ runbook. Use-when: "design an agent loop", "set up an autonomous / self-running agent workflow", "$loop-constructor". It DESIGNS the loop; it does NOT execute it.
Coding
Loop Engineering
Try itLoop Engineering AI programming paradigm guide. Covers the core concepts of transitioning from single prompt calls to autonomous loop systems, key components, loop patterns, configuration examples
What it does
Loop Engineering AI programming paradigm guide. Covers the core concepts of transitioning from single prompt calls to autonomous loop systems, key components, loop patterns, configuration examples, and anti-patterns.
The skill document
Loop Engineering
Loop Engineering is a new AI programming paradigm -- designing autonomous loop systems that allow Agents to continuously execute tasks in an environment with goals, feedback, and self-verification, eliminating the need for manual prompting.
Use Cases
Use when users need to learn about "Loop Engineering", "AI loop systems", "autonomous Agent design", "/loop", "/goal", "AI programming paradigms", or "system architect".
Core Concepts
Transition from single prompt calls to continuous loop systems:
| Paradigm | How It Works | Developer Role |
|---|---|---|
| Prompt Engineering | Manually enter prompts, model executes once, human judges results | Prompt Engineer |
| Harness Engineering | Build a constrained environment for a single Agent with pre-checks/fixes/hooks, still requires human triggering | Harness Engineer |
| Loop Engineering | Manage multi-Agent sequencing, decision-making, and autonomous loops, self-driven over long periods across many rounds | System Architect / Loop Engineer |
Key Components
| Component | Purpose | Reference |
|---|---|---|
| Automations | Trigger tasks by time/event, support periodic execution and archiving | See config-examples |
| Worktrees | Manage task state and context, maintain memory and state persistence across rounds | See config-examples |
| Skills | Encapsulate reusable task capabilities as skill modules for the loop system to invoke | See patterns |
| Plugins/Connectors | Extend system capabilities, interact with external tools or services | See integration |
| Sub-agents | Small specialized Agents for division of labor, supporting parallel multi-Agent task execution | See patterns / config-examples |
| External Memory & Feedback Loops | Achieve self-assessment and correction through mechanisms like logs, tests, and type checking | See anti-patterns |
/loop and /goal Primitives
| Primitive | Behavior | Use Case | Usage Tip |
|---|---|---|---|
/loop | Execute tasks repeatedly on a cycle | Scheduled checks, periodic maintenance | Must set maxRounds; no termination condition = infinite loop |
/goal | Run continuously until verifiable conditions are met | Goal-oriented autonomous tasks, with an independent model checking completion each round | Completion conditions must be objectively verifiable (file exists, tests pass, metrics met) |
Quick Start
- Define the goal: Do you want scheduled patrols, or are you pursuing a verifiable objective? Use
/loopfor the former,/goalfor the latter. - Choose a pattern: Browse common loop patterns to find a design that matches your scenario.
- Configure components: Refer to configuration examples to build the loop skeleton.
- Avoid pitfalls: Read anti-patterns to prevent issues in your design early on.
- Platform integration: Refer to platform integration to connect with your actual toolchain.
Design Principles
- Goal definition: Specify verifiable completion conditions to prevent Agents from falling into meaningless loops
- Feedback mechanisms: Enable Agents to self-assess through tests, validation, logs, and other mechanisms
- State management: Use Worktrees to maintain cross-round context and memory
- Modularity: Encapsulate reusable capabilities as Skills and Plugins
- Division of labor: Reasonably partition Sub-agent responsibilities, parallelize to improve efficiency
- Graceful termination: Set timeouts, max rounds, and abnormal exit conditions
File Navigation
| File | Content | Who It's For |
|---|---|---|
| patterns.md | 8 common loop patterns + selection guide | Need to quickly find a matching pattern |
| config-examples.md | Automation / Worktree / Sub-agent configuration examples | Starting to build a loop system |
| anti-patterns.md | Common mistakes + correction strategies | Troubleshooting or preventing issues |
| integration.md | OpenClaw / TaskFlow and other platform integration | Connecting to actual toolchains |
Related skills
Use when an AI coding agent needs bounded development loops, persistent project-local Docs/ state, context budgeting, environment escalation rules, safe stop...
Autonomous task loop engine — self-verifying, goal-driven, human-out-of-loop. Triggered by: loop, team-loop, 迭代研发, 迭代. Human sets a quantifiable goal (e.g.,...
Design an engineered gated loop for a medium/large (semi-)autonomous AI-coding task executed with the Codex CLI (single-agent, `codex exec`), emitted as a runnable .loop/ runbook. Use-when: "design an agent loop for codex", "$loop-constructor-codex". It DESIGNS the loop; it does NOT execute it.
Loops (loops.so). Use this skill for ANY Loops request — reading, creating, updating, and deleting data. Whenever a task involves Loops, use this skill inste...
Improve important deliverables by looping them through multiple isolated AI reviewers, each evaluating from a different angle, until all reviewers give full...