← Back to Skills Marketplace
haiqingge

Self Improving Agent

by haiqingge · GitHub ↗ · v2.0.0 · MIT-0
cross-platform ⚠ suspicious
71
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install haiqing-self-improving-agent
Description
AI Self-Improving Agent v2 - Learn from mistakes, corrections, and successes. Three-layer system: passive capture + proactive check + proactive skill generat...
README (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)

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install haiqing-self-improving-agent
  3. After installation, invoke the skill by name or use /haiqing-self-improving-agent
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug haiqing-self-improving-agent
Version 2.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Self Improving Agent?

AI Self-Improving Agent v2 - Learn from mistakes, corrections, and successes. Three-layer system: passive capture + proactive check + proactive skill generat... It is an AI Agent Skill for Claude Code / OpenClaw, with 71 downloads so far.

How do I install Self Improving Agent?

Run "/install haiqing-self-improving-agent" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Self Improving Agent free?

Yes, Self Improving Agent is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Self Improving Agent support?

Self Improving Agent is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Self Improving Agent?

It is built and maintained by haiqingge (@haiqingge); the current version is v2.0.0.

💬 Comments