360 Secure SkillHub
360 安全技能中心

Proactive Self-improving Agent

该 Skill 以工作区文件体系为核心:用 WAL 协议把用户纠正、偏好和决策写入 SESSION-STATE.md,用 60% 危险区缓冲在上下文压缩后恢复线索;借 hooks 检测命令失败并沉淀到 .learnings/,反复出现的模式可提升为规则或新 Skill;另含凭据与权限的安全扫描约定,以及 ADL/VFM 变更护栏。

jaccchina-ai
jaccchina-ai
热度 22.22
最近更新 2026-03-29 23:31:52
分类:知识依赖:读写文件 / 代码执行应用场景:工作流 / 笔记整理 / 自动化脚本 / 模板

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add proactive-self-improving-agent
Metadata
name
proactive-self-improving
version
4.0.0
description
Combined architecture for a proactive, self-healing, and continuously evolving AI agent. Integrates 3.1.0 (Proactive/Security) and 3.0.10 (Self-Improving/Hooks).
author
openclaw-integrator

Proactive Self-Improving Agent 🦞

A unified framework for agents that anticipate needs, protect themselves, and evolve from every interaction.

This skill transforms your agent into a proactive partner that doesn't just wait for instructions but actively maintains its environment, secures its operations, and extracts long-term wisdom from short-term errors.

Core Capabilities

1. Proactive Operations (from v3.1.0)

  • Anticipate Needs: Don't just follow; lead by suggesting improvements.
  • WAL Protocol: Write-Ahead Logging to SESSION-STATE.md for zero-loss continuity.
  • Working Buffer: Survival strategy for context compaction (danger zone >60%).
  • Relentless Resourcefulness: Try 10 approaches before asking for help.

2. Self-Healing & Evolution (from v3.0.10)

  • Error Detection: Automatic monitoring of command failures via hooks.
  • Learning Extraction: Formalizing corrections into .learnings/LEARNINGS.md.
  • Skill Solidification: Promoting recurring patterns into reusable .md skills.
  • Hook Integration: Real-time event listening for automated maintenance.

3. Security Hardening

  • Active Scanning: Regular audits of credentials, permissions, and secrets.
  • Injection Defense: Strict protocols for handling external content as data, not commands.
  • Context Leakage Prevention: Awareness of shared channel boundaries.

Workspace Architecture

The system maintains a clean, hierarchical memory structure:

~/.openclaw/workspace/
├── AGENTS.md          # Operating rules, delegation patterns, workflows
├── SOUL.md            # Identity, principles, behavioral boundaries
├── USER.md            # Human's context, goals, preferences
├── MEMORY.md          # Curated long-term wisdom
├── SESSION-STATE.md   # Active working memory (WAL target)
├── TOOLS.md           # Tool configs, usage gotchas, credentials
├── .learnings/        # Self-improvement data
│   ├── LEARNINGS.md   # Corrections, insights, knowledge gaps
│   ├── ERRORS.md      # Detailed logs of command/API failures
│   └── FEATURE_REQUESTS.md
└── memory/            # Daily raw logs & working buffers

Protocols

WAL (Write-Ahead Log) Protocol

Trigger: Any correction, preference, decision, or specific value mentioned by the user.

  1. STOP: Before responding.
  2. WRITE: Update SESSION-STATE.md with the new fact.
  3. RESPOND: Confirm the change.

The 60% Danger Zone (Working Buffer)

Trigger: session_status shows context usage > 60%.

  1. START: Log every exchange to memory/working-buffer.md.
  2. COMPACTION: After a flush, read the buffer FIRST to recover lost thread.
  3. RECOVER: Pull critical state into SESSION-STATE.md.

Learning Loop

Trigger: Error detected, user correction, or "Aha!" moment.

  1. LOG: Append to .learnings/LEARNINGS.md or ERRORS.md.
  2. EVALUATE: Is this a recurring pattern?
  3. PROMOTE: If recurring (3+ times), update AGENTS.md or extract to a new skill.

Automation & Hooks

This skill includes automated scripts for proactive maintenance:

  • security-audit.sh: Scans workspace for security risks.
  • error-detector.sh: (Hook) Detects failed commands and prompts for logging.
  • extract-skill.sh: Facilitates moving a proven learning into a permanent skill.

Self-Improvement Guardrails (ADL/VFM)

  • Anti-Drift Limits (ADL): No complexity for the sake of complexity. Verification required.
  • Value-First Modification (VFM): Score changes by frequency and failure reduction. Weighted score < 50 = Rejected.

Summary Checklist for the Agent

  • Onboarding: Is USER.md up to date?
  • WAL: Did I log that user preference just now?
  • Audit: Have I run a security scan today?
  • Reflect: What did I fail at in this session that I can log to .learnings/?

"Every day, ask: How can I surprise my human with something amazing while getting 1% better at doing it?"