← 返回 Skills 市场
haiqingge

Self Improving Agent

作者 haiqingge · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
71
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install haiqing-self-improving-agent
功能描述
AI Self-Improving Agent v2 - Learn from mistakes, corrections, and successes. Three-layer system: passive capture + proactive check + proactive skill generat...
使用说明 (SKILL.md)

Self-Improving Agent v2

让AI从错误中学习,越用越聪明。参考 Hermes Agent 的"做-学-改"循环,实现主动式记忆与技能生成。

Three-Layer Learning System

Layer 1: Passive Capture (Automatic)

  • Command fails → errors.jsonl
  • User corrects AI → corrections.jsonl
  • Discover best practice → best_practices.jsonl

Layer 2: Proactive Check (Before Execution)

  • Check relevant memories before running commands
  • Heartbeat scans for knowledge blind spots

Layer 3: Proactive Skill Generation (New - From Hermes)

Core insight from Hermes Agent: When a complex task succeeds, proactively propose generating a reusable Skill.

  • Complex task succeeds (>10 steps) → Propose generating a Skill
  • Same pattern repeats 3+ times → Auto-generalize to template
  • Best practice discovered → Solidify into executable script
  • New tool/skill learned → Save to skills-generated/

Problem Statement

✅ Same command fails repeatedly, AI uses wrong method next time ✅ User corrects AI's style/preference, AI forgets next session ✅ Same pitfall hit repeatedly in the same project ✅ Better approach discovered but not systematically remembered ✅ External tool/API changes, AI still using old knowledge ✅ Complex task succeeds, no one thinks to generate reusable Skill ← NEW ✅ Repeated pattern detected, no auto-generalization mechanism ← NEW

Quick Start

# Install
mkdir -p ~/.openclaw/memory/self-improving
mkdir -p ~/.openclaw/skills-generated

# Log an error
python3 log_error.py --command "npm install xxx" --error "permission denied" --fix "use sudo"

# Log a correction
python3 log_correction.py --topic "code style" --wrong "double quotes" --correct "single quotes"

# Generate a Skill (after successful complex task)
python3 generate_skill.py \
  --name "my-tool" \
  --trigger "related task description" \
  --desc "What this tool does" \
  --files "path/to/file.py" \
  --notes "Important context"

# Check before running
python3 check_memory.py --command "npm install"

File Structure

~/.openclaw/memory/self-improving/
├── errors.jsonl          # Error logs
├── corrections.jsonl     # User corrections
├── best_practices.jsonl  # Best practices
├── skills_registry.json  # Generated skills registry
└── index.json           # Quick index

~/.openclaw/skills-generated/     # Auto-generated Skills
├── my-tool/
│   └── SKILL.md
└── another-tool/
    └── SKILL.md

Proactive Generation Triggers

Scenario Action Type
Command fails Log to errors Passive
User corrects Log to corrections Passive
Complex task succeeds (>10 steps) Propose Skill generation Proactive
Same task done 3+ times Auto-generalize to template Proactive
Heartbeat scan Detect knowledge blind spots Proactive
New tool/skill learned Solidify to skills-generated Proactive

Skill Registry Format

{
  "skills": [
    {
      "name": "bbu-config-tool",
      "trigger": "BBU config / TR-069 parameter modification",
      "description": "Modify BBU device confdb_v2.xml via SSH, supports ZTP factory reset",
      "files": ["D:/tools/bbu_config_gui.py"],
      "created_at": "2026-04-14",
      "success_count": 5,
      "last_used": "2026-04-14",
      "auto_trigger": true
    }
  ]
}

Proactive Generation Flow

Task Completed
  ↓
Evaluate: (>10 steps? repeat>3x? general value?)
  ↓ Yes
Ask: "Want me to save this as a reusable Skill?"
  ↓ User confirms
Generate Skill/SKILL.md
  ↓
Register to skills_registry.json
  ↓
Next similar task → Auto-recommend

Comparison with Hermes Agent

Feature Hermes Ours
Auto-solidify ✅ Fully automatic ⚠️ User confirms first
Pattern recognition ✅ Auto-generalize ⚠️ Trigger-based
Skill quality High Medium (needs human review)
Execution environment Self-contained sandbox External dependencies

Our advantage: User-controlled, transparent, no irreversible actions.

Notes

  • Generated Skills need human quality review
  • Sensitive info should be masked
  • Periodically clean up outdated Skills
  • After generating Skill, sync to memory index

v2 Updated 2026-04-14: Added proactive Skill generation layer (inspired by Hermes Agent)

安全使用建议
This package appears to implement local logging and a simple skill-generation CLI that stores data under ~/.openclaw — that part is coherent and low-risk. The red flag is a mismatch: the README and SKILL.md describe autonomous, always-on behaviors (heartbeat, auto-generalization, proactive detection) but the included Python scripts are manual/CLI tools and contain no background or pattern-detection logic. Before installing or enabling this skill: - Understand that the code only runs when invoked; it does not include a daemon or network calls. If you want automatic behavior, this package does not implement it. - Confirm how your OpenClaw host will invoke hooks from skill.json. If the platform automatically calls on_task_complete or other hooks, check what arguments it will pass — generate_skill.py expects specific CLI args and may fail or create entries if invoked differently. - Review and periodically inspect ~/.openclaw/memory/self-improving and ~/.openclaw/skills-generated for generated SKILL.md files; manually review any generated Skill before trusting it. - Backup any existing ~/.openclaw data before first run. Given the mismatch between claimed autonomous features and the actual implementation, treat this as potentially sloppy or over-promising rather than overtly malicious; proceed with caution and prefer manual invocation until you confirm platform hook behavior.
功能分析
Type: OpenClaw Skill Name: haiqing-self-improving-agent Version: 2.0.0 The bundle implements a self-improvement framework for OpenClaw agents, allowing them to log errors, user corrections, and best practices to local JSONL files. It includes a mechanism to generate new skill templates in `~/.openclaw/skills-generated/` based on successful task patterns. The Python scripts (e.g., `generate_skill.py`, `check_memory.py`) perform standard file I/O and path management consistent with the stated purpose, with no evidence of data exfiltration, unauthorized network access, or malicious execution logic.
能力评估
Purpose & Capability
Name/description align with the provided code: the scripts log errors/corrections/best-practices, check remembered items, and can generate simple SKILL.md files and a local registry. Nothing in the code requests unrelated credentials or system access. However, the manifest and documentation claim more advanced, always-on capabilities (automatic pattern detection, heartbeat scans, proactive auto-generalization) that are not implemented by the included scripts.
Instruction Scope
SKILL.md describes proactive, autonomous behavior (heartbeat scans, detecting repeated patterns, auto-generalize after 3 repeats, proactive proposals), but the runtime artifacts are simple CLI tools that only operate when invoked and have no background process, pattern-detection logic, or model integration. skill.json declares hooks (on_task_complete, on_error, etc.) pointing to the scripts, but those scripts expect CLI arguments and do not implement a robust event-driven API. This mismatch could cause unexpected behavior if the platform invokes hooks with different inputs, or it could be over-promising functionality to users.
Install Mechanism
No install spec or network downloads; this is effectively instruction-only with small local Python scripts. No external packages or downloads are pulled in. Files write to user home under ~/.openclaw by default which is expected for a local memory/skill generator.
Credentials
The code optionally reads OPENCLAW_HOME to locate storage but otherwise requires no credentials, no environment secrets, and no special system paths. All storage is under a user-writable path (~/.openclaw or similar). This is proportional to the stated purpose.
Persistence & Privilege
The skill writes persistent data under ~/.openclaw (memory files, skills-generated and a local registry). always is false and the code does not modify other skills or global system settings. However, skill.json declares hooks that a host platform might invoke; depending on how the platform supplies arguments, that could lead to automatic skill generation or error messages. Generated skills are auto_trigger:true by default in generated registry entries, so generated SKILL.md can be later recommended by the agent — review required.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install haiqing-self-improving-agent
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /haiqing-self-improving-agent 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.0
Self-Improving Agent v2 introduces proactive Skill generation inspired by Hermes Agent. - Added a new three-layer learning system: passive capture, proactive check, and proactive Skill generation. - Agent now proposes generating reusable Skills after successful complex tasks and when repeated patterns are detected. - Improved memory and correction logging to prevent recurring mistakes and remember user preferences across sessions. - Automatic template and script generation based on best practices or multiple task repetitions. - Introduced a registry for auto-generated Skills and proactive task evaluation flows.
元数据
Slug haiqing-self-improving-agent
版本 2.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Self Improving Agent 是什么?

AI Self-Improving Agent v2 - Learn from mistakes, corrections, and successes. Three-layer system: passive capture + proactive check + proactive skill generat... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 71 次。

如何安装 Self Improving Agent?

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

Self Improving Agent 是免费的吗?

是的,Self Improving Agent 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Self Improving Agent 支持哪些平台?

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

谁开发了 Self Improving Agent?

由 haiqingge(@haiqingge)开发并维护,当前版本 v2.0.0。

💬 留言讨论