Self-Improving Agent for Openclaw

A three-tier evolution system for AI agents that automatically captures errors, distills experience, and promotes recurring knowledge into permanent skills.

lorinwei
v1.0.0
Apr 11, 2026
0
682
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install lorin-self-evolving-agent

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install lorin-self-evolving-agent using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Self-Improving Agent?

The Self-Improving Agent is a comprehensive framework designed to transform every mistake and successful workflow into a reusable asset. By combining automated hooks, active distillation, and a structured promotion system, this skill ensures that an AI agent never repeats the same error twice and continuously refines its operational efficiency.

Inspired by advanced agentic management protocols, it implements a three-layer architecture: automatic error detection (Hooks), proactive experience extraction (Skills), and systematic knowledge promotion (Soul/Tools). This allows the agent to build a persistent memory that scales across different tasks and environments, making it a cornerstone of the Openclaw Skills ecosystem.

Self-Improving Agent Use Cases

  • Automating the recording of CLI command failures and debugging steps for future reference.
  • Distilling complex multi-step workflows into standardized procedural skills.
  • Capturing specific environment configurations and project-specific quirks to prevent regression.
  • Managing a lifecycle of continuous learning through recurring error analysis and knowledge promotion.

How Self-Improving Agent Works

  1. Automatic Capture: Shell hooks detect non-zero exit codes or error patterns in tool outputs and log them to specialized markdown files.
  2. Active Distillation: The agent evaluates successful complex tasks or user corrections to determine if a new skill should be created.
  3. Skill Creation: If the criteria are met, the agent generates a structured SKILL.md file containing procedures, triggers, and pitfalls.
  4. Systematic Promotion: Frequently recurring learnings (3+ times) are promoted from local skill files to system-level documents like SOUL.md or TOOLS.md.
  5. Periodic Review: The system triggers regular reviews of pending learnings to clean up old data or upgrade validated solutions.

Self-Improving Agent Setup

To enable the automatic error detection and self-improvement hooks, run the following commands in your terminal:

# Copy hooks to the Openclaw directory
cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement

# Enable the self-improvement hooks
openclaw hooks enable self-improvement

# (Optional) Run the extraction script to test skill distillation
./scripts/extract-skill.sh <skill-name> --dry-run

Self-Improving Agent Data Schema & Taxonomy

The skill manages information through a structured directory in .learnings/ and the Openclaw workspace:

File Type Purpose Taxonomy/ID
ERRORS.md Tracks command and tool failures ERR-YYYYMMDD-XXX
LEARNINGS.md Stores general distilled experiences LRN-YYYYMMDD-XXX
FEATURE_REQUESTS.md Records desired agent capabilities FEAT-YYYYMMDD-XXX
SKILL.md Standardized reusable skill definition Semantic Naming (e.g., mysql_connect_prod)

Data is organized by area (frontend, backend, infra) and priority (low to critical).

Self-Improving Agent Advanced Features

  • Automated Error Hooking: Real-time monitoring of bash outputs via error-detector.sh to catch failures as they happen.
  • Decision Tree Logic: Intelligent filtering to ensure only non-obvious, recurring, and verified workflows are turned into skills.
  • Three-Tier Promotion System: Moves knowledge from temporary logs to project-level memory and finally to global agent personality files.
  • Skill Extraction Scripts: CLI tools to automate the migration of verified learnings into the Openclaw Skills directory structure.
  • Forgetfulness Prevention: Implements a review cycle to ensure high-priority knowledge is promoted before it is buried by newer logs.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*