autoresearch-hooks
하는 일
이 스킬은 autoresearch 세션에서 실험 시작과 끝에 실행되는 선택 스크립트를 AI가 작성하도록 돕습니다. 알림, 메모 저장, 반복 사이의 추가 단계를 원하는 사람을 위한 스킬입니다.
사용하는 경우
- ✓실험이 끝날 때마다 Slack이나 웹훅 메시지를 받고 싶을 때.
- ✓새 반복을 시작하기 전에 배운 내용을 저장하거나 자료를 가져오고 싶은 경우.
- ✓실험 반복이 막힌 것 같아 방향을 바꿀 추가 단계가 필요할 때.
스킬 링크
https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“실험이 끝날 때마다 제게 메시지를 보내는 훅을 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
훅 스크립트는 마지막 실행의 짧은 요약을 텍스트로 받으며, 파일을 저장하거나 메모를 보낼 수 있습니다. 실행 가능으로 표시되지 않은 스크립트는 무시됩니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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
자주 묻는 질문
이 스크립트는 언제 실행되나요?
사전 스크립트는 각 반복 전에, 사후 스크립트는 기록된 각 실험 뒤에 실행됩니다.
스크립트는 어떤 정보를 받나요?
마지막 실행, 다음 실행 번호, 세션 정보가 담긴 짧은 JSON 요약을 받습니다.
훅은 꼭 필요한가요?
아닙니다. 두 훅 파일 모두 선택 사항입니다.
상세 정보
작성자의 원본 설명
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.
인기도
- GitHub 스타
- 8.2k
- 순위
- #12524
- 라이선스
- MIT
- 업데이트
- 2026. 10. 7.
댓글
- …
이 저장소의 다른 스킬
autoresearch-create
8.2k에이전트가 아이디어를 시험하고, 목표를 개선하는 것만 남기고 나머지는 버리는 자율 실험 반복을 돌리도록 돕습니다.
autoresearch-finalize
8.2k에이전트가 어수선한 실험 변경을 검토하기 좋은 깔끔한 별도 브랜치로 정리하도록 돕습니다.
비슷한 스킬
add-model-provider
394k에이전트가 안전한 설정 명령으로 새 AI 모델 제공자를 OpenClaw에 연결하고, API 키를 평문으로 두지 않으며, 실시간 테스트를 실행하도록 돕습니다.
acp-router
394k에이전트가 OpenClaw를 통해 Claude Code나 Cursor 같은 코딩 도우미에 작업을 전달해, 작업이 그 도구에서 실행되도록 돕습니다.
browser-automation
394k에이전트가 로그인, 탭, 페이지 응답이 멈췄을 때의 복구를 포함해 웹 페이지를 단계별로 조작하도록 가르칩니다.