Langsung ke konten
Skillpedia
Agen8.2k Β· #12524

autoresearch-hooks

Fungsinya

Skill ini membantu AI Anda menulis skrip opsional yang berjalan di awal dan akhir setiap eksperimen dalam sesi autoresearch. Skill ini untuk orang yang menginginkan notifikasi, catatan tersimpan, atau langkah tambahan di sekitar siklus.

Kapan dipakai

  • βœ“Saat Anda ingin pesan Slack atau webhook dikirim setelah setiap eksperimen.
  • βœ“Saat Anda ingin siklus menyimpan pembelajaran atau mengambil riset sebelum iterasi baru.
  • βœ“Saat siklus eksperimen tampak macet dan Anda ingin langkah tambahan untuk mengubah arahnya.

Link skill

https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTambahkan hook yang mengirim pesan kepada saya setelah setiap eksperimen selesai.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skrip hook menerima ringkasan singkat dari eksekusi terakhir dalam bentuk teks, dan dapat menyimpan berkas atau mengirim catatan. Skrip yang tidak ditandai sebagai dapat dieksekusi akan diabaikan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

autoresearch-hooks

Optional scripts that run at iteration boundaries in an autoresearch session. Two hooks, both transparent to the loop-running agent β€” their effect is a file on disk or a steer message.

.auto/hooks/
  before.sh    # fires before each iteration (prospective)
  after.sh     # fires after each log_experiment (retrospective)

Both files are optional. Files without the executable bit are silently ignored.


Contract

Stdin β€” before.sh

One JSON line. Parse with jq. Realistic example:

{
  "event": "before",
  "cwd": "/path/to/workdir",
  "next_run": 6,
  "last_run": {
    "run": 5,
    "status": "discard",
    "metric": 42.1,
    "description": "Simplified to sorted(arr) β€” copy cost dominates",
    "asi": {
      "hypothesis": "Built-in sort avoids Python overhead",
      "next_focus": "list copy avoidance"
    }
  },
  "session": {
    "metric_name": "total_ms",
    "metric_unit": "ms",
    "direction": "lower",
    "baseline_metric": 40.7,
    "best_metric": 33.5,
    "run_count": 5,
    "goal": "optimize sort speed"
  }
}
Field Notes
last_run The most recent run entry. null on a fresh session.
session.direction "lower" or "higher" β€” which end of the scale wins.
session.baseline_metric First run of the current segment. null until one run exists.
session.best_metric Optimal metric across kept runs only. null until one is kept.
session.goal The session name set by init_experiment.
session.run_count Total runs logged so far (any status).

Stdin β€” after.sh

{
  "event": "after",
  "cwd": "/path/to/workdir",
  "run_entry": {
    "run": 6,
    "status": "discard",
    "metric": 38.9,
    "description": "Timsort hybrid slower on random",
    "asi": {
      "hypothesis": "Partial-sort heuristic on input distribution",
      "learned": "Overhead dominates on random arrays"
    }
  },
  "session": {
    "metric_name": "total_ms",
    "metric_unit": "ms",
    "direction": "lower",
    "baseline_metric": 40.7,
    "best_metric": 33.5,
    "run_count": 6,
    "goal": "optimize sort speed"
  }
}
Field Notes
run_entry The run just logged. Always present.
session Same shape as in before.sh, reflecting state after the run.

Output

  • Stdout (up to 8 KB) β€” delivered to the agent as a steer message on the next turn. Empty = silent.
  • Stderr + non-zero exit β€” surfaced as an error steer.
  • Timeout β€” 30 s hard kill; flagged in the observability entry.

Preservation

.auto/** survives the auto-revert β€” the entire .auto/ folder is preserved. (Legacy autoresearch.* paths are still preserved too, for in-flight sessions.)


Examples

Runnable reference scripts live in this skill's examples/ directory β€” one file per pattern. Paths are resolved against the skill directory (parent of SKILL.md). Browse them for inspiration; they're not policy.

  • examples/before/ β€” external search, qmd document search, anti-thrash, idea rotator, hypothesis reflection, context rotation
  • examples/after/ β€” learnings journal, macOS notification on new best, auto-tag winning commits

Each example is a complete, self-contained script with named constants, short helper functions, guard clauses, and intention-revealing names. Read the header comment for its purpose, copy to .auto/hooks/<stage>.sh, adapt.


Steps to add a hook

  1. Understand the session. Read .auto/prompt.md for the objective and metric; glance at .auto/measure.sh for the workload. Your hook should complement the loop, not duplicate it.

  2. Clarify the user's intent. What should happen, at which boundary? Research before / log after / notify on wins / intervene on thrash / etc.

  3. Start from an example in examples/ that's closest to the intent (resolve against the skill directory). If nothing fits, write from scratch following the same style (named constants, short functions, guard clauses, JSON stdin par

Pertanyaan umum

Kapan skrip ini berjalan?

Skrip sebelum berjalan sebelum setiap iterasi, dan skrip sesudah berjalan setelah setiap eksperimen yang tercatat.

Informasi apa yang diterima skrip?

Ia menerima ringkasan singkat dalam JSON berisi eksekusi terakhir, nomor eksekusi berikutnya, dan detail sesi.

Apakah hook wajib?

Tidak. Kedua berkas hook bersifat opsional.

Detail

Deskripsi asli dari pembuat

Author pre/post-iteration hooks for an autoresearch session. Use when the user asks to add research fetching, Slack/webhook notifications, persistent learnings, auto-tagging, anti-thrash intervention, idea rotation, or any side effect around iterations.

repo: davebcn87/pi-autoresearch

Popularitas

Bintang GitHub
8.2k
Peringkat
#12524
Lisensi
MIT
Diperbarui
7/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa