← 返回 Skills 市场
donovanpankratz-del

Correction Memory

作者 dp-del · GitHub ↗ · v1.1.0
cross-platform ✓ 安全检测通过
497
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install correction-memory
功能描述
Makes agent corrections persistent and reusable. When you override, reject, or correct an agent's output, this skill logs the correction and automatically in...
使用说明 (SKILL.md)

Correction Memory

The Problem

When you correct an agent, that correction evaporates after the session. Next time you spawn the same agent type, it makes the same mistake. There's no memory of what you've already taught it.

What This Skill Installs

  • lib/correction-tracker.js — logs corrections per agent type to memory/corrections/[AgentType].jsonl
  • Hook into agent-context-loader.js — correction preamble prepended to spawns automatically (if intent-engineering is also installed)

Installation

Step 1 — Install correction-tracker

cp references/correction-tracker-template.js $OPENCLAW_WORKSPACE/lib/correction-tracker.js

Verify it runs:

node $OPENCLAW_WORKSPACE/lib/correction-tracker.js

Step 2 — Wire agent-context-loader (if using intent-engineering)

If lib/agent-context-loader.js is installed (from intent-engineering skill), correction injection is automatic — no wiring needed. The loader checks for correction-tracker.js at startup and loads it if present.

If you are NOT using intent-engineering, add this to your spawn logic manually:

const { buildCorrectionPreamble } = require('./lib/correction-tracker');

const agentType   = 'CoderAgent'; // or whatever agent you're spawning
const corrections = buildCorrectionPreamble(agentType, workspaceRoot);
const fullTask    = corrections ? corrections + '\
\
---\
\
' + originalTask : originalTask;

Logging Corrections

Programmatic

const { logCorrection } = require('./lib/correction-tracker');

logCorrection(
  'CoderAgent',                                    // agent type
  'Used ESM import instead of require()',          // what was wrong
  'Always use require() for Node.js stdlib modules', // correct behavior
  workspaceRoot,
  { session_channel: 'discord' }                  // optional metadata
);

Via main agent (natural language)

Just tell the main agent:

"Note that [AgentType]: [what it did wrong] — [correct behavior]"

The main agent will log it programmatically.

How Corrections Are Replayed

On every subagent spawn, agent-context-loader detects the agent type from the task description and prepends:

## Corrections from Previous Sessions

The following corrections were logged for CoderAgent. Apply these behaviors:

1. **[2026-03-01] Issue:** Used ESM import instead of require()
   **Correction:** Always use require() for Node.js stdlib modules

Only corrections from the last 30 days are injected. Older corrections expire automatically — stale rules don't accumulate.

Viewing Corrections

# All corrections for an agent type
cat $OPENCLAW_WORKSPACE/memory/corrections/CoderAgent.jsonl | jq .

# List all agent types with corrections
ls $OPENCLAW_WORKSPACE/memory/corrections/

# Count corrections per agent
for f in $OPENCLAW_WORKSPACE/memory/corrections/*.jsonl; do
  echo "$(basename $f .jsonl): $(wc -l \x3C $f) corrections"
done

Agent Type Detection

The loader auto-detects agent type from the task description. Default rules:

Task keywords Agent type
code, coder, impl, debug CoderAgent
writ, author, novel, chapter AuthorAgent
world, build WorldbuilderAgent
(anything else) general

To add custom agent types, edit detectAgentType() in agent-context-loader.js.

References

  • references/correction-tracker-template.js — Full implementation of correction-tracker.js
安全使用建议
This skill appears to do exactly what it says: store human corrections under $OPENCLAW_WORKSPACE/memory/corrections and prepend recent corrections to future agent prompts. Before installing: 1) Inspect the template file (already included) and confirm you’re comfortable with storing corrections as plain text under memory/corrections; corrections are free text and could include sensitive info if you or agents log it. 2) Confirm $OPENCLAW_WORKSPACE points to the intended workspace and check file permissions so other processes/users can't read the corrections if that’s a concern. 3) Be aware that if you also use an intent-engineering/agent-context-loader module, this file will be auto-loaded and will change spawn behavior across sessions. 4) The module’s smoke test creates a temp directory when run directly — that’s benign but expected. If you want additional assurance, run the smoke test in a safe environment and review memory/corrections files after creating a few test corrections.
功能分析
Type: OpenClaw Skill Name: correction-memory Version: 1.1.0 The skill's purpose is to persist agent corrections, and its implementation demonstrates strong security practices. The `correction-tracker-template.js` file includes robust input sanitization for agent types and content, explicitly preventing path traversal and injection vulnerabilities. File operations are confined to the designated `memory/corrections` directory within the workspace. The `SKILL.md` instructions are straightforward, and the verification step executes the local, reviewed JavaScript file in a temporary, self-cleaning environment. There is no evidence of data exfiltration, malicious execution, persistence mechanisms, or prompt injection attempts within the skill's own content or instructions.
能力评估
Purpose & Capability
Name/description match what is provided: an instruction-only skill plus a local JS module that logs corrections to workspace/memory/corrections/[AgentType].jsonl and builds a preamble for injection. No unrelated env vars, binaries, or remote installs are requested.
Instruction Scope
SKILL.md limits actions to copying the included template into $OPENCLAW_WORKSPACE/lib, optionally wiring it into spawn logic, and inspecting files under memory/corrections. It does not instruct reading other system files, exfiltrating data, or calling external endpoints.
Install Mechanism
No network downloads or package installs. The install is a local copy of the included template file into the workspace (cp), which is low risk and consistent with the described behavior. Running the module triggers a harmless smoke test that writes to a temp dir.
Credentials
The skill requests no environment variables, credentials, or config paths. It requires a workspaceRoot argument to operate (used to place/read files under memory/corrections), which is appropriate for the stated functionality.
Persistence & Privilege
The skill is not always-enabled and does not request elevated privileges. If present, agent-context-loader (from another skill) may auto-load correction-tracker.js and prepend corrections to spawned agent prompts — intended behavior but worth noting because it changes agent spawn context across sessions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install correction-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /correction-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Security fix: agentType path traversal prevention (allowlist sanitization + path.resolve confinement), input length limits, control char stripping on correction content
v1.0.0
- Introduces persistent correction memory for agents by logging corrections and injecting them into future agent spawns. - Automatically logs and replays corrections per agent type, ensuring improved behavior across sessions. - Installs a correction tracker and integrates with agent-context-loader (intent-engineering compatible). - Only corrections from the last 30 days are applied; older rules expire automatically. - Supports both programmatic correction logging and natural language corrections via the main agent. - Includes tools for viewing and managing logged corrections for each agent type.
元数据
Slug correction-memory
版本 1.1.0
许可证
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Correction Memory 是什么?

Makes agent corrections persistent and reusable. When you override, reject, or correct an agent's output, this skill logs the correction and automatically in... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 497 次。

如何安装 Correction Memory?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install correction-memory」即可一键安装,无需额外配置。

Correction Memory 是免费的吗?

是的,Correction Memory 完全免费(开源免费),可自由下载、安装和使用。

Correction Memory 支持哪些平台?

Correction Memory 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Correction Memory?

由 dp-del(@donovanpankratz-del)开发并维护,当前版本 v1.1.0。

💬 留言讨论