360 Secure SkillHub
360 安全技能中心

Self Improving Agent.Bak

该 Skill 用于持续改进:在命令失败、用户纠正、功能请求、知识过时或发现更优做法时,将条目写入 .learnings 下的 LEARNINGS.md、ERRORS.md、FEATURE_REQUESTS.md,支持标记状态、检测重复模式、提升到工作区文件,并将成熟经验抽取为新的 Skill。

robertstarry-gif
robertstarry-gif
热度 50.38
最近更新 2026-05-11 17:43:10
分类:知识依赖:读写文件 / 代码执行应用场景:笔记整理 / 工作流 / 任务管理

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add self-improving-agent-bak
Metadata
name
self-improvement
description
Captures learnings, errors, and corrections for continuous improvement. Use when: (1) a command fails, (2) user corrects you, (3) user requests a missing capability, (4) an API/tool fails, (5) knowledge is outdated, (6) a better approach is found. Also review learnings before major tasks.
metadata
null

Self-Improvement Skill

Log learnings to .learnings/ for continuous improvement. Promote broadly applicable entries to workspace files.

Setup

mkdir -p ~/.openclaw/workspace/.learnings

Create three log files: LEARNINGS.md · ERRORS.md · FEATURE_REQUESTS.md

Routing Table

Situation File Category
Command/operation fails ERRORS.md —
User corrects you LEARNINGS.md correction
Missing capability requested FEATURE_REQUESTS.md —
Knowledge was outdated LEARNINGS.md knowledge_gap
Found better approach LEARNINGS.md best_practice
Recurring pattern (simplify-and-harden) LEARNINGS.md Source: simplify-and-harden + Pattern-Key

Promotion Targets

Learning Type Promote To
Behavioral patterns SOUL.md
Workflow improvements AGENTS.md
Tool gotchas TOOLS.md
Project facts / conventions CLAUDE.md

Promote when: applies across multiple files, prevents recurring mistakes, or any contributor should know it.

Log Formats

LEARNINGS.md entry

## [LRN-YYYYMMDD-XXX] category
**Logged**: ISO-8601  **Priority**: low|medium|high|critical  **Status**: pending  **Area**: frontend|backend|infra|tests|docs|config

### Summary
One-line description

### Details
What happened, what was wrong, what's correct

### Suggested Action
Specific fix or improvement

### Metadata
- Source: conversation|error|user_feedback
- Related Files:
- Tags:
- See Also: (if related entry exists)
- Pattern-Key: (optional, for recurring patterns)
- Recurrence-Count: 1
---

ERRORS.md entry

## [ERR-YYYYMMDD-XXX] command_name
**Logged**: ISO-8601  **Priority**: high  **Status**: pending  **Area**: …

### Summary / Error / Context / Suggested Fix
### Metadata
- Reproducible: yes|no|unknown
- See Also:
---

FEATURE_REQUESTS.md entry

## [FEAT-YYYYMMDD-XXX] capability_name
**Logged**: ISO-8601  **Priority**: medium  **Status**: pending  **Area**: …

### Requested Capability / User Context / Complexity Estimate / Suggested Implementation
### Metadata
- Frequency: first_time|recurring
---

Resolving Entries

Change **Status**: pending → resolved | in_progress | wont_fix | promoted, then add:

### Resolution
- **Resolved**: ISO-8601
- **Notes**: what was done

Recurring Pattern Detection

  1. Search first: grep -r "keyword" .learnings/
  2. If similar entry exists: increment Recurrence-Count, update Last-Seen, add See Also
  3. Promote to system prompt files when: Recurrence-Count >= 3 + seen in 2+ tasks + within 30 days

Periodic Review

grep -h "Status\*\*: pending" .learnings/*.md | wc -l          # count pending
grep -B5 "Priority\*\*: high" .learnings/*.md | grep "^## \["  # list high-priority

Review before major tasks, after completing features, or weekly during active development.

Detection Triggers

  • Correction: "No, that's wrong…" / "Actually…" → LEARNINGS.md correction
  • Feature request: "Can you also…" / "I wish you could…" → FEATURE_REQUESTS.md
  • Knowledge gap: user provides info you didn't know → LEARNINGS.md knowledge_gap
  • Error: non-zero exit / exception / timeout → ERRORS.md

Skill Extraction

Extract a learning into a reusable skill when: recurring (2+ See Also links) + resolved + non-obvious + broadly applicable.

./skills/self-improvement/scripts/extract-skill.sh skill-name

Or manually: create skills/<name>/SKILL.md with YAML frontmatter (name, description).

Priority / Area Reference

Priority: critical (blocks core / data loss) · high (common workflow) · medium (workaround exists) · low (edge case)

Area: frontend · backend · infra · tests · docs · config