Loop

alirezarezvani/claude-skills/engineering/autoresearch-agent/skills/loop

作者 alirezarezvani19392f7a0826無授權條款27K 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

Start an autonomous experiment loop with user-selected interval (10min, 1h, daily, weekly, monthly). Uses CronCreate for scheduling. Use when the user runs /ar:loop or asks to run an autoresearch experiment continuously on a schedule.

僅含說明AI & Agents
AI 產生的概覽

為指定的自動研究實驗啟動依固定間隔執行的排程循環,每個間隔執行一次自主實驗迭代。

功能
此技能定義 /ar:loop 指令:先確定一個自動研究實驗,讓使用者選擇間隔(10 分鐘、每小時、每天、每週或每月),並將選擇對應到 cron 運算式。它透過 CronCreate 建立排程工作,其提示詞只執行一次迭代:讀取實驗的設定、策略說明與結果歷史,對目標檔案做一處修改並提交,執行實驗評估器,然後讀取 KEEP/DISCARD/CRASH 結果。它也會把循環中繼資料寫入 loop.json,並支援透過刪除排程工作與中繼資料檔案來停止循環。
適用情境
當使用者執行 /ar:loop,或要求依排程持續執行自動研究實驗時使用。它適合長時間或跨夜的實驗週期,每個間隔只測試一處變更。不適用於一次性實驗執行,也不適用於尚未建立自動研究結構的實驗。
執行需求
需要 CronCreate 與 CronDelete 排程工具、帶有 autoresearch 分支的 git 儲存庫,以及既有的 .autoresearch/{domain}/{name} 目錄(包含 config.cfg、program.md 與 results.tsv)。排程提示詞會引用技能路徑下的 run_experiment.py 指令碼,但此技能本身不附帶任何指令碼。

/ar:loop — Autonomous Experiment Loop

Start a recurring experiment loop that runs at a user-selected interval.

Usage

/ar:loop engineering/api-speed             # Start loop (prompts for interval)/ar:loop engineering/api-speed 10m         # Every 10 minutes/ar:loop engineering/api-speed 1h          # Every hour/ar:loop engineering/api-speed daily       # Daily at ~9am/ar:loop engineering/api-speed weekly      # Weekly on Monday ~9am/ar:loop engineering/api-speed monthly     # Monthly on 1st ~9am/ar:loop stop engineering/api-speed        # Stop an active loop

What It Does

Step 1: Resolve experiment

If no experiment specified, list experiments and let user pick.

Step 2: Select interval

If interval not provided as argument, present options:

Select loop interval:  1. Every 10 minutes  (rapid — stay and watch)  2. Every hour         (background — check back later)  3. Daily at ~9am      (overnight experiments)  4. Weekly on Monday   (long-running experiments)  5. Monthly on 1st     (slow experiments)

Map to cron expressions:

IntervalCron ExpressionShorthand
10 minutes*/10 * * * *10m
1 hour7 * * * *1h
Daily57 8 * * *daily
Weekly57 8 * * 1weekly
Monthly57 8 1 * *monthly

Step 3: Create the recurring job

Use CronCreate with this prompt (fill in the experiment details):

You are running autoresearch experiment "{domain}/{name}".
1. Read .autoresearch/{domain}/{name}/config.cfg for: target, evaluate_cmd, metric, metric_direction2. Read .autoresearch/{domain}/{name}/program.md for strategy and constraints3. Read .autoresearch/{domain}/{name}/results.tsv for experiment history4. Run: git checkout autoresearch/{domain}/{name}
Then do exactly ONE iteration:- Review results.tsv: what worked, what failed, what hasn't been tried- Edit the target file with ONE change (strategy escalation based on run count)- Commit: git add {target} && git commit -m "experiment: {description}"- Evaluate: python {skill_path}/scripts/run_experiment.py --experiment {domain}/{name} --single- Read the output (KEEP/DISCARD/CRASH)
Rules:- ONE change per experiment- NEVER modify the evaluator- If 5 consecutive crashes in results.tsv, delete this cron job (CronDelete) and alert- After every 10 experiments, update Strategy section of program.md
Current best metric: {read from results.tsv or "no baseline yet"}Total experiments so far: {count from results.tsv}

Step 4: Store loop metadata

Write to .autoresearch/{domain}/{name}/loop.json:

json
{  "cron_id": "{id from CronCreate}",  "interval": "{user selection}",  "started": "{ISO timestamp}",  "experiment": "{domain}/{name}"}

Step 5: Confirm to user

Loop started for {domain}/{name}  Interval: {interval description}  Cron ID: {id}  Auto-expires: 3 days (CronCreate limit)
  To check progress: /ar:ar-status  To stop the loop:  /ar:loop stop {domain}/{name}
  Note: Recurring jobs auto-expire after 3 days.  Run /ar:loop again to restart after expiry.

Stopping a Loop

When user runs /ar:loop stop {experiment}:

  1. Read .autoresearch/{domain}/{name}/loop.json to get the cron ID
  2. Call CronDelete with that ID
  3. Delete loop.json
  4. Confirm: "Loop stopped for {experiment}. {n} experiments completed."

Important Limitations

  • 3-day auto-expiry: CronCreate jobs expire after 3 days. For longer experiments, the user must re-run /ar:loop to restart. Results persist — the new loop picks up where the old one left off.
  • One loop per experiment: Don't start multiple loops for the same experiment.
  • Concurrent experiments: Multiple experiments can loop simultaneously ONLY if they're on different git branches (which they are by default — each experiment gets autoresearch/{domain}/{name}).

來源與署名

來源:alirezarezvani/claude-skills位於engineering/autoresearch-agent/skills/loop提交19392f7

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架