autoresearch-hooks
O que ela faz
Esta skill ajuda sua IA a escrever scripts opcionais que rodam no início e no fim de cada experimento de uma sessão do autoresearch. Ela serve para quem quer notificações, notas salvas ou etapas extras em torno do ciclo.
Quando usar
- ✓Quando você quer uma mensagem no Slack ou em um webhook enviada após cada experimento.
- ✓Quando você quer que o ciclo salve aprendizados ou busque pesquisas antes de uma nova iteração.
- ✓Quando o ciclo de experimentos parece travado e você quer uma etapa extra para mudar sua direção.
Link da skill
https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Adicione um hook que me envie uma mensagem quando cada experimento terminar.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Os scripts de hook recebem um resumo curto da última execução em texto, e podem salvar arquivos ou enviar notas. Scripts que não estão marcados como executáveis são ignorados.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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 rotationexamples/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
Understand the session. Read
.auto/prompt.mdfor the objective and metric; glance at.auto/measure.shfor the workload. Your hook should complement the loop, not duplicate it.Clarify the user's intent. What should happen, at which boundary? Research before / log after / notify on wins / intervene on thrash / etc.
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
Perguntas frequentes
Quando esses scripts rodam?
O script de antes roda antes de cada iteração, e o script de depois roda após cada experimento registrado.
Que informações um script recebe?
Ele recebe um resumo curto em JSON com a última execução, o número da próxima execução e os detalhes da sessão.
Os hooks são obrigatórios?
Não. Os dois arquivos de hook são opcionais.
Detalhes
Descrição original do 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.
Popularidade
- Estrelas no GitHub
- 8,2 mil
- Posição no ranking
- #12524
- Licença
- MIT
- Atualizada em
- 07/10/2026
Comentários
- …
Mais skills deste repositório
autoresearch-create
8,2 milAjuda seu agente a rodar um ciclo autônomo de experimentos que testa ideias, mantém o que melhora um alvo escolhido e descarta o resto.
autoresearch-finalize
8,2 milAjuda seu agente a transformar uma série bagunçada de mudanças experimentais em branches separadas e limpas, prontas para revisão.
Skills parecidas
add-model-provider
394 milPermite que seu agente conecte um novo provedor de modelos de IA ao OpenClaw com comandos seguros, guarde as chaves de API com segurança e faça um teste ao vivo.
acp-router
394 milAjuda seu agente a enviar uma tarefa a um assistente de programação, como Claude Code ou Cursor, pelo OpenClaw, para que o trabalho rode nessa ferramenta.
browser-automation
394 milEnsina seu agente a controlar páginas web passo a passo, incluindo logins, abas e recuperação quando uma página para de responder.