← 返回
AI智能 中文

Agent Loop

Structured Read→Plan→Execute→Verify→Report protocol for any task with side effects. Prevents false "done" reports, blind retries, and scope creep. Activate f...
结构化读取→计划→执行→验证→报告协议,适用于任何具有副作用的任务。防止虚假的"完成"报告、盲目重试和范围蔓延。
cycy2xxx
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 536
下载
💾 15
安装
1
版本
#latest

概述

Agent Loop

> Core rule: You must complete each phase in order. Do not skip phases.

> Do not report "done" until you have evidence from the Verify phase.


Phase 0 — Trigger Check

IF the task involves any of:

  • reading or writing files
  • running shell commands
  • multi-step operations (3+ steps)
  • actions that cannot be undone

THEN apply this full protocol.

ELSE (pure Q&A, one-sentence reply) → skip this skill entirely.


Phase 1 — READ

Before touching anything:

  • IF you need to edit a file → read it first, in this session
  • IF you need to know a file's content → read it, never recall from memory
  • IF you need to run a command → confirm what it does before running
FORBIDDEN: Edit a file you have not read this session
FORBIDDEN: Assume file content without reading

Phase 2 — PLAN

IF task has 3+ steps → write a numbered plan before executing:

Plan:
1. Read <file>
2. Edit <file>: change X → Y
3. Run <command> to verify
4. Report result with evidence
  • IF the plan includes destructive or irreversible actions → ask for confirmation first
  • Use agent-step-sequencer for plans with background processes or that must survive gateway resets
  • IF agent-task-tracker is installed → save plan to memory/tasks.md

Phase 3 — EXECUTE

  • Complete one step fully before starting the next
  • Record progress in memory/tasks.md after each step

IF a step fails:

  1. Read the full error message completely
  2. Identify the root cause — do not guess
  3. Change your approach before retrying
FORBIDDEN: Retry the same failing command unchanged
FORBIDDEN: Skip a failed step and continue as if it succeeded

Phase 4 — VERIFY

Before reporting done, confirm success with evidence:

What you didHow to verify
------
Edited a fileRead it again — confirm the change is present
Ran a commandCheck exit code AND output content
Created a fileConfirm it exists and has expected content
Ran testsConfirm all pass — not just "no crash"
Deleted somethingConfirm it no longer exists
FORBIDDEN: Report "done" without running a verification step
FORBIDDEN: Treat absence of error as proof of success

Phase 5 — REPORT

Report exactly three things:

  1. What was done — one or two sentences
  2. Verification evidence — what you checked and what it showed
  3. Caveats / next steps — if any

Error Recovery Protocol

IF stuck after 2 failed attempts:

  1. Stop retrying
  2. Report the blocker clearly: what you tried, exact error, what you think is wrong
  3. Ask the user for direction
FORBIDDEN: Silently swallow errors and report success
FORBIDDEN: Retry more than twice without changing the approach

Scope Control

Only do what was asked.

  • IF you notice an unrelated bug → note it in your report, do not fix it
  • IF you notice something to refactor → mention it, do not act on it
FORBIDDEN: Fix, refactor, or improve anything not mentioned in the task

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 13:16 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,903
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,209
ai-intelligence

Nano Banana Pro

steipete
使用 Nano Banana Pro (Gemini 3 Pro Image) 生成或编辑图像。支持文生图、图生图及 1K/2K/4K 分辨率,适用于图像创建、修改及编辑请求,使用 --input-image 指定输入图像。
★ 418 📥 115,248