loop – skill Agent & Tự động hóa cho agent AI
Khởi động vòng lặp thử nghiệm tự động với khoảng thời gian do người dùng chọn (10 phút, 1 giờ, hằng ngày, hằng tuần, hằng tháng). Dùng CronCreate để lên lịch. Dùng khi người dùng chạy /ar:loop hoặc yêu cầu chạy thử nghiệm autoresearch liên tục theo lịch.
Cài skill loop bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/loop-dd749.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /loop – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/loop-dd749.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $loop – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/loop-dd749.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /loop – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/loop-dd749.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /loop – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
/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 loopWhat 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:
| Interval | Cron Expression | Shorthand |
|----------|----------------|-----------|
| 10 minutes | */10 * * * * | 10m |
| 1 hour | 7 * * * * | 1h |
| Daily | 57 8 * * * | daily |
| Weekly | 57 8 * * 1 | weekly |
| Monthly | 57 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_direction
2. Read .autoresearch/{domain}/{name}/program.md for strategy and constraints
3. Read .autoresearch/{domain}/{name}/results.tsv for experiment history
4. 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:
{
"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:loopto 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}).
Skill liên quan
- context-engineering – Tối ưu thiết lập ngữ cảnh cho agent. Dùng khi bắt đầu phiên mới, khi chất lượng đầu ra…
- context-kit – Đánh giá, điều chỉnh và cài đặt an toàn các artifact ngữ cảnh cá nhân của Context Kit…
- context-manager – Chuyên gia kỹ thuật ngữ cảnh AI ưu tú, thành thạo quản lý ngữ cảnh động, cơ sở dữ liệu…
- conversation-memory – Hệ thống bộ nhớ bền vững cho hội thoại LLM bao gồm bộ nhớ ngắn hạn, dài hạn và bộ nhớ…
- convertkit-automation – Tự động hóa tác vụ ConvertKit (Kit) qua Rube MCP (Composio): quản lý subscriber, tag…
- scan – Quét codebase để tạo project-doc.md và AGENTS.md. Dùng khi khởi tạo repo do agent điều…
- court – Đưa một ý tưởng ra xét xử: một Claude công tố và một Claude bào chữa tranh luận, 12…
- cron-doctor – Chẩn đoán và kiểm tra biểu thức cron trước khi đưa lên production. Phát hiện năm cạm bẫy…