Agent skill

Autoresearch

by leo-kuang-ai in 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…

MITAuto-check passedAgent Workflows

Install Autoresearch

skills CLI
$ npx skills add leo-kuang-ai/spec-first --skill autoresearch -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install leo-kuang-ai/spec-first autoresearch --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ 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-src

Use ~/.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/

Facts

Skill name
autoresearch
GitHub stars
107
Token cost
~2.2k tokens
SKILL.md length
930 words
Files
32 (incl. scripts, references)
Skills in repo
35
Repo updated
First seen
Licence
MIT

At a glance

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…

  • Works in 6 steps: Classify — scripts/orchestrate.sh… → Derive predicate — reuse plan logic to… → Confirm — ONE request_user_input… → …
  • Iterate-and-verify improvement loops
  • SKILL.md covers Safety Invariants (all…, Dispatch (bare autoresearch), Subcommands and Universal Flags, plus 1 more section
  • Runs Shell scripts from its folder

What it does

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.

When your agent uses it

  • Iterate-and-verify improvement loops
  • Multi-bug zeroing
  • Security hardening loops
  • Regression-gated shipping

Example prompts

  • “/autoresearch”

Requirements

  • A Bash shell

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Classify — scripts/orchestrate.sh classify "" → archetype label + mode.
  2. Derive predicate — reuse plan logic to produce a concrete Success predicate: exact shell command + expected output. For optimize-metric…
  3. Confirm — ONE request_user_input showing: archetype, mode, concrete predicate (command + expected output), terminal choice…
  4. Round-0 dry-run — prove the predicate command runs and returns a value; safety-screen every derived command via screen-cmd; print…
  5. Loop until predicate satisfied
  6. Stop conditions (checked after each hop)

What it can do on your machine

Read from SKILL.md and the folder at commit 74655dc. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

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.

Always · name and description, kept in context so the agent knows when to use it
~159
When it runs · the whole SKILL.md, loaded when a task matches
~2.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.5k

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.

Safety

Auto-check passed

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.

SKILL.md

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.

Download SKILL.mdSave it as .claude/skills/autoresearch/SKILL.md (or your agent's skills folder). This skill also uses 31 other files; get the full folder from GitHub.
name
autoresearch
description
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 goals whose success cannot be expressed as a checkable signal — name the destination skill and route out.

Autoresearch — Autonomous Goal-directed Iteration

Safety Invariants (all subcommands)

  • Never push, publish, or deploy without explicit user approval.
  • Bounded by default. Override with Iterations: unlimited.
  • All results logged to autoresearch/{subcommand}-{YYMMDD}-{HHMM}/ directory.
  • Chain handoff via handoff.json. Evals reads *-results.tsv.

Dispatch (bare autoresearch)

Parse the invocation in this order:

ConditionMode
Metric: or Verify: presentClassic — existing metric loop, unchanged
Free-form natural-language goal, no metric/verifyOrchestrator — see Orchestrator section
NothingSetup wizard — interactive config builder
--classic flagForce Classic regardless of goal text
--auto flagForce 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.

Subcommands

CommandDoesDefault Iterations
autoresearchIterate against a metric: modify → verify → keep/discard25
autoresearch planConvert a goal into validated Scope, Metric, Verify configN/A
autoresearch debugHunt bugs: hypothesize → test → falsify → repeat15
autoresearch fixCrush errors one-by-one until zero remain20
autoresearch securitySTRIDE + OWASP audit with red-team personas15
autoresearch shipShip through 8 phases: checklist → dry-run → deploy → verifyN/A
autoresearch scenarioGenerate edge cases across 12 dimensions20
autoresearch predict5 expert personas debate before implementationN/A
autoresearch learnScout codebase → generate docs or wiki → validate → fix loop10
autoresearch reasonAdversarial debate with blind judges until convergence8
autoresearch probe8 personas interrogate requirements until saturation15
autoresearch improveResearch ICP challenges, discover improvements, generate PRDs15
autoresearch evalsAnalyze iteration results: trends, plateaus, regressionsN/A
autoresearch regressionRegression stability gate: baseline vs candidate, verdict STABLE/UNSTABLEN/A

Universal Flags

FlagApplies ToPurpose
Iterations: NAll loopingSet iteration count
Iterations: unlimitedAll loopingOpt-in unbounded
--evalsAll loopingMid-loop checkpoints + final summary
--evals-interval NAll loopingOverride checkpoint frequency
--chain <targets>AllSequential handoff after completion
--<subcommand>AllShorthand for --chain <subcommand>
--dry-runOrchestratorPrint derived config + planned pipeline; no execution
--max-cycles NOrchestratorHard ceiling on orchestration cycles (default 50)
--classicBare autoresearchForce Classic metric-loop mode
--autoBare autoresearchForce Orchestrator mode

Orchestrator

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:

  • Orchestration loop — predicate-bearing archetypes (ship-ready, optimize-metric, fix-broken, harden, build-feature, explore). Goal has a mechanical Success predicate; the loop runs until that predicate is met.
  • Single-pass dispatch — subjective/terminal archetypes (document, what-to-build, decide-design). Routes once to the fitting subcommand (learn / improve / reason), lets it self-terminate, then reports. No loop, no Plateau, no ship gate.
Show full SKILL.md (454 more words)Show less
Orchestration Loop Steps

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.

  1. Classify — scripts/orchestrate.sh classify "<goal>" → archetype label + mode.
  2. Derive predicate — reuse plan logic to produce a concrete Success predicate: exact shell command + expected output. For optimize-metric, run the full plan/wizard derivation internally.
  3. Confirm — ONE 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.
  4. Round-0 dry-run — prove the predicate command runs and returns a value; safety-screen every derived command via screen-cmd; print projected cycle budget. Stop here if --dry-run.
  5. Loop until predicate satisfied: a. Assess state via cheap signals (last 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.
  6. Stop conditions (checked after each hop):
    • Predicate met → ship gate (only if ship is in the pipeline) else CONVERGED.
    • scripts/orchestrate.sh plateau orchestrator-state.json → true → stop + report PLATEAU.
    • Cycles > ceiling (default 50, override --max-cycles N) → stop + report CEILING.
    • Hop outcome blocked/failed with no alternative route → checkpoint + stop + report BLOCKED.
Orchestrator State

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.

Orchestrator Safety Invariants
  • Never auto-approve ship/deploy/push. The orchestrator never passes --auto to ship; deploy always requires explicit user approval.
  • Data-migration behind anchored DB-URL allowlist. Reuses regression's allowlist — host must be localhost/127.0.0.1/container hostname, or database name carries _test/_ci suffix. Bare substring match does not qualify. Anything else refused.
  • screen-cmd on every derived command — run before the loop starts AND on every command read from a persisted state file on resume. Persisted commands are never trusted; resume re-screens the pinned predicate via screen-state-predicate and refuses on refuse.
  • No un-screened commands mid-loop. The autonomous loop cannot introduce new shell commands that bypass screen-cmd.
  • Predicate pinned, not re-derived. Round-0 writes the derived Success predicate verbatim into orchestrator-state.json; every cycle and every resume reuses that exact string so "done" is reproducible across runs.
  • Validate the ledger before routing. validate-state gates orchestrator-state.json (required fields + coarse types); a malformed ledger is not trusted to route from.
  • Independent verify before convergence. High-impact changes accepted on the working signal set pending_verify; next-hop routes to a verify hop (held-out / adversarial check) before DONE or ship. The verify hop never auto-approves ship.
  • Unknown-units cycles excluded from Plateau counter. A cycle where 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

Files

SKILL.md and 31 other files (scripts, references) in skills/autoresearch of leo-kuang-ai/spec-first.

  • SKILL.md
  • agents/openai.yaml
  • autoresearch.md
  • debug.md
  • evals.md
  • evals/cases/dispatch-classic-mode.yaml
  • evals/cases/screen-cmd-refuses-unsafe-predicate.yaml
  • evals/cases/ship-never-auto-approves.yaml
  • evals/eval.yaml
  • evals/fixtures/repos/empty-repo/README.md
  • evals/fixtures/scripts/check-classic-banner.sh
  • evals/fixtures/scripts/check-screen-refusal.sh
  • evals/fixtures/scripts/check-ship-gate.sh
  • fix.md
  • … and 18 more

Open the folder on GitHubat commit 74655dc

Compare with similar skills

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.

Autoresearch compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Autoresearch this skillleo-kuang-ai/spec-first107—~2.2kAutomated safety check: PassMIT
Autoresearch Iteration Loopuditgoenka/autoresearch6.5k1 repos~2kAutomated safety check: PassMIT
PRP LoopWirasm/prp2.3k—~894Automated safety check: PassMIT
Autopilotyangyuan-zhen/PolyWeather316—~5.8kAutomated safety check: PassAGPL-3.0
Trailmark Graph Evolutiontrailofbits/skills7.5k—~3.4kAutomated safety check: PassCC-BY-SA-4.0
Code Review Specialistluongnv89/claude-howto42k—~764Automated safety check: PassMIT

Similar skills

  • 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.

    6.5k GitHub starsUsed in 1 repo~2k tokens
    Agent WorkflowsAuto-check passed
  • PRP Loop

    Wirasm/prp

    Runs the plan, implement and review pipeline detached in fresh headless sessions, looping review and fix until the pull request is clean.

    2.3k GitHub stars~894 tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed
  • Autopilot

    yangyuan-zhen/PolyWeather

    [OMX] Strict autonomous loop: $deep-interview - $ralplan - $ultragoal (+ $team if needed) - $code-review - $ultraqa

    316 GitHub stars~5.8k tokensUpdated 21 days ago
    Agent WorkflowsAuto-check passed
  • Trailmark Graph Evolution

    trailofbits/skills

    Official

    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.

    7.5k GitHub stars~3.4k tokensUpdated yesterday
    SecurityAuto-check passed
  • Code Review Specialist

    luongnv89/claude-howto

    Reviews code for security, performance, quality and maintainability, using a checklist, a finding template and two metrics scripts.

    42k GitHub stars~764 tokensUpdated today
    DevelopmentAuto-check passed
  • Verdaccio Code Review

    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.

    18k GitHub stars~853 tokensUpdated 2 days ago
    DevelopmentAuto-check passed

More from leo-kuang-ai/spec-first

All 35 skills in this repo
  • Spec App Consistency Audit

    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…

    107 GitHub stars~4.6k tokensUpdated 3 days ago
    Auto-check passed
  • Spec Handoff

    leo-kuang-ai/spec-first

    Create a durable cross-session handoff or resume from a user-selected continuity source.

    107 GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check passed
  • Spec Pov

    leo-kuang-ai/spec-first

    Give a decisive, project-grounded verdict on an external input — judged against the current project, not in the abstract.

    107 GitHub stars~4.5k tokensUpdated 3 days ago
    Auto-check passed
  • Spec Resolve PR Feedback

    leo-kuang-ai/spec-first

    Resolve PR review feedback by evaluating validity and fixing issues with conflict-aware resolver dispatch.

    107 GitHub stars~1.8k tokensUpdated 3 days ago
    Auto-check: notes
  • Spec Riffrec Feedback Analysis

    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…

    107 GitHub stars~1.4k tokensUpdated 3 days ago
    Auto-check passed
  • Spec Compound

    leo-kuang-ai/spec-first

    Document a recently solved problem or durable project vocabulary in docs/solutions/ or CONCEPTS.md.

    107 GitHub stars~18k tokensUpdated 3 days ago
    Auto-check passed

Questions about Autoresearch

What does Autoresearch do?

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.

When should I use Autoresearch?

Autoresearch fits situations like: iterate-and-verify improvement loops; multi-bug zeroing; security hardening loops; regression-gated shipping.

How do I install Autoresearch in Claude Code?

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.

How do I install Autoresearch in Codex?

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.

Can I use Autoresearch in Cursor, Gemini CLI or GitHub Copilot?

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.

What does Autoresearch need to run?

Going by SKILL.md and its folder, Autoresearch needs a shell for the scripts in its folder. Our summary lists: A Bash shell.

Does Autoresearch access the network?

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.

Is Autoresearch safe to install?

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.

What licence does Autoresearch use?

Autoresearch is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Autoresearch use?

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.

What are the alternatives to Autoresearch?

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.

Who maintains Autoresearch?

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.