Saltar al contenido
Skillpedia
Agentes8,2 mil · #12524

autoresearch-hooks

Qué hace

Esta habilidad ayuda a tu IA a escribir scripts opcionales que se ejecutan al inicio y al final de cada experimento de una sesión de autoresearch. Es para quien quiere notificaciones, notas guardadas o pasos extra alrededor del bucle.

Cuándo usarla

  • ✓Cuando quieres que se envíe un mensaje a Slack o a un webhook después de cada experimento.
  • ✓Cuando quieres que el bucle guarde aprendizajes o busque investigación antes de una nueva iteración.
  • ✓Cuando el bucle de experimentos parece atascado y quieres un paso extra para cambiar su rumbo.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Añade un hook que me envíe un mensaje cuando termine cada experimento.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Los scripts de hook reciben un resumen breve de la última ejecución en forma de texto, y pueden guardar archivos o enviar notas. Los scripts que no están marcados como ejecutables se ignoran.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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

Preguntas frecuentes

¿Cuándo se ejecutan estos scripts?

El script previo se ejecuta antes de cada iteración, y el posterior después de cada experimento registrado.

¿Qué información recibe un script?

Recibe un resumen breve en JSON con la última ejecución, el número de la siguiente y los datos de la sesión.

¿Los hooks son obligatorios?

No. Los dos archivos de hook son opcionales.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
8,2 mil
Posición en el ranking
#12524
Licencia
MIT
Actualizada
7/10/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas