agentsclimarketplace

Engineer agent loops

Skill Rowan2005321/loop-contracts/skills/engineer-agent-loops

Machine-checkable control contracts between agent harnesses and repeated agent loops

Install
npx -y skills add Rowan2005321/loop-contracts --skill engineer-agent-loops

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 18 days oldThe repository was created 18 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Design, audit, and repair bounded agent execution loops by connecting harness capabilities to explicit state, progress signals, budgets, verification, recovery, observability, human gates, and stop conditions. Use when Codex needs to turn a recurring or long-running agent workflow into a machine-checkable loop contract, diagnose retries or false completion, compare loop designs, or add safety and resumability to autonomous work.

SKILL.md

5.1 KB, 968 tokens by cl100k_base, as published. Nobody here has run it

Engineer Agent Loops

Core model

Treat the harness and the loop as different layers:

Harness = what an agent can observe and do during a run
Loop    = when and why the run repeats, changes state, stops, or escalates
Contract = harness capabilities + temporal control + evidence

Produce a loop contract, not a new agent framework. Keep model choice and runtime implementation replaceable.

Choose the task mode

  • Design: create a new contract from a workflow or recurring task.
  • Audit: inspect an existing agent loop, scheduler, workflow, or orchestration file without changing it.
  • Repair: modify a contract or loop design to fix specific findings.
  • Compare: score two designs against the same invariants and explain the tradeoffs.

Do not create a persistent loop for a one-shot task unless repetition, resumption, or unattended execution is actually required.

Workflow

  1. Inventory the harness

    • Identify available tools, permissions, context sources, state storage, sandboxes, hooks, and external side effects.
    • Separate confirmed capabilities from proposed capabilities.
    • Mark destructive actions, external writes, money movement, credential use, and permission expansion as high risk.
  2. Define the loop boundary

    • State one measurable objective and the work-discovery source.
    • Declare execution_mode as single-run, event-driven, scheduled, or queue-worker.
    • Define the smallest independently verifiable unit of work.
    • Name the initial, recovery, terminal, and human-escalation states.
    • Prefer observe -> plan -> act -> verify over a free-form while true loop.
  3. Specify evidence and progress

    • Use deterministic verification when available: tests, schemas, exit codes, hashes, diffs, or policy checks.
    • Do not let the producing agent be the only judge of success.
    • Define progress signals and a fingerprint that detects repeated state/action/observation triples.
    • Require verification evidence before entering done.
  4. Bound and recover

    • Set at least two hard budgets, normally iterations plus wall time; add cost or tool-call budgets where relevant.
    • Bound every retry by failure class.
    • Define rollback, checkpoint, resume, no-progress, and budget-exhaustion behavior.
    • Escalate when the loop lacks authority or new evidence, rather than repeating a failed action.
    • For scheduled or queue-worker loops, define per-item budgets, lease expiry, a durable cursor, quarantine-and-continue behavior, concurrency, and a disable switch.
  5. Draft the contract

    • Copy assets/loop-contract.template.json and adapt it.
    • Read references/contract-schema.md when changing fields or writing an integration.
    • Read references/loop-patterns.md only for the relevant loop shape.
  6. Validate and visualize

    • Run:

      python scripts/loop_contract.py validate <contract.json>
      python scripts/loop_contract.py score <contract.json>
      python scripts/loop_contract.py diagram <contract.json>
      
    • Fix all errors. Explain accepted warnings rather than hiding them.

    • Treat the score as a coverage heuristic, not proof that the runtime is safe.

  7. Hand off implementation

    • Name the runtime hooks needed for each transition, signal, gate, and verifier.
    • Preserve the contract as the source of truth; avoid duplicating rules only in prompts.
    • Do not enable schedules, external writes, or production execution unless the user requested that operational change.

Non-negotiable invariants

  • Every loop has reachable terminal states for success and escalation or failure.
  • Every cycle is bounded by budgets and a no-progress detector.
  • Every retry is failure-specific and finite.
  • done requires recorded evidence from named verification conditions.
  • State is externalized enough to resume or explain why resumption is impossible.
  • High-risk actions have explicit permissions and human gates.
  • Traces record state transitions, actions, observations, verification, interventions, and the stop reason.
  • A new attempt must change evidence, strategy, authority, or context. Repetition alone is not recovery.
  • One malformed queue item must be quarantined after bounded attempts and must not block unrelated work.

Output contract

Return:

  1. confirmed harness inventory and unresolved assumptions;
  2. the loop contract path or proposed contract;
  3. validator errors, warnings, and score;
  4. a state diagram;
  5. runtime integration points;
  6. residual risks and the next safe test.

Never claim that static validation proves model correctness, business correctness, or production safety.

What ships with it: 5 files

45.2 KB alongside SKILL.md, 1 of them executable

agents/

references/

scripts/

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.