Zum Inhalt springen
Skillpedia
Agenten8.2k · #12524

autoresearch-hooks

Was er macht

Diese Fähigkeit hilft deiner KI, optionale Skripte zu schreiben, die am Anfang und Ende jedes Experiments in einer autoresearch-Sitzung laufen. Sie ist für Menschen gedacht, die Benachrichtigungen, gespeicherte Notizen oder zusätzliche Schritte rund um die Schleife wollen.

Wann du ihn nutzt

  • ✓Wenn du nach jedem Experiment eine Nachricht an Slack oder einen Webhook senden möchtest.
  • ✓Wenn die Schleife Erkenntnisse speichern oder Recherche abrufen soll, bevor eine neue Iteration beginnt.
  • ✓Wenn die Experimentschleife festzuhängen scheint und du einen zusätzlichen Schritt brauchst, um ihre Richtung zu ändern.

Link zum Skill

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

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Füge einen Hook hinzu, der mir eine Nachricht schickt, sobald jedes Experiment abgeschlossen ist.”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Die Hook-Skripte erhalten eine kurze Zusammenfassung des letzten Durchlaufs als Text und können Dateien speichern oder Notizen senden. Skripte, die nicht als ausführbar markiert sind, werden ignoriert.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von 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

Häufige Fragen

Wann laufen diese Skripte?

Das Skript vor dem Start läuft vor jeder Iteration, das Skript danach nach jedem protokollierten Experiment.

Welche Informationen erhält ein Skript?

Es erhält eine kurze JSON-Zusammenfassung mit dem letzten Durchlauf, der nächsten Durchlaufnummer und den Sitzungsdetails.

Sind die Hooks erforderlich?

Nein. Beide Hook-Dateien sind optional.

Details

Originalbeschreibung des Autors

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

Beliebtheit

GitHub-Sterne
8.2k
Platz im Ranking
#12524
Lizenz
MIT
Aktualisiert
7.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills