⏳ This skill is pending AI review.
Scores will appear once the review pipeline completes.
autoresearch-loop
Run an explicit, bounded modify-verify-decide loop toward a measurable metric with approval gates, scoped edits, and rollback proof.
Choose how to use this skill
You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.
1. Native installer
This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.
Do not guess an installer command or replace an existing version without reviewing the diff.
2. Complete package recommended
Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.
No complete ProSkills package is published for this listing yet.3. Prompt-only
Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.
Need only the instruction file?
Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.
No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.
// RATINGS
Not yet listed on ClawHub or SkillsMP
// README
autoresearch-loop
A bounded modify-verify-decide loop for agents working toward a measurable goal.
You give it a goal, a metric, verification commands, scope, rollback rules, and an iteration cap. It makes one atomic change at a time, verifies the result, keeps improvements, discards failures, and stops when the approved contract says to stop.
This is not a silent background coding daemon. Foreground review is the default. Background or unattended operation requires explicit approval, a fixed scope, a rollback strategy, and an iteration cap.
What it does
- Runs a tight modify-verify-keep/discard loop toward a measurable target
- Separates Verify (did the metric improve?) from Guard (did anything else break?)
- Requires an approved run contract before edits begin
- Keeps edits inside approved files/directories
- Uses version-control snapshots or commits so failures can be discarded cleanly
- Escalates intelligently: REFINE after 3 failures, PIVOT after 5, ask before external research unless pre-approved, soft blocker after repeated dead ends
- Extracts lessons after kept iterations and pivots
- Prevents context drift on long runs by re-reading instructions every 10 iterations
- Works for anything with a number: test coverage, type errors, lint warnings, performance, research quality, translation completeness
Safety Model
Before the loop starts, the agent must confirm:
- goal, metric, baseline, and target
- exact verify and guard commands
- allowed edit scope and forbidden paths
- rollback strategy
- foreground or explicitly approved background mode
- iteration cap
- whether external search is allowed
- private-data boundary
The loop must stop instead of improvising when the metric cannot be measured, scope is unclear, guard files need changing, rollback is unsafe, or external research would expose private material.
Installation
OpenClaw
Add your workspace skills directory to openclaw.json:
{
"skills": {
"load": {
"extraDirs": ["/path/to/your/skills"]
}
}
}
Clone into that directory:
git clone https://github.com/LeoStehlik/autoresearch-loop.git /path/to/your/skills/autoresearch-loop
Codex / Claude Code / other agents
Copy SKILL.md and the references/ folder into your project's skills directory (.agents/skills/autoresearch-loop/), then invoke with $autoresearch-loop.
Usage
Say what you want in one sentence:
$autoresearch-loop
Reduce TypeScript `any` types in src/**/*.ts without breaking tests.
The agent will confirm a run contract before making edits:
- Goal and target metric
- Verify command
- Guard command
- Edit scope and forbidden paths
- Rollback strategy
- Foreground/background mode
- Iteration cap
- External research policy
The loop starts only after you approve the contract and say go.
The Loop
read contract + state + lessons
pick ONE hypothesis
make ONE scoped atomic change
snapshot or commit
run VERIFY
run GUARD
keep / discard / rework
log result
check escalation and safety gates
repeat only within approved cap
Escalation Ladder
| Trigger | Action |
|---|---|
| 3 consecutive discards | REFINE - adjust within current strategy |
| 5 consecutive discards | PIVOT - fundamentally different approach |
| 2 PIVOTs without improvement | Ask before external research unless pre-approved |
| 3 PIVOTs without improvement | Soft blocker - stop and report to human |
A single successful keep resets all counters.
What's Inside
autoresearch-loop/
├── SKILL.md Core loop rules + decision protocol
└── references/
├── loop-protocol.md Full iteration spec + results log format
├── pivot-protocol.md REFINE/PIVOT/soft-blocker escalation
└── lessons-protocol.md Cross-run learning + lesson format
Inspiration
Inspired by Karpathy's autoresearch and codex-autoresearch. Built as our own clean, agent-agnostic implementation.
License
MIT - see LICENSE
// HOW IT'S BUILT
KEY FILES