Makes agent corrections persistent and reusable. When you override, reject, or correct an agent's output, this skill logs the correction and automatically injects it into future spawns of the same agent type. Solves "agent keeps making the same mistake across sessions." Installs correction-tracker lib + injection hook into agent-context-loader. Works standalone or alongside intent-engineering skill.
当你纠正一个代理时,该修正会在会话结束后消失。下次你生成同一类型的代理时,它会犯同样的错误。你教过它的内容没有任何记忆。
bash
cp references/correction-tracker-template.js $OPENCLAW_WORKSPACE/lib/correction-tracker.js
验证其运行:
bash
node $OPENCLAW_WORKSPACE/lib/correction-tracker.js
如果已安装 lib/agent-context-loader.js(来自意图工程技能),修正注入是自动的——无需连接。加载器在启动时检查 correction-tracker.js,如果存在则加载。
如果你没有使用意图工程,请手动将其添加到你的生成逻辑中:
javascript
const { buildCorrectionPreamble } = require(./lib/correction-tracker);
const agentType = CoderAgent; // 或你正在生成的任何代理
const corrections = buildCorrectionPreamble(agentType, workspaceRoot);
const fullTask = corrections ? corrections + \n\n---\n\n + originalTask : originalTask;
javascript
const { logCorrection } = require(./lib/correction-tracker);
logCorrection(
CoderAgent, // 代理类型
使用了 ESM import 而不是 require(), // 错误行为
始终对 Node.js 标准库模块使用 require(), // 正确行为
workspaceRoot,
{ session_channel: discord } // 可选元数据
);
只需告诉主代理:
注意 [AgentType]: [它做错了什么] — [正确行为]
主代理将以编程方式记录它。
在每次子代理生成时,agent-context-loader 从任务描述中检测代理类型,并添加前言:
以下修正已为 CoderAgent 记录。请应用这些行为:
仅注入最近 30 天内的修正。较旧的修正会自动过期——过时的规则不会累积。
bash
加载器从任务描述中自动检测代理类型。默认规则:
| 任务关键词 | 代理类型 |
|---|---|
| code, coder, impl, debug | CoderAgent |
| writ, author, novel, chapter |
要添加自定义代理类型,请编辑 agent-context-loader.js 中的 detectAgentType()。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 correction-memory-1776304996 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 correction-memory-1776304996 技能
skillhub install correction-memory-1776304996
文件大小: 5.94 KB | 发布时间: 2026-4-16 18:34