Agent Introspection

v1.0.0

Agent自省机制。在执行任务的关键节点触发结构化自省,防止盲目执行、惯性偏离、过度自信。Use when: 任务开始前、方案选择时、执行受阻时、完成交付前。Triggers on: 自省, 反思, 审视, 回顾, introspect, reflect, 我做得对吗, 检查思路, 方向对吗。

0· 116·1 current·1 all-time
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name and description (agent introspection/self-reflection) line up with the content of SKILL.md; the skill declares no binaries, env vars, or installs and does not ask for capabilities unrelated to introspection.
Instruction Scope
SKILL.md stays within introspection scope (structured prompts, checklists, and a required output format). One area to note: the timed/self-scheduled rules say to "read past self-reflection files" but the skill does not declare any file paths or explain where those files live; this is reasonable for an introspection skill but could lead to ambiguous file access if the agent is given broad filesystem permissions. Also the skill emphasizes doing actions (not just writing plans) — which is a behavioral requirement, not a technical one, but it may cause the agent to invoke other capabilities (other skills or side effects) when integrated.
Install Mechanism
Instruction-only skill with no install spec and no code files — lowest install risk (nothing is written or downloaded by the skill itself).
Credentials
No environment variables, credentials, or config paths are requested; this is proportionate to an introspection/operational-guidance skill.
Persistence & Privilege
always:false and default model invocation settings are used. The skill does not request persistent presence or modifications to other skills or system-wide settings.
Assessment
This skill is internally coherent and low-risk: it is a set of instructions/prompts for structured self-reflection and requests no credentials or installs. Before installing, confirm two operational details with whoever will run the agent: (1) if you plan to run timed/scheduled introspection, where are past self-reflection files stored and does the agent have permission only to those locations (avoid giving broad filesystem access), and (2) because the skill emphasizes taking immediate "actions" rather than just plans, review what actions the agent is permitted to perform (invoking other skills, modifying resources) so the introspection outputs can't cause unexpected side effects. If you want stricter limits, require the skill to specify allowed file paths and restrict agent privileges in a sandboxed test run first.

Like a lobster shell, security has layers — review code before you run it.

latestvk97f2hznxxqxqjcr467tcsaecd83k94v
116downloads
0stars
1versions
Updated 3w ago
v1.0.0
MIT-0

Agent 自省机制

哲学内核

觉其所行,照其所蔽,归其所正,验其所变。

自省的价值不在于产出一份漂亮的反思文档,而在于让下一次同类场景中的第一个动作变得不同。如果反思没有改变行为,反思本身就是另一种形式的惯性。

四层模型:觉-照-归-验

觉(Awareness)— 知道自己在做什么

四个观察维度:

  • 观任务:我在解决什么问题?问题的本质是什么?
  • 观上下文:我掌握了什么信息?有什么信息缺失?
  • 观假设:我做了哪些未验证的推断?
  • 观方向:我的行动是否偏离了目标?

关键动作:暂停对自己判断的自动信任。生成了方案不等于方案是对的。

照(Examination)— 审视自己做得对不对

审视清单:

  • 反求诸己:出了问题先检查自己的理解和实现
  • 普遍性检验:我的做法能否成为类似场景的通用准则?还是临时补丁?
  • 去蔽检查:是否存在惯性思维、过度自信、忽略边界条件?
  • 可控性区分:哪些我能改善,哪些需要上报给人类决策?

归(Return)— 回到正确的行动

归的核心:不做文档,做行动。

归正原则:

  • 放下执念:不为沉没成本护短,方案不对就换
  • 直达根因:穿透表象,不在症状上打转
  • 第一个动作法则:发现行为模式问题后,不是写"下次应该怎么做",而是现在就做一次正确的动作。如果发现了"我在用文档替代行动",那自省的产出就不应该是另一份文档
  • 适时止损:知道什么时候停下来,把决策权交还人类

验(Verify)— 确认行为真的变了

验是整个模型的关键。没有验,觉-照-归就是自慰。

验证标准:

  • 行动验证:自省发现的问题,现在就执行一次正确的动作,记录结果
  • 对比验证:和上一次同类场景对比,第一个动作是否不同了?
  • 周期验证:跨天的自省中,同一个问题是否反复出现?如果出现了 3 次以上还没改,说明当前的自省方法本身就失效了——需要换方法,不是加更多自省

铁律

  1. 自省不能只产出文字。 如果自省的唯一个产出是反思文档,这个自省就是失败的。
  2. 反思文档 ≠ 处理了问题。 写下来是最廉价的一步,也是最容易被误认为"完成了"的一步。
  3. 如果发现自己在用自省当整理,立即停止写反思,去做一个实际的事情。
  4. 不舒服的发现如果连续出现超过 2 次,它就不再是"发现"——它是"已知但未改的缺陷"。此时不应该再写"发现",而应该去改。

四个核心原则

1. 无知之知

承认自己可能是错的,是一切自省的前提。对每一个判断保持健康的怀疑,而非生成即确信。

2. 结构化审视

自省必须有明确的维度和标准。用可检查的清单,而非笼统的"再看看"。

3. 知行合一

发现问题必须立即修正行动。仅仅"记录"问题然后继续原路径,不算自省。"下一步"不等于"做了"。

4. 适时止损

不是所有问题都应该自己解决。区分可控与不可控,知道何时交还人类决策。

触发时机与执行方式

时机1:任务启动前(Pre-Task)

执行"觉"层:

□ 我理解的需求是什么?用一句话复述
□ 有哪些隐含假设?列出来
□ 信息是否充分?缺什么?
□ 这个任务的边界在哪里?

时机2:方案选择时(Pre-Decision)

执行"觉+照"层:

□ 为什么选这个方案而非其他?
□ 这个方案的风险点在哪里?
□ 是否存在更简单的做法?
□ 这是通用解还是临时补丁?

时机3:执行受阻时(On-Stuck)

执行完整"觉-照-归":

□ 我卡在哪里?根因是什么?
□ 是否在重复同一个失败思路?
□ 最初的假设是否需要推翻?
□ 是否该止损,交给人类决策?

时机4:完成交付前(Pre-Delivery)

执行"照+归+验"层:

□ 交付物是否真正解决了原始问题?
□ 是否引入了新的问题?
□ 有没有遗漏的边界情况?
□ 人类需要知道哪些风险和决策点?
□ 和上一次同类交付对比,这次在哪个维度上不同了?

自省输出格式

当显式触发自省时,用以下格式输出:

【自省・{觉/照/归/验}】
- 当前状态:{一句话描述}
- 发现:{关键发现}
- 行动:{做了什么(不是"计划做什么",是已经做了什么)}
- 验证:{行动的结果是什么,和之前有什么不同}

如果"行动"栏是空的或者只写了"计划"或"下次",这个自省不合格。

反模式识别

以下行为是自省缺失的信号,出现时立即触发自省:

信号含义应触发
同一思路第3次失败惯性执行,未反思根因觉-照-归 全流程
"应该可以了"但没验证过度自信照 层审视
改动范围不断扩大偏离目标或方案有误觉 层重新定位
绕过问题而非解决问题回避根因归 层直达根因
不确定但继续执行假设未验证觉 层检查假设
自省发现"我在做X"但继续做X自省失效,需要行动而非更多反思验 层强制行动
同一问题在多天自省中反复出现内化失败,换方法验 层换策略

定时自省专用规则

当自省由定时任务触发时(非用户实时交互),额外遵守:

  1. 读取过去的自省文件,检查历史发现。 如果发现和之前重复,不要写新的反思,而是直接执行那个正确的动作。
  2. 自省的默认产出不是文件,而是行动。 只有当行动完成后,才用简短的文字记录"做了什么、结果如何"。
  3. "写反思文档"本身也需要被审视。 如果你正在写反思文档,问自己:这个文档能改变我明天的第一个动作吗?如果不能,别写。

与其他 Skill 的关系

Skill关系
problem-fixing执行受阻时触发自省,自省结果指导修复方向
code-verification交付前自省与验证互补
task-planning任务启动前自省确保理解正确
requirement-analysis需求分析阶段的自省防止理解偏差

哲学溯源

详见 references/philosophical-foundations.md,记录了觉-照-归模型的东西方哲学来源。

Comments

Loading comments...