Autoresearch Iteration Loop
uditgoenka/autoresearch
Runs an autonomous modify, verify, keep-or-discard loop against any metric, with subcommands for planning, debugging, fixing, security audits, shipping and more.
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with bounded cycles, plateau/ceiling backstops, safety-screened commands, and…
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/autoresearch .claude/skills/autoresearch && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .claude/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearchType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/autoresearch .agents/skills/autoresearch && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .agents/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/autoresearch .cursor/skills/autoresearch && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .cursor/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/leo-kuang-ai/spec-first.git --path skills/autoresearch--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/autoresearch .gemini/skills/autoresearch && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .gemini/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install leo-kuang-ai/spec-first autoresearchInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/autoresearch .github/skills/autoresearch && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .github/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/leo-kuang-ai/spec-first.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/autoresearch .opencode/skills/autoresearch && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "autoresearch" agent skill from https://github.com/leo-kuang-ai/spec-first/tree/master/skills/autoresearch into .opencode/skills/autoresearch/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "autoresearch", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
autoresearchAutonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with bounded cycles, plateau/ceiling backstops, safety-screened commands, and…
Autoresearch is an agent skill from leo-kuang-ai/spec-first. Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with bounded cycles, plateau/ceiling backstops, safety-screened commands, and a ship gate that never auto-approves. Use for iterate-and-verify improvement loops, multi-bug zeroing, security hardening loops, and regression-gated shipping. Not for one-shot questions, single-bug diagnosis without a loop (spec-debug), ordinary code review (spec-code-review), implementation planning (spec-plan), or…
Its SKILL.md is about 2.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 38 other files, including scripts and reference files (for example `agents/openai.yaml`, `autoresearch.md` and `debug.md`).
It sits in Agent Workflows, covering Autonomous loops, Security review and Code review. The repository describes itself as: 仓库原生 AI Coding Harness —— 把一次性 AI 对话变成可治理、可验证、可沉淀的工程闭环 · spec-first.cn. The licence is MIT.
6 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 74655dc. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Ships 1 file in scripts/ (Shell, from the files we listed), which the agent can run.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Autoresearch loads about 2.2k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 159 tokens; SKILL.md has 930 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from leo-kuang-ai/spec-first at commit 74655dc, republished under its MIT licence (© leo-kuang-ai). 930 words, ~2,178 tokens.
.claude/skills/autoresearch/SKILL.md (or your agent's skills folder). This skill also uses 31 other files; get the full folder from GitHub.Iterations: unlimited.autoresearch/{subcommand}-{YYMMDD}-{HHMM}/ directory.handoff.json. Evals reads *-results.tsv.autoresearch)Parse the invocation in this order:
| Condition | Mode |
|---|---|
Metric: or Verify: present | Classic — existing metric loop, unchanged |
| Free-form natural-language goal, no metric/verify | Orchestrator — see Orchestrator section |
| Nothing | Setup wizard — interactive config builder |
--classic flag | Force Classic regardless of goal text |
--auto flag | Force Orchestrator regardless of goal text |
Mode banner gate. Resolve the mode from the table below, then emit [autoresearch] mode: <classic|orchestrator|wizard> as your next assistant message once the skill definition is loaded — before any work tool call (test runs, file edits, project scaffolding) or planning output. No work may start before the banner is emitted; a run that starts working without it is a dispatch violation even if the work itself is correct. If the mode cannot be resolved, emit [autoresearch] mode: unresolved and ask exactly one clarifying question.
| Command | Does | Default Iterations |
|---|---|---|
autoresearch | Iterate against a metric: modify → verify → keep/discard | 25 |
autoresearch plan | Convert a goal into validated Scope, Metric, Verify config | N/A |
autoresearch debug | Hunt bugs: hypothesize → test → falsify → repeat | 15 |
autoresearch fix | Crush errors one-by-one until zero remain | 20 |
autoresearch security | STRIDE + OWASP audit with red-team personas | 15 |
autoresearch ship | Ship through 8 phases: checklist → dry-run → deploy → verify | N/A |
autoresearch scenario | Generate edge cases across 12 dimensions | 20 |
autoresearch predict | 5 expert personas debate before implementation | N/A |
autoresearch learn | Scout codebase → generate docs or wiki → validate → fix loop | 10 |
autoresearch reason | Adversarial debate with blind judges until convergence | 8 |
autoresearch probe | 8 personas interrogate requirements until saturation | 15 |
autoresearch improve | Research ICP challenges, discover improvements, generate PRDs | 15 |
autoresearch evals | Analyze iteration results: trends, plateaus, regressions | N/A |
autoresearch regression | Regression stability gate: baseline vs candidate, verdict STABLE/UNSTABLE | N/A |
| Flag | Applies To | Purpose |
|---|---|---|
Iterations: N | All looping | Set iteration count |
Iterations: unlimited | All looping | Opt-in unbounded |
--evals | All looping | Mid-loop checkpoints + final summary |
--evals-interval N | All looping | Override checkpoint frequency |
--chain <targets> | All | Sequential handoff after completion |
--<subcommand> | All | Shorthand for --chain <subcommand> |
--dry-run | Orchestrator | Print derived config + planned pipeline; no execution |
--max-cycles N | Orchestrator | Hard ceiling on orchestration cycles (default 50) |
--classic | Bare autoresearch | Force Classic metric-loop mode |
--auto | Bare autoresearch | Force Orchestrator mode |
Activated when a plain-language goal is given without Metric:/Verify:. Classifies the goal into a Goal archetype — see references/orchestrator-routing.md for the archetype table and router decision table.
Two modes based on archetype:
Backed by scripts/orchestrate.sh (deterministic seam — all routing logic lives there). Subcommands exposed: classify, next-hop, units, plateau, screen-cmd, verdict, validate-state, screen-state-predicate.
scripts/orchestrate.sh classify "<goal>" → archetype label + mode.plan logic to produce a concrete Success predicate: exact shell command + expected output. For optimize-metric, run the full plan/wizard derivation internally.request_user_input showing: archetype, mode, concrete predicate (command + expected output), terminal choice (stop-at-verified vs proceed-to-ship). Misclassifications are caught here, not mid-run.screen-cmd; print projected cycle budget. Stop here if --dry-run.handoff.json, regression verdict, error count) + affected-test verify.
b. scripts/orchestrate.sh next-hop orchestrator-state.json → next subcommand.
c. Run subcommand (its own bounded inner loop).
d. Record per-hop outcome ∈ {progressed, no-op, failed, blocked}.
e. Fold hop's handoff.json into orchestrator-state.json.
f. scripts/orchestrate.sh units → recompute Units remaining.CONVERGED.scripts/orchestrate.sh plateau orchestrator-state.json → true → stop + report PLATEAU.--max-cycles N) → stop + report CEILING.blocked/failed with no alternative route → checkpoint + stop + report BLOCKED.orchestrator-state.json — orchestrator-owned, additive. Tracks: goal, archetype, predicate, terminal-choice, units_remaining history, cycle count, per-hop pipeline log with outcomes, current incumbent. Each hop's handoff.json is unchanged (single-hop bridge); the orchestrator reads it and folds it in. Two clearly-owned state objects, no overlap.
--auto to ship; deploy always requires explicit user approval.localhost/127.0.0.1/container hostname, or database name carries _test/_ci suffix. Bare substring match does not qualify. Anything else refused.screen-state-predicate and refuses on refuse.screen-cmd.orchestrator-state.json; every cycle and every resume reuses that exact string so "done" is reproducible across runs.validate-state gates orchestrator-state.json (required fields + coarse types); a malformed ledger is not trusted to route from.pending_verify; next-hop routes to a verify hop (held-out / adversarial check) before DONE or ship. The verify hop never auto-approves ship.units returns unknown (e.g. runner crash) is not counted as zero-progress; repeated unknown routes to BLOCKED.© leo-kuang-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 31 other files (scripts, references) in skills/autoresearch of leo-kuang-ai/spec-first.
Open the folder on GitHubat commit 74655dc
Autoresearch next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Autoresearch this skillleo-kuang-ai/spec-first | 107 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Autoresearch Iteration Loopuditgoenka/autoresearch | 6.5k | 1 repos | ~2k | Automated safety check: Pass | MIT | |
| PRP LoopWirasm/prp | 2.3k | — | ~894 | Automated safety check: Pass | MIT | |
| Autopilotyangyuan-zhen/PolyWeather | 316 | — | ~5.8k | Automated safety check: Pass | AGPL-3.0 | |
| Trailmark Graph Evolutiontrailofbits/skills | 7.5k | — | ~3.4k | Automated safety check: Pass | CC-BY-SA-4.0 | |
| Code Review Specialistluongnv89/claude-howto | 42k | — | ~764 | Automated safety check: Pass | MIT |
uditgoenka/autoresearch
Runs an autonomous modify, verify, keep-or-discard loop against any metric, with subcommands for planning, debugging, fixing, security audits, shipping and more.
Wirasm/prp
Runs the plan, implement and review pipeline detached in fresh headless sessions, looping review and fix until the pull request is clean.
yangyuan-zhen/PolyWeather
[OMX] Strict autonomous loop: $deep-interview - $ralplan - $ultragoal (+ $team if needed) - $code-review - $ultraqa
trailofbits/skills
Compares Trailmark code graphs at two snapshots, such as commits, tags or directories, to surface attack paths, blast radius and taint changes that text diffs miss.
luongnv89/claude-howto
Reviews code for security, performance, quality and maintainability, using a checklist, a finding template and two metrics scripts.
verdaccio/verdaccio
Reviews a verdaccio diff, branch or PR against the repository's review guide, verifies each finding in the code and reports only actionable issues.
leo-kuang-ai/spec-first
Audit mobile App PRD/Figma/local-source consistency across page routes, KMP/Clean Architecture, components, analytics, i18n, engineering quality, and industry lenses before runtime validation; use…
leo-kuang-ai/spec-first
Create a durable cross-session handoff or resume from a user-selected continuity source.
leo-kuang-ai/spec-first
Give a decisive, project-grounded verdict on an external input — judged against the current project, not in the abstract.
leo-kuang-ai/spec-first
Resolve PR review feedback by evaluating validity and fixing issues with conflict-aware resolver dispatch.
leo-kuang-ai/spec-first
Analyze explicit Riffrec product-feedback captures, including riffrec-.zip, the Riffrec session.json + events.json + recording.webm + voice.webm bundle, or media/notes the user identifies as a…
leo-kuang-ai/spec-first
Document a recently solved problem or durable project vocabulary in docs/solutions/ or CONCEPTS.md.
Categories
Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with bounded cycles, plateau/ceiling backstops, safety-screened commands, and…. Autoresearch is an agent skill from leo-kuang-ai/spec-first. Autonomous goal-directed iteration loop: modify, verify, keep/discard against a metric or a checkable success predicate, with bounded cycles, plateau/ceiling backstops, safety-screened commands, and a ship gate that never auto-approves.
Autoresearch fits situations like: iterate-and-verify improvement loops; multi-bug zeroing; security hardening loops; regression-gated shipping.
Run `npx skills add leo-kuang-ai/spec-first --skill autoresearch -a claude-code`. Or copy the skill folder (skills/autoresearch in leo-kuang-ai/spec-first) into .claude/skills/autoresearch in your project. Claude Code loads it when a task matches its description.
Run `npx skills add leo-kuang-ai/spec-first --skill autoresearch -a codex`. Or copy the skill folder (skills/autoresearch in leo-kuang-ai/spec-first) into .agents/skills/autoresearch in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add leo-kuang-ai/spec-first --skill autoresearch -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/autoresearch, .gemini/skills/autoresearch, .github/skills/autoresearch and .opencode/skills/autoresearch in your project.
Going by SKILL.md and its folder, Autoresearch needs a shell for the scripts in its folder. Our summary lists: A Bash shell.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Autoresearch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.2k tokens (SKILL.md is roughly 8.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.3k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Autoresearch: Autoresearch Iteration Loop (uditgoenka/autoresearch, 6.5k stars), PRP Loop (Wirasm/prp, 2.3k stars), Autopilot (yangyuan-zhen/PolyWeather, 316 stars) and Trailmark Graph Evolution (trailofbits/skills, 7.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
leo-kuang-ai (a GitHub user) maintains it in leo-kuang-ai/spec-first, which has 107 GitHub stars. The repository holds 35 skills in this directory. The repository was last updated on October 8, 2026.
Source: leo-kuang-ai/spec-first on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.