본문으로 건너뛰기
Skillpedia
에이전트8.2k · #12524

autoresearch-hooks

하는 일

이 스킬은 autoresearch 세션에서 실험 시작과 끝에 실행되는 선택 스크립트를 AI가 작성하도록 돕습니다. 알림, 메모 저장, 반복 사이의 추가 단계를 원하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓실험이 끝날 때마다 Slack이나 웹훅 메시지를 받고 싶을 때.
  • ✓새 반복을 시작하기 전에 배운 내용을 저장하거나 자료를 가져오고 싶은 경우.
  • ✓실험 반복이 막힌 것 같아 방향을 바꿀 추가 단계가 필요할 때.

스킬 링크

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

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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 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

자주 묻는 질문

이 스크립트는 언제 실행되나요?

사전 스크립트는 각 반복 전에, 사후 스크립트는 기록된 각 실험 뒤에 실행됩니다.

스크립트는 어떤 정보를 받나요?

마지막 실행, 다음 실행 번호, 세션 정보가 담긴 짧은 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.

repo: davebcn87/pi-autoresearch

인기도

GitHub 스타
8.2k
순위
#12524
라이선스
MIT
업데이트
2026. 10. 7.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬