-
Notifications
You must be signed in to change notification settings - Fork 0
Core Primitives
Loop engineering is built on five core primitives combined with an explicit, file-based memory architecture. Together, they transform unstructured LLM sessions into robust, repeatable, autonomous software processes.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. SCHEDULING / TRIGGER β
β (Cron, Systemd, GitHub Actions, /loop, /goal) β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. ISOLATED WORKTREE β
β (Git worktree: clean branch, zero file conflict) β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. SKILLS β
β (Persistent intent, conventions, build & test commands) β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. CONNECTORS / MCP SUBSTRATE β
β (External API access: GitHub PRs, Linear tickets, Slack alerts) β
βββββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 5. SUB-AGENTS (MAKER / CHECKER) β
β Maker proposes code βββΊ Checker evaluates against strict rubric β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Without a durable trigger, an agent is merely an interactive chatbot.
-
Interval-based: Runs every
$N$ hours or days (e.g., daily dependency audit). - Event-based: Triggered by webhook, repository dispatch, or CI failure.
-
Goal-directed: Iterates continuously until a concrete, verifiable condition evaluates to true (
/goal).
When multiple agents or loops touch the same repository files simultaneously, conflicts and race conditions are inevitable.
- Every loop invocation creates or checks out an isolated
git worktree. - History is shared, but the active working tree is strictly isolated.
- Worktrees are automatically purged upon task completion or escalation.
Without skills, an agent suffers from intent debtβit must rediscover project architecture, lint standards, and build rules on every single run.
- Encoded in
SKILL.mddocuments containing instructions, reference scripts, and edge-case lessons. - Units of modular reuse packaged across repositories.
The Model Context Protocol (MCP) provides standard interfaces for reading and modifying external issue trackers, chat channels, and pull requests:
- GitHub MCP: Read issues/PRs, open draft PRs, add labels (no auto-merge by default).
- Linear / Jira MCP: Read tickets, update workflow status.
- Slack / Discord MCP: Send alerts exclusively to dedicated escalation channels.
The agent that writes code must never be the sole judge of its correctness.
- The Maker: High-creativity agent tasked with solving the problem, writing diffs, and generating candidate solutions.
- The Checker: Independent agent (often running a different model or system prompt) tasked with running tests, inspecting security invariants, and verifying against strict acceptance criteria.
Loops preserve state and context across disjoint invocations through standardized markdown files:
.
βββ STATE.md # Dynamic status: active task, blocker, last commit
βββ LOOP.md # System contract: mission, input, output, cadence
βββ loop-budget.md # Hard financial & token limits (per run / day)
βββ loop-constraints.md # Path denylist, forbidden patterns, human gates
βββ loop-run-log.md # Append-only audit history of previous iterations
| Memory Contract | Lifespan | Purpose |
|---|---|---|
STATE.md |
Ephemeral / Mutable | Tracks what the loop is currently doing, what was just finished, and what is next. |
LOOP.md |
Static / Governed | The operational contract defining the loop's exact scope, inputs, outputs, and cadence. |
loop-budget.md |
Enforced Boundary | Defines max token spend, API call limits, and maximum runtime minutes. |
loop-constraints.md |
Immutable Guardrail | Specifies forbidden paths (.env, secrets, prod terraform), forbidden commands, and required checks. |
loop-run-log.md |
Append-Only Ledger | Historical log of every execution, diff generated, and checker verdict. |
STOP PROMPTING / DESIGN THE LOOP / GET A SCORE
Loop Engineering Β· Autonomous Code Agent Tooling, Strict Eval Frameworks & Local-First CLI Utilities
Sololys Systems & Engineering Β· sololys/loop-engineering