Use this skill only when the user explicitly asks for an autoresearch or iterative improvement loop. It is for bounded, measurable optimisation in a version-controlled workspace. It must not start from casual improvement language, and it must not run unattended until the user has approved the goal, commands, scope, rollback strategy, run mode, and iteration cap.
The goal is measurable. Each iteration makes one atomic change, verifies it, and keeps or discards the result. The loop stops when the goal is met, the approved iteration cap is reached, the user stops it, or a blocker/safety gate is hit.
text
1. Confirm approved run contract
2. Read context + lessons file
3. Pick ONE hypothesis
4. Make ONE atomic change inside approved scope
5. Snapshot/commit before verification
6. Run approved VERIFY command
7. Run approved GUARD command
8. Decision: keep / discard / rework
9. Log the result
10. Health check and safety gate
11. Repeat only within approved cap
Read references/loop-protocol.md for the full loop spec.
Read references/pivot-protocol.md for the escalation ladder.
Read references/lessons-protocol.md for cross-run learning.
Confirm with the user and do not start until the contract is explicit:
Show the run contract and ask for confirmation. One round minimum. Then start only after the user says go.
ResultActionVerify pass + Guard passKeep. Extract lesson.Verify pass + Guard failRework within approved scope (max 2 attempts). If still failing, discard.Verify failDiscard using approved rollback.CrashStop unless the fix is clearly inside approved scope and non-destructive.Syntax errorFix immediately only if caused by the current iteration and inside approved scope.
See references/pivot-protocol.md for full details.
TriggerAction3 consecutive discardsREFINE — adjust within current strategy5 consecutive discardsPIVOT — abandon strategy, try fundamentally different approach2 PIVOTs without improvementAsk before external research unless pre-approved3 PIVOTs without improvementSoft blocker — stop and report to human
A single successful keep resets all counters.
Extract structured lessons after:
Store in autoresearch-lessons.md in the working repo root unless the user chose another path. Do not commit this file unless the user explicitly asks. Consult it at the start of each run. Keep about 50 entries, summarising older ones with time decay.