autoresearch-hooks
यह क्या करती है
यह स्किल आपके AI को autoresearch सत्र में हर प्रयोग की शुरुआत और अंत में चलने वाली वैकल्पिक स्क्रिप्ट लिखने में मदद करती है। यह उन लोगों के लिए है जिन्हें लूप के आसपास सूचनाएँ, सहेजे गए नोट या अतिरिक्त कदम चाहिए।
कब इस्तेमाल करें
- ✓जब आप हर प्रयोग के बाद Slack या वेबहुक से संदेश भेजना चाहें।
- ✓जब आप चाहते हों कि हर नए चरण से पहले लूप सीख सहेजे या शोध लाए।
- ✓जब प्रयोग लूप अटका लगे और आप उसकी दिशा बदलने के लिए एक अतिरिक्त कदम चाहें।
Skill का लिंक
https://github.com/davebcn87/pi-autoresearch/blob/main/skills/autoresearch-hooks/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक हुक जोड़िए जो हर प्रयोग खत्म होने के बाद मुझे संदेश भेजे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
हुक स्क्रिप्ट को आखिरी रन का एक छोटा सार टेक्स्ट में मिलता है, और वे फ़ाइलें सहेज सकती हैं या नोट भेज सकती हैं। जो स्क्रिप्ट executable के रूप में चिह्नित नहीं हैं, उन्हें अनदेखा किया जाता है।
तकनीकी सामग्री (मूल 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
- अपडेट की गई
- 7/10/2026
कमेंट
- …
इस repository की और skills
autoresearch-create
8.2kयह आपके एजेंट को एक स्वचालित प्रयोग चक्र चलाने में मदद करती है, जो विचार आज़माता है, चुने हुए लक्ष्य में सुधार वाले रखता है और बाकी हटा देता है।
autoresearch-finalize
8.2kयह आपके एजेंट को प्रयोग बदलावों के उलझे क्रम को साफ़, अलग शाखाओं में बदलने में मदद करती है, जो समीक्षा के लिए तैयार हों।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।