ruizrica/agent-pi/autoresearch
- community
Checking that the SKILL.md file is still in the repository.
Autonomous Goal-directed Iteration. Apply Karpathy's autoresearch principles to ANY task. Loops autonomously — modify, verify, keep/discard, repeat. Invoke with /skill:autoresearch or when user says "work autonomously", "iterate until done", "keep improving", or "run overnight".
Install
npx vskill@latest install ruizrica/agent-pi/autoresearchSKILL.md
Autoresearch — Autonomous Goal-directed Iteration
Inspired by Karpathy's autoresearch. Applies constraint-driven autonomous iteration to ANY work — not just ML research.
Core idea: You are an autonomous agent. Modify -> Verify -> Keep/Discard -> Repeat.
When to Activate
- User invokes
/skill:autoresearchor/autoresearch - User says "work autonomously", "iterate until done", "keep improving", "run overnight"
- Any task requiring repeated iteration cycles with measurable outcomes
Phase 1: Understand (Do This First — Before ANY Work)
Before touching any files, deeply understand the goal. Do NOT rush into iteration.
- Read relevant files — Scan the codebase to build context around the user's goal. Understand what exists, what patterns are in use, and what's realistic.
- Identify ambiguities — Based on the goal and codebase context, what's unclear?
- Is the success metric obvious or ambiguous?
- Is the scope (which files to modify) clear?
- Are there constraints the user hasn't mentioned?
- Are there multiple valid interpretations?
- Ask clarifying questions — If ANY ambiguity exists, use
ask_userto ask targeted questions:
`` ask_user { question: "I have a few questions before I build the research plan:", mode: "questions", options: [ { label: "1. What metric should define success? (e.g. test coverage %, build time ms, bundle size KB)" }, { label: "2. Which files/directories are in scope for modification?" }, { label: "3. Are there any approaches to avoid or constraints I should know about?" }, { label: "4. What does 'done' look like — a specific target, or iterate until interrupted?" } ] } `` Tailor questions to the specific goal. Don't ask about what's already clear. Ask about genuine ambiguities.
- Skip if crystal clear — If the goal is unambiguous (clear metric, scope, exit criteria), skip questions and proceed to Phase 2. State briefly why no questions are needed.
- Synthesize understanding — Form a concrete statement: Goal, Metric (what + direction + verify command), Scope (in/out), Constraints, Exit criteria.
- Save research session — Create
.context/research-sessions/<session-id>.jsonwith the initial session data: goal, metric, scope, clarifying Q&A, status "understanding". Store thesession_idfor updates throughout the lifecycle.
Phase 2: Plan (Present Before Executing)
Now write and present a research plan for user approval. Do NOT start iterating without approval.
- Establish baseline — Run the verification command to get a starting metric value.
- Write the research plan — Create
.context/autoresearch-plan.md:
```markdown # Autoresearch Plan: <goal summary>
## Goal <Concrete goal statement>
## Metric
- Measuring: <what>
- Direction: <higher/lower is better>
- Verify command:
<command> - Baseline: <current value>
- Target: <target value or "continuous improvement">
## Scope
- In scope: <files/directories to modify>
- Read only: <files for context only>
- Out of scope: <excluded areas>
## Strategy Ordered approaches, most to least promising:
- <First approach — why promising>
- <Second approach — what it explores>
- <Third approach — alternative angle>
- <Fourth approach — radical idea>
- <Fifth approach — simplification play>
## Iteration Plan
- Mode: <bounded (N) / unbounded>
- Estimated time per iteration: <seconds/minutes>
- When stuck: Re-read plan, combine near-misses, try opposites
## Exit Criteria
- <When to stop>
```
- Present for approval:
`` show_plan { file_path: ".context/autoresearch-plan.md", title: "Autoresearch Plan: <goal>" } ``
- Approved → proceed to Phase 3
- Declined → revise based on feedback and re-present
- Update session — Set status to "planning", save plan content and baseline metric.
Phase 3: Setup & Begin
With understanding confirmed and plan approved, set up tracking and start.
- Create results log — Create
autoresearch-results.tsv(seereferences/results-logging.md) - Record baseline — Log the baseline metric from Phase 2 as iteration #0
- Commander tracking — If available, create task group and broadcast start (see Commander Integration below)
- Update session — Set status to "researching"
- Begin the loop — Start iterating immediately. No further confirmation needed.
The Loop
Read references/autonomous-loop-protocol.md for full protocol details.
Critical Rules
- Loop until done — Unbounded: loop until interrupted. Bounded: loop N times then summarize.
- Read before write — Always understand full context before modifying
- One change per iteration — Atomic changes. If it breaks, you know exactly why
- Mechanical verification only — No subjective "looks good". Use metrics
- Automatic rollback — Failed changes revert instantly. No debates
- Simplicity wins — Equal results + less code = KEEP. Tiny improvement + ugly complexity = DISCARD
- Git is memory — Every kept change committed. Agent reads history to learn patterns
- When stuck, think harder — Re-read files, re-read goal AND
.context/autoresearch-plan.mdfor planned strategy, try next untried approach from the plan, combine near-misses, try radical changes. Don't ask for help unless truly blocked by missing access/permissions
Principles Reference
See references/core-principles.md for the 7 generalizable principles from autoresearch.
Commander Integration (Task Tracking & Visibility)
When Commander is available, autoresearch MUST track every iteration as a Commander task. This gives the dashboard full visibility into autonomous work — just like the tasks extension does for manual workflows.
Setup Phase (Phase 3) — Create Task Group
After establishing the baseline and getting plan approval, create a Commander task group for this research session:
Store the returned group_id — all iteration tasks will be added to this group.
Send an initial mailbox status broadcast:
Per-Iteration — Create → Claim → Complete
Before modifying (step 3 of each loop iteration), create and claim a Commander task:
After logging results (step 7 of each loop iteration), complete the task with the outcome:
Also add a comment to the task with detailed results:
Note: Use complete for ALL outcomes (keep, discard, crash). Discards and crashes are expected in autoresearch — they're not failures. Reserve fail only for unrecoverable errors that halt the entire loop.
Status Broadcasts — Every ~5 Iterations
Every 5 iterations, send a mailbox status update AND add a comment to the group:
Research Complete — Report & Implementation Handoff (MANDATORY)
When the loop ends (bounded mode reaching N, or goal achieved):
- Final mailbox broadcast with full summary:
- Compile findings & next steps — Extract prioritized, actionable implementation items from the research. Update the session file with findings, next steps array, and final metric.
- Research report — Present via
show_reportframed as a handoff:
- Ask about implementation — Use
ask_userto offer three choices:
- Implement now → spawn a team of builder agents via
subagent_create_batch - Save & pause → set session to "paused", resume later via
/research - Done → mark session "complete"
- Implementation (if chosen) — Update session to "implementing", create Commander task group, dispatch builders, track completion. When done, present final comprehensive report covering research results AND implementation work. Set session to "complete".
- Preserve the plan — Leave
.context/autoresearch-plan.mdintact. Leave the session file for browsing via/research.
Graceful Degradation
All Commander calls are optional. If Commander is unavailable:
- Skip
commander_taskandcommander_mailboxcalls silently - The local
autoresearch-results.tsvlog remains the primary record - The
show_reportcall still works (it only needs git, not Commander) - Never let a Commander error interrupt the autonomous loop
Adapting to Different Domains
| Domain | Metric | Scope | Verify Command | |
|---|---|---|---|---|
| Backend code | Tests pass + coverage % | src/**/*.ts | npm test | |
| Frontend UI | Lighthouse score | src/components/** | npx lighthouse | |
| ML training | val_bpb / loss | train.py | uv run train.py | |
| Blog/content | Word count + readability | content/*.md | Custom script | |
| Performance | Benchmark time (ms) | Target files | npm run bench | |
| Refactoring | Tests pass + LOC reduced | Target module | npm test && wc -l |
Adapt the loop to your domain. The PRINCIPLES are universal; the METRICS are domain-specific.
Session Persistence
Every autoresearch session is saved to .context/research-sessions/<session-id>.json. This enables:
- Resume later — pick up where you left off via
/researchcommand - Browse history — see all past research sessions in the research browser
- Track lifecycle — from understanding through implementation completion
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/autoresearch/SKILL.md
Popularity
- Repository stars
- 266
- Repository forks
- 41
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 30 Aug 2026, a month ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ruizrica/agent-pi/autoresearch)