jpskill.com
🛠️ 開発・MCP コミュニティ 🔴 エンジニア向け 👤 エンジニア・AI開発者

🛠️ Autoresearchエージェント

autoresearch-agent

指定されたファイルに対し、計測可能な指標が改善するよう自動で編集、評価を繰り返すことで、コードの速度向上やテスト成功率改善など、様々な最適化を無限ループで行うSkill。

⏱ テスト計画作成 2時間 → 20分

📺 まず動画で見る(YouTube)

▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗

※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。

📜 元の英語説明(参考)

Autonomous experiment loop that optimizes any file by a measurable metric. Inspired by Karpathy's autoresearch. The agent edits a target file, runs a fixed evaluation, keeps improvements (git commit), discards failures (git reset), and loops indefinitely. Use when: user wants to optimize code speed, reduce bundle/image size, improve test pass rate, optimize prompts, improve content quality (headlines, copy, CTR), or run any measurable improvement loop. Requires: a target file, an evaluation command that outputs a metric, and a git repo.

🇯🇵 日本人クリエイター向け解説

一言でいうと

指定されたファイルに対し、計測可能な指標が改善するよう自動で編集、評価を繰り返すことで、コードの速度向上やテスト成功率改善など、様々な最適化を無限ループで行うSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o autoresearch-agent.zip https://jpskill.com/download/4412.zip && unzip -o autoresearch-agent.zip && rm autoresearch-agent.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4412.zip -OutFile "$d\autoresearch-agent.zip"; Expand-Archive "$d\autoresearch-agent.zip" -DestinationPath $d -Force; ri "$d\autoresearch-agent.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して autoresearch-agent.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → autoresearch-agent フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-17
取得日時
2026-05-18
同梱ファイル
6

💬 こう話しかけるだけ — サンプルプロンプト

  • Autoresearch Agent を使って、最小構成のサンプルコードを示して
  • Autoresearch Agent の主な使い方と注意点を教えて
  • Autoresearch Agent を既存プロジェクトに組み込む方法を教えて

これをClaude Code に貼るだけで、このSkillが自動発動します。

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] autoresearch-agent

Autoresearch Agent

あなたが眠っている間に、エージェントが実験を行います。目覚めると、結果が手に入っています。

Karpathy の autoresearch にインスパイアされた自律的な実験ループです。エージェントは1つのファイルを編集し、固定された評価を実行し、改善点を保持し、失敗を破棄し、無限にループします。

当てずっぽうではなく、50回の測定された試行が積み重なっていきます。


スラッシュコマンド

コマンド 内容
/ar:setup 新しい実験を対話的にセットアップします
/ar:run 1回の実験イテレーションを実行します
/ar:loop 設定可能な間隔(10分、1時間、毎日、毎週、毎月)で自律ループを開始します
/ar:status ダッシュボードと結果を表示します
/ar:resume 一時停止した実験を再開します

このスキルがアクティブになる場合

ユーザーからの以下のパターンを認識します。

  • 「これをより速く / より小さく / より良くしてください」
  • 「[ファイル] を [メトリック] のために最適化してください」
  • 「私の [見出し / コピー / プロンプト] を改善してください」
  • 「一晩中実験を実行してください」
  • 「[メトリック] を X から Y にしたいです」
  • optimize、benchmark、improve、experiment loop、autoresearch を含むあらゆるリクエスト

ユーザーがターゲットファイルと成功を測定する方法を説明した場合、このスキルが適用されます。


セットアップ

初回 — 実験の作成

セットアップスクリプトを実行します。ユーザーは実験の場所を決定します。

プロジェクトレベル(リポジトリ内、git追跡、チームと共有可能):

python scripts/setup_experiment.py \
  --domain engineering \
  --name api-speed \
  --target src/api/search.py \
  --eval "pytest bench.py --tb=no -q" \
  --metric p50_ms \
  --direction lower \
  --scope project

ユーザーレベル(個人用、~/.autoresearch/ 内):

python scripts/setup_experiment.py \
  --domain marketing \
  --name medium-ctr \
  --target content/titles.md \
  --eval "python evaluate.py" \
  --metric ctr_score \
  --direction higher \
  --evaluator llm_judge_content \
  --scope user

--scope フラグは、.autoresearch/ がどこに配置されるかを決定します。

  • project (デフォルト) → リポジトリのルートに .autoresearch/。実験定義は git 追跡されます。結果は gitignore されます。
  • user → ホームディレクトリに ~/.autoresearch/。すべてが個人用です。

セットアップが作成するもの

.autoresearch/
├── config.yaml                        ← グローバル設定
├── .gitignore                         ← results.tsv、*.log を無視
└── {domain}/{experiment-name}/
    ├── program.md                     ← 目標、制約、戦略
    ├── config.cfg                     ← ターゲット、評価コマンド、メトリック、方向
    ├── results.tsv                    ← 実験ログ (gitignored)
    └── evaluate.py                    ← 評価スクリプト (--evaluator を使用した場合)

results.tsv の列: commit | metric | status | description

  • commit — 短い git ハッシュ
  • metric — 浮動小数点値、またはクラッシュの場合は "N/A"
  • status — keep | discard | crash
  • description — 変更内容またはクラッシュ理由

ドメイン

ドメイン ユースケース
engineering コード速度、メモリ、バンドルサイズ、テスト合格率、ビルド時間
marketing 見出し、ソーシャルコピー、メール件名、広告コピー、エンゲージメント
content 記事構造、SEO説明、可読性、CTR
prompts システムプロンプト、チャットボットのトーン、エージェントの指示
custom 測定可能なメトリックを持つその他すべて

program.md がすでに存在する場合

ユーザーが独自の program.md を作成している場合があります。実験ディレクトリで見つかった場合、それを読み込みます。それはテンプレートを上書きします。不足しているものだけを尋ねます。


エージェントプロトコル

あなたがループです。スクリプトはセットアップと評価を処理し、あなたは創造的な作業を処理します。

開始前

  1. .autoresearch/{domain}/{name}/config.cfg を読み込み、以下を取得します。
    • target — 編集するファイル
    • evaluate_cmd — 変更を測定するコマンド
    • metric — 評価出力で探すメトリック名
    • metric_direction — "lower" または "higher" がより良い
    • time_budget_minutes — 評価ごとの最大時間
  2. program.md を読み込み、戦略、制約、変更できる/できないことを確認します
  3. results.tsv を読み込み、実験履歴を確認します(列:commit, metric, status, description)
  4. 実験ブランチをチェックアウトします: git checkout autoresearch/{domain}/{name}

各イテレーション

  1. results.tsv をレビューします — 何がうまくいきましたか?何が失敗しましたか?何がまだ試されていませんか?
  2. ターゲットファイルに1つの変更を決定します。実験ごとに1つの変数です。
  3. ターゲットファイルを編集します
  4. コミットします: git add {target} && git commit -m "experiment: {description}"
  5. 評価します: python scripts/run_experiment.py --experiment {domain}/{name} --single
  6. 出力を読み込みます — メトリック値とともに KEEP、DISCARD、または CRASH が表示されます
  7. ステップ1に戻ります

スクリプトが処理するもの(あなたは処理しません)

  • タイムアウト付きで評価コマンドを実行する
  • 評価出力からメトリックを解析する
  • 以前の最良値と比較する
  • 失敗時にコミットを元に戻す (git reset --hard HEAD~1)
  • 結果を results.tsv にログ記録する

実験の開始

# 単一イテレーション(エージェントがこれを繰り返し呼び出します)
python scripts/run_experiment.py --experiment engineering/api-speed --single

# ドライラン(開始前にセットアップをテストします)
python scripts/run_experiment.py --experiment engineering/api-speed --dry-run

戦略のエスカレーション

  • 1-5回目:簡単な改善(明白な改善、単純な最適化)
  • 6-15回目:体系的な探索(一度に1つのパラメータを変更)
  • 16-30回目:構造的な変更(アルゴリズムの入れ替え、アーキテクチャの変更)
  • 30回目以降:根本的な実験(全く異なるアプローチ)
  • 20回以上の実行で改善がない場合:program.md の Strategy セクションを更新します

自己改善

10回の実験ごとに、results.tsv をレビューしてパターンを探します。学んだことを program.md の Strategy セクションに更新します(例:「キャッシュの変更は常に5-10%改善する」、「リファクタリングの試みはメトリックを改善しない」)。将来のイテレーションは、この蓄積された知識から恩恵を受けます。

停止

  • ユーザーによる中断、コンテキスト制限への到達、または program.md の目標達成まで実行します
  • 停止する前に:results.tsv が最新であることを確認します
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Autoresearch Agent

You sleep. The agent experiments. You wake up to results.

Autonomous experiment loop inspired by Karpathy's autoresearch. The agent edits one file, runs a fixed evaluation, keeps improvements, discards failures, and loops indefinitely.

Not one guess — fifty measured attempts, compounding.


Slash Commands

Command What it does
/ar:setup Set up a new experiment interactively
/ar:run Run a single experiment iteration
/ar:loop Start autonomous loop with configurable interval (10m, 1h, daily, weekly, monthly)
/ar:status Show dashboard and results
/ar:resume Resume a paused experiment

When This Skill Activates

Recognize these patterns from the user:

  • "Make this faster / smaller / better"
  • "Optimize [file] for [metric]"
  • "Improve my [headlines / copy / prompts]"
  • "Run experiments overnight"
  • "I want to get [metric] from X to Y"
  • Any request involving: optimize, benchmark, improve, experiment loop, autoresearch

If the user describes a target file + a way to measure success → this skill applies.


Setup

First Time — Create the Experiment

Run the setup script. The user decides where experiments live:

Project-level (inside repo, git-tracked, shareable with team):

python scripts/setup_experiment.py \
  --domain engineering \
  --name api-speed \
  --target src/api/search.py \
  --eval "pytest bench.py --tb=no -q" \
  --metric p50_ms \
  --direction lower \
  --scope project

User-level (personal, in ~/.autoresearch/):

python scripts/setup_experiment.py \
  --domain marketing \
  --name medium-ctr \
  --target content/titles.md \
  --eval "python evaluate.py" \
  --metric ctr_score \
  --direction higher \
  --evaluator llm_judge_content \
  --scope user

The --scope flag determines where .autoresearch/ lives:

  • project (default) → .autoresearch/ in the repo root. Experiment definitions are git-tracked. Results are gitignored.
  • user~/.autoresearch/ in the home directory. Everything is personal.

What Setup Creates

.autoresearch/
├── config.yaml                        ← Global settings
├── .gitignore                         ← Ignores results.tsv, *.log
└── {domain}/{experiment-name}/
    ├── program.md                     ← Objectives, constraints, strategy
    ├── config.cfg                     ← Target, eval cmd, metric, direction
    ├── results.tsv                    ← Experiment log (gitignored)
    └── evaluate.py                    ← Evaluation script (if --evaluator used)

results.tsv columns: commit | metric | status | description

  • commit — short git hash
  • metric — float value or "N/A" for crashes
  • status — keep | discard | crash
  • description — what changed or why it crashed

Domains

Domain Use Cases
engineering Code speed, memory, bundle size, test pass rate, build time
marketing Headlines, social copy, email subjects, ad copy, engagement
content Article structure, SEO descriptions, readability, CTR
prompts System prompts, chatbot tone, agent instructions
custom Anything else with a measurable metric

If program.md Already Exists

The user may have written their own program.md. If found in the experiment directory, read it. It overrides the template. Only ask for what's missing.


Agent Protocol

You are the loop. The scripts handle setup and evaluation — you handle the creative work.

Before Starting

  1. Read .autoresearch/{domain}/{name}/config.cfg to get:
    • target — the file you edit
    • evaluate_cmd — the command that measures your changes
    • metric — the metric name to look for in eval output
    • metric_direction — "lower" or "higher" is better
    • time_budget_minutes — max time per evaluation
  2. Read program.md for strategy, constraints, and what you can/cannot change
  3. Read results.tsv for experiment history (columns: commit, metric, status, description)
  4. Checkout the experiment branch: git checkout autoresearch/{domain}/{name}

Each Iteration

  1. Review results.tsv — what worked? What failed? What hasn't been tried?
  2. Decide ONE change to the target file. One variable per experiment.
  3. Edit the target file
  4. Commit: git add {target} && git commit -m "experiment: {description}"
  5. Evaluate: python scripts/run_experiment.py --experiment {domain}/{name} --single
  6. Read the output — it prints KEEP, DISCARD, or CRASH with the metric value
  7. Go to step 1

What the Script Handles (you don't)

  • Running the eval command with timeout
  • Parsing the metric from eval output
  • Comparing to previous best
  • Reverting the commit on failure (git reset --hard HEAD~1)
  • Logging the result to results.tsv

Starting an Experiment

# Single iteration (the agent calls this repeatedly)
python scripts/run_experiment.py --experiment engineering/api-speed --single

# Dry run (test setup before starting)
python scripts/run_experiment.py --experiment engineering/api-speed --dry-run

Strategy Escalation

  • Runs 1-5: Low-hanging fruit (obvious improvements, simple optimizations)
  • Runs 6-15: Systematic exploration (vary one parameter at a time)
  • Runs 16-30: Structural changes (algorithm swaps, architecture shifts)
  • Runs 30+: Radical experiments (completely different approaches)
  • If no improvement in 20+ runs: update program.md Strategy section

Self-Improvement

After every 10 experiments, review results.tsv for patterns. Update the Strategy section of program.md with what you learned (e.g., "caching changes consistently improve by 5-10%", "refactoring attempts never improve the metric"). Future iterations benefit from this accumulated knowledge.

Stopping

  • Run until interrupted by the user, context limit reached, or goal in program.md is met
  • Before stopping: ensure results.tsv is up to date
  • On context limit: the next session can resume — results.tsv and git log persist

Rules

  • One change per experiment. Don't change 5 things at once. You won't know what worked.
  • Simplicity criterion. A small improvement that adds ugly complexity is not worth it. Equal performance with simpler code is a win. Removing code that gets same results is the best outcome.
  • Never modify the evaluator. evaluate.py is the ground truth. Modifying it invalidates all comparisons. Hard stop if you catch yourself doing this.
  • Timeout. If a run exceeds 2.5× the time budget, kill it and treat as crash.
  • Crash handling. If it's a typo or missing import, fix and re-run. If the idea is fundamentally broken, revert, log "crash", move on. 5 consecutive crashes → pause and alert.
  • No new dependencies. Only use what's already available in the project.

Evaluators

Ready-to-use evaluation scripts. Copied into the experiment directory during setup with --evaluator.

Free Evaluators (no API cost)

Evaluator Metric Use Case
benchmark_speed p50_ms (lower) Function/API execution time
benchmark_size size_bytes (lower) File, bundle, Docker image size
test_pass_rate pass_rate (higher) Test suite pass percentage
build_speed build_seconds (lower) Build/compile/Docker build time
memory_usage peak_mb (lower) Peak memory during execution

LLM Judge Evaluators (uses your subscription)

Evaluator Metric Use Case
llm_judge_content ctr_score 0-10 (higher) Headlines, titles, descriptions
llm_judge_prompt quality_score 0-100 (higher) System prompts, agent instructions
llm_judge_copy engagement_score 0-10 (higher) Social posts, ad copy, emails

LLM judges call the CLI tool the user is already running (Claude, Codex, Gemini). The evaluation prompt is locked inside evaluate.py — the agent cannot modify it. This prevents the agent from gaming its own evaluator.

The user's existing subscription covers the cost:

  • Claude Code Max → unlimited Claude calls for evaluation
  • Codex CLI (ChatGPT Pro) → unlimited Codex calls
  • Gemini CLI (free tier) → free evaluation calls

Custom Evaluators

If no built-in evaluator fits, the user writes their own evaluate.py. Only requirement: it must print metric_name: value to stdout.

#!/usr/bin/env python3
# My custom evaluator — DO NOT MODIFY after experiment starts
import subprocess
result = subprocess.run(["my-benchmark", "--json"], capture_output=True, text=True)
# Parse and output
print(f"my_metric: {parse_score(result.stdout)}")

Viewing Results

# Single experiment
python scripts/log_results.py --experiment engineering/api-speed

# All experiments in a domain
python scripts/log_results.py --domain engineering

# Cross-experiment dashboard
python scripts/log_results.py --dashboard

# Export formats
python scripts/log_results.py --experiment engineering/api-speed --format csv --output results.csv
python scripts/log_results.py --experiment engineering/api-speed --format markdown --output results.md
python scripts/log_results.py --dashboard --format markdown --output dashboard.md

Dashboard Output

DOMAIN          EXPERIMENT          RUNS  KEPT  BEST         Δ FROM START  STATUS
engineering     api-speed            47    14   185ms        -76.9%        active
engineering     bundle-size          23     8   412KB        -58.3%        paused
marketing       medium-ctr           31    11   8.4/10       +68.0%        active
prompts         support-tone         15     6   82/100       +46.4%        done

Export Formats

  • TSV — default, tab-separated (compatible with spreadsheets)
  • CSV — comma-separated, with proper quoting
  • Markdown — formatted table, readable in GitHub/docs

Proactive Triggers

Flag these without being asked:

  • No evaluation command works → Test it before starting the loop. Run once, verify output.
  • Target file not in gitgit init && git add . && git commit -m 'initial' first.
  • Metric direction unclear → Ask: is lower or higher better? Must know before starting.
  • Time budget too short → If eval takes longer than budget, every run crashes.
  • Agent modifying evaluate.py → Hard stop. This invalidates all comparisons.
  • 5 consecutive crashes → Pause the loop. Alert the user. Don't keep burning cycles.
  • No improvement in 20+ runs → Suggest changing strategy in program.md or trying a different approach.

Installation

One-liner (any tool)

git clone https://github.com/alirezarezvani/claude-skills.git
cp -r claude-skills/engineering/autoresearch-agent ~/.claude/skills/

Multi-tool install

./scripts/convert.sh --skill autoresearch-agent --tool codex|gemini|cursor|windsurf|openclaw

OpenClaw

clawhub install cs-autoresearch-agent

Related Skills

  • self-improving-agent — improves an agent's own memory/rules over time. NOT for structured experiment loops.
  • senior-ml-engineer — ML architecture decisions. Complementary — use for initial design, then autoresearch for optimization.
  • tdd-guide — test-driven development. Complementary — tests can be the evaluation function.
  • skill-security-auditor — audit skills before publishing. NOT for optimization loops.

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。