| name | autoresearch |
| description | Auto-improve any agent prompt using Karpathy's autoresearch method with iterative test-measure-improve loops |
| author | Jennings Liu |
| version | 1.0.0 |
| license | MIT |
Based on Andrej Karpathy's autoresearch method. Instead of manually improving agent prompts, run an iterative loop: try a small change, score the result, keep improvements, revert regressions. Systematically increase agent output quality.
Triggers on: "autoresearch", "auto-improve", "optimize agent", "tune prompt", "improve skill quality"
Run agent on test input.
Score output against checklist (yes/no).
Record baseline score (average of 3 runs).
Analyze weakest checklist items.
Make ONE small change to agent prompt.
Re-run agent on same test input (3 runs).
Score again.
If improved → KEEP change. If dropped → REVERT.
Repeat until 95%+ score 3 times in a row OR max rounds reached (default: 10).
User specifies agent. Read from `agents/.md`.
3-6 yes/no questions. Each checks one specific aspect. Good: "Does the code review identify at least one production-risk bug?" Bad: "Rate the quality 1-10" (subjective).
Run agent on test input 3 times. Score each. Average = baseline.
For each round: analyze failing items → hypothesize one change → apply (save backup) → test 3 runs → score → KEEP if improved, REVERT if same/worse → log round.
Produce summary (baseline/final score, rounds, changes kept/reverted) and changelog per round (score change, what changed, why, effect).
Add specific gotcha, add worked example, add banned-patterns list, add rule targeting weakest item, restructure output template
Rewriting entire prompt, adding vague instructions, adding 5 rules at once, removing sections without testing
Using only one test input optimizes for that case. Use 2-3 diverse inputs.
More than 6 items may cause gaming individual checks at expense of quality.
Short-term score drops may enable bigger gains. Try "creative rounds" for structural changes.
Results stored in `${CLAUDE_PLUGIN_DATA}/autoresearch/`: `[agent-name]-results.json` and `[agent-name]-changelog.md`.