LoopOps Protocol
Use this skill when reusable agent behavior should become more than a better prompt.
The goal is to choose the smallest durable artifact that improves future runs:
prompt -> skill -> checklist -> script -> workflow -> loop
Do not promote work upward unless the extra machinery buys reliability, reuse, or cheaper future execution.
Artifact Ladder
Classify the candidate method first:
- Prompt: one-off instruction for this run.
- Skill: compact reusable context, procedure, or tool adapter loaded on demand.
- Checklist: ordered human/agent validation sequence.
- Script: deterministic repeatable action with parameters.
- Workflow: ordered tool/process execution with gates and evidence.
- Loop: workflow plus evaluator, memory write, retry policy, and stop rule.
Prefer the lowest artifact that handles the task reliably.
Loop Suitability Gate
Promote a workflow into a loop only when all are true:
- The goal has an observable completion condition.
- Progress can be evaluated without trusting the worker agent blindly.
- A retry is likely to improve the result.
- Cost can be bounded by iteration, time, token, or tool budget.
- Failure has a clear stop, rollback, or human-escalation path.
If any condition is missing, keep it as a supervised workflow or checklist.
Open vs Closed Loop
Use an open loop when:
- the solution space is unknown,
- discovery or exploration matters,
- multiple valid approaches may exist,
- the output is research, architecture, strategy, or design direction.
Use a closed loop when:
- acceptance criteria are known,
- tests, checks, or review criteria exist,
- regression risk matters,
- the task can be decomposed into verifiable steps.
Open loops need tighter budget limits. Closed loops need stronger evaluators.
Supervisor Contract
Every loop must define:
Goal:
Completion condition:
Loop type: open | closed
Worker action:
Evaluator:
Evidence:
Memory write:
Retry policy:
Budget:
Stop rule:
Rollback or escalation:
The evaluator can be a test command, lint/typecheck/build, browser check, static analysis, script, human review, or a separate model. Prefer deterministic evaluators when available.
Memory Policy
After each iteration, save only durable signal:
- current hypothesis,
- changed files or artifacts,
- verification result,
- blocker or failure mode,
- next intended action,
- reusable lesson if it generalizes.
Do not append raw logs, long transcripts, secrets, private data, or one-off observations to durable memory.
Skill Evolution
After a loop completes, update skills only with lessons that are:
- procedural,
- reusable,
- testable,
- not already covered by higher-priority instructions,
- worth their token cost.
Good updates:
- missing repo-specific command,
- repeated failure mode,
- verification step that caught a real issue,
- script or workflow that replaced repeated manual work,
- rejected path that should not be retried.
Bad updates:
- generic coding advice,
- motivational wording,
- model-behavior hacks,
- single-incident preferences,
- rules that increase context without reducing errors.
Cost Controls
Every loop must have at least two:
- max iterations,
- max wall-clock time,
- max token/tool budget if measurable,
- narrowest useful verification first,
- summarized memory instead of raw logs,
- stop after repeated identical blocker,
- human approval before external, destructive, expensive, or privacy-sensitive actions.
If cost cannot be bounded, do not run autonomously.
Compiler Rule
When the same step is repeated three times, decide whether to compile it:
- repeated prose instruction -> skill rule,
- repeated checklist -> workflow,
- repeated shell/Python/JS snippet -> script,
- repeated verification pattern -> evaluator,
- repeated failure recovery -> stop hook or escalation rule.
Prefer scripts and deterministic checks over longer instructions.
Final Report
When designing or updating a loop-capable method, report:
- chosen artifact level,
- why higher levels were rejected or accepted,
- supervisor contract if a loop is used,
- cost controls,
- memory writes,
- validation performed,
- skill/workflow/script files changed.
1---2name: loopops-protocol3description: Design and evolve agent skills into cost-bounded loops, workflows, scripts, and memory updates. Use when creating or auditing reusable agent methods, converting prompts or skills into workflows, designing open or closed agent loops, defining supervisor/evaluator contracts, or deciding whether repeated agent work should become a skill, checklist, script, workflow, or autonomous loop.4license: MIT5---67# LoopOps Protocol89Use this skill when reusable agent behavior should become more than a better prompt.1011The goal is to choose the smallest durable artifact that improves future runs:1213```text14prompt -> skill -> checklist -> script -> workflow -> loop15```1617Do not promote work upward unless the extra machinery buys reliability, reuse, or cheaper future execution.1819## Artifact Ladder2021Classify the candidate method first:2223- **Prompt**: one-off instruction for this run.24- **Skill**: compact reusable context, procedure, or tool adapter loaded on demand.25- **Checklist**: ordered human/agent validation sequence.26- **Script**: deterministic repeatable action with parameters.27- **Workflow**: ordered tool/process execution with gates and evidence.28- **Loop**: workflow plus evaluator, memory write, retry policy, and stop rule.2930Prefer the lowest artifact that handles the task reliably.3132## Loop Suitability Gate3334Promote a workflow into a loop only when all are true:3536- The goal has an observable completion condition.37- Progress can be evaluated without trusting the worker agent blindly.38- A retry is likely to improve the result.39- Cost can be bounded by iteration, time, token, or tool budget.40- Failure has a clear stop, rollback, or human-escalation path.4142If any condition is missing, keep it as a supervised workflow or checklist.4344## Open vs Closed Loop4546Use an **open loop** when:4748- the solution space is unknown,49- discovery or exploration matters,50- multiple valid approaches may exist,51- the output is research, architecture, strategy, or design direction.5253Use a **closed loop** when:5455- acceptance criteria are known,56- tests, checks, or review criteria exist,57- regression risk matters,58- the task can be decomposed into verifiable steps.5960Open loops need tighter budget limits. Closed loops need stronger evaluators.6162## Supervisor Contract6364Every loop must define:6566```text67Goal:68Completion condition:69Loop type: open | closed70Worker action:71Evaluator:72Evidence:73Memory write:74Retry policy:75Budget:76Stop rule:77Rollback or escalation:78```7980The evaluator can be a test command, lint/typecheck/build, browser check, static analysis, script, human review, or a separate model. Prefer deterministic evaluators when available.8182## Memory Policy8384After each iteration, save only durable signal:8586- current hypothesis,87- changed files or artifacts,88- verification result,89- blocker or failure mode,90- next intended action,91- reusable lesson if it generalizes.9293Do not append raw logs, long transcripts, secrets, private data, or one-off observations to durable memory.9495## Skill Evolution9697After a loop completes, update skills only with lessons that are:9899- procedural,100- reusable,101- testable,102- not already covered by higher-priority instructions,103- worth their token cost.104105Good updates:106107- missing repo-specific command,108- repeated failure mode,109- verification step that caught a real issue,110- script or workflow that replaced repeated manual work,111- rejected path that should not be retried.112113Bad updates:114115- generic coding advice,116- motivational wording,117- model-behavior hacks,118- single-incident preferences,119- rules that increase context without reducing errors.120121## Cost Controls122123Every loop must have at least two:124125- max iterations,126- max wall-clock time,127- max token/tool budget if measurable,128- narrowest useful verification first,129- summarized memory instead of raw logs,130- stop after repeated identical blocker,131- human approval before external, destructive, expensive, or privacy-sensitive actions.132133If cost cannot be bounded, do not run autonomously.134135## Compiler Rule136137When the same step is repeated three times, decide whether to compile it:138139- repeated prose instruction -> skill rule,140- repeated checklist -> workflow,141- repeated shell/Python/JS snippet -> script,142- repeated verification pattern -> evaluator,143- repeated failure recovery -> stop hook or escalation rule.144145Prefer scripts and deterministic checks over longer instructions.146147## Final Report148149When designing or updating a loop-capable method, report:150151- chosen artifact level,152- why higher levels were rejected or accepted,153- supervisor contract if a loop is used,154- cost controls,155- memory writes,156- validation performed,157- skill/workflow/script files changed.