Przejdź do treści
Biblioteka skilli
AI i agenci · Automatyzacja

autoresearch-hooks

/autoresearch-hooks

Tworzy hooki uruchamiane przed i po iteracji sesji autoresearch, na przykład pobieranie źródeł, powiadomienia Slack lub webhook, zapis wniosków i automatyczne tagowanie.

Licencja
MIT
Ostatnia zmiana repozytorium
07.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
11
Skrypty
9
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 07.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 9 skryptów w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: examples/after/auto-tag-winners.sh, examples/after/learnings-journal.sh, examples/after/macos-notify.sh, examples/before/anti-thrash.sh, examples/before/context-rotation.sh, examples/before/external-search.sh, examples/before/hypothesis-reflection.sh, examples/before/idea-rotator.sh, examples/before/qmd-search.sh

Co robi i kiedy

Tworzy hooki uruchamiane przed i po iteracji sesji autoresearch, na przykład pobieranie źródeł, powiadomienia Slack lub webhook, zapis wniosków i automatyczne tagowanie.

Oryginalny opis (EN)

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.

Jak działa

  1. Contract
  2. Examples
  3. Steps to add a hook
  4. Rules of thumb
Sekcje z nagłówków SKILL.md, w oryginale · 170 linii, 814 słów
Podgląd SKILL.md
---
name: autoresearch-hooks
description: 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.
---

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

```json
{
  "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`

```json
{
  "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 parsed with `jq`). If the request combines retrospective + prospective concerns, use both `before.sh` and `after.sh` — don't overload one.

4. **Copy, adapt, mark executable.**

   ```bash
   mkdir -p .auto/hooks
   cp "<skill-dir>/examples/before/external-search.sh" .auto/hooks/before.sh
   # ... adapt the script ...
   chmod +x .auto/hooks/before.sh
   ```

5. **Sanity-test with a piped mock** before relying on it in the loop:

   ```bash
   jq -n '
     {
       event: "before",
       cwd: ".",
       next_run: 1,
       last_run: null,
       session: {
         metric_name: "total_ms",
         metric_unit: "ms",
         direction: "lower",
         baseline_metric: null,
         best_metric: null,
         run_count: 0,
         goal: "test"
       }
     }
   ' | ./.auto/hooks/before.sh
   ```

   For `after.sh`, swap `last_run: null` for a `run_entry` object (see the schema above).

6. **Commit the hook** alongside other session files. It's preserved across reverts because it lives under `.auto/`.

---

## Rules of thumb

- **Read whatever fields the agent naturally writes** — `asi.hypothesis`, `asi.next_focus`, `asi.learned`, `description`. Don't invent a "hook input" field and instruct the agent to populate it; that breaks the transparency principle.

- **Silent is the default.** Only print to stdout when you have something useful for the agent. Empty stdout means no steer.

- **Guard with early exits.** `[ -z "$query" ] && exit 0` is cheaper and clearer than wrapping everything in `if`.

- **One concern per script.** If you want research + learnings, put them in separate files (`before.sh` and `after.sh`). Don't bundle.

- **No environment variables.** Everything is on stdin; extract `cwd` (and anything else) with `jq`. There is no `$AUTORESEARCH_WORK_DIR`.
Pliki w paczce (11)
  • SKILL.md 6 KB
  • examples/README.md 3 KB
  • examples/after/auto-tag-winners.sh 1 KB
  • examples/after/learnings-journal.sh 1 KB
  • examples/after/macos-notify.sh 1 KB
  • examples/before/anti-thrash.sh 1 KB
  • examples/before/context-rotation.sh 1 KB
  • examples/before/external-search.sh 1 KB
  • examples/before/hypothesis-reflection.sh 1 KB
  • examples/before/idea-rotator.sh 1 KB
  • examples/before/qmd-search.sh 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · davebcn87/pi-autoresearch100MIT
ethanolivertroy/public-skills100MIT

Migawka bazy z 28.10.2026 · wersja paczki 7a8cc9a8ca4f (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100ar-run
    Wykonuje jedną iterację eksperymentu autoresearch: edytuje plik docelowy, ocenia wynik i zachowuje albo odrzuca wprowadzoną zmianę.
  • 100autoresearch-create
    Konfiguruje i uruchamia autonomiczną pętlę eksperymentów dla dowolnego celu optymalizacji: zbiera, co optymalizować, i od razu startuje pętlę.
  • 100autoresearch-create
    Konfiguruje i uruchamia autonomiczną pętlę eksperymentów dla dowolnego celu optymalizacji: zbiera, co optymalizować, i od razu startuje pętlę.
  • 100autoresearch-skill
    Prowadzi autonomiczne eksperymenty i badania w pętli inspirowanej autoresearch Karpathy'ego, z mechaniczną oceną wyników, pracą przez noc i bez zależności.
  • 100v1-autoresearch-skill
    Prowadzi mierzoną pętlę optymalizacji wobec wybranego celu i zachowuje tylko zmiany, które realnie poprawiają wynik.
  • 80autoresearch:learn
    Zamienia nieudane uruchomienia i opinie o autoresearch-skill w plan poprawy, scenariusz ewaluacji i listę zmian, bez automatycznej poprawki.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.