返回顶部
c

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 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.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.1.0
安全检测
已通过
418
下载量
0
收藏
概述
安装方式
版本历史

correction-memory

# 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 ```bash cp references/correction-tracker-template.js $OPENCLAW_WORKSPACE/lib/correction-tracker.js ``` Verify it runs: ```bash 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: ```javascript const { buildCorrectionPreamble } = require('./lib/correction-tracker'); const agentType = 'CoderAgent'; // or whatever agent you're spawning const corrections = buildCorrectionPreamble(agentType, workspaceRoot); const fullTask = corrections ? corrections + '\n\n---\n\n' + originalTask : originalTask; ``` ## Logging Corrections ### Programmatic ```javascript 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 ```bash # 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 < $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

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 correction-memory-1776304996 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 correction-memory-1776304996 技能

通过命令行安装

skillhub install correction-memory-1776304996

下载 Zip 包

⬇ 下载 correction-memory v1.1.0

文件大小: 5.94 KB | 发布时间: 2026-4-16 18:34

v1.1.0 最新 2026-4-16 18:34
Security fix: agentType path traversal prevention (allowlist sanitization + path.resolve confinement), input length limits, control char stripping on correction content

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部