Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install self-improving-agent或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install self-improving-agent⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/self-improving-agent/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: self-improvement description: "Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Claude ('No, that's wrong...', 'Actually...'), (3) User requests a capability that doesn't exist, (4) An external API or tool fails, (5) Claude realizes its knowledge is outdated or incorrect, (6) A better approach is discovered for a recurring task. Also review learnings before major tasks." metadata: ---
Log learnings and errors to markdown files for continuous improvement. Coding agents can later process these into fixes, and important learnings get promoted to project memory.
Before logging anything, ensure the .learnings/ directory and files exist in the project or workspace root. If any are missing, create them:
mkdir -p .learnings
[ -f .learnings/LEARNINGS.md ] || printf "# Learnings\n\nCorrections, insights, and knowledge gaps captured during development.\n\n**Categories**: correction | insight | knowledge_gap | best_practice\n\n---\n" > .learnings/LEARNINGS.md
[ -f .learnings/ERRORS.md ] || printf "# Errors\n\nCommand failures and integration errors.\n\n---\n" > .learnings/ERRORS.md
[ -f .learnings/FEATURE_REQUESTS.md ] || printf "# Feature Requests\n\nCapabilities requested by the user.\n\n---\n" > .learnings/FEATURE_REQUESTS.md
Never overwrite existing files. This is a no-op if .learnings/ is already initialised.
Do not log secrets, tokens, private keys, environment variables, or full source/config files unless the user explicitly asks for that level of detail. Prefer short summaries or redacted excerpts over raw command output or full transcripts.
If you want automatic reminders or setup assistance, use the opt-in hook workflow described in Hook Integration.
| Situation | Action | |-----------|--------| | Command/operation fails | Log to .learnings/ERRORS.md | | User corrects you | Log to .learnings/LEARNINGS.md with category correction | | User wants missing feature | Log to .learnings/FEATURE_REQUESTS.md | | API/external tool fails | Log to .learnings/ERRORS.md with integration details | | Knowledge was outdated | Log to .learnings/LEARNINGS.md with category knowledge_gap | | Found better approach | Log to .learnings/LEARNINGS.md with category best_practice | | Simplify/Harden recurring patterns | Log/update .learnings/LEARNINGS.md with Source: simplify-and-harden and a stable Pattern-Key | | Similar to existing entry | Link with See Also, consider priority bump | | Broadly applicable learning | Promote to CLAUDE.md, AGENTS.md, and/or .github/copilot-instructions.md | | Workflow improvements | Promote to AGENTS.md (OpenClaw workspace) | | Tool gotchas | Promote to TOOLS.md (OpenClaw workspace) | | Behavioral patterns | Promote to SOUL.md (OpenClaw workspace) |
OpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.
Via ClawdHub (recommended):
clawdhub install self-improving-agent
Manual:
git clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent
Remade for openclaw from original repo : https://github.com/pskoett/pskoett-ai-skills - https://github.com/pskoett/pskoett-ai-skills/tree/main/skills/self-improvement
OpenClaw injects these files into every session:
~/.openclaw/workspace/
├── AGENTS.md # Multi-agent workflows, delegation patterns
├── SOUL.md # Behavioral guidelines, personality, principles
├── TOOLS.md # Tool capabilities, integration gotchas
├── MEMORY.md # Long-term memory (main session only)
├── memory/ # Daily memory files
│ └── YYYY-MM-DD.md
└── .learnings/ # This skill's log files
├── LEARNINGS.md
├── ERRORS.md
└── FEATURE_REQUESTS.md
mkdir -p ~/.openclaw/workspace/.learnings
Then create the log files (or copy from assets/):
LEARNINGS.md — corrections, knowledge gaps, best practicesERRORS.md — command failures, exceptionsFEATURE_REQUESTS.md — user-requested capabilitiesWhen learnings prove broadly applicable, promote them to workspace files:
| Learning Type | Promote To | Example | |---------------|------------|---------| | Behavioral patterns | SOUL.md | "Be concise, avoid disclaimers" | | Workflow improvements | AGENTS.md | "Spawn sub-agents for long tasks" | | Tool gotchas | TOOLS.md | "Git push needs auth configured first" |
OpenClaw provides tools to share learnings across sessions:
Use these only in trusted environments and only when the user explicitly wants cross-session sharing. Prefer sending a short sanitized summary and relevant file paths, not raw transcripts, secrets, or full command output.
For automatic reminders at session start:
# Copy hook to OpenClaw hooks directory
cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement
# Enable it
openclaw hooks enable self-improvement
See references/openclaw-integration.md for complete details.
---
For Claude Code, Codex, Copilot, or other agents, create .learnings/ in the project or workspace root:
mkdir -p .learnings
Create the files inline using the headers shown above. Avoid reading templates from the current repo or workspace unless you explicitly trust that path.
When errors or corrections occur:
.learnings/ERRORS.md, LEARNINGS.md, or FEATURE_REQUESTS.md - CLAUDE.md - project facts and conventions - AGENTS.md - workflows and automation - .github/copilot-instructions.md - Copilot context
Append to .learnings/LEARNINGS.md:
## [LRN-YYYYMMDD-XXX] category
**Logged**: ISO-8601 timestamp
**Priority**: low | medium | high | critical
**Status**: pending
**Area**: frontend | backend | infra | tests | docs | config
### Summary
One-line description of what was learned
### Details
Full context: what happened, what was wrong, what's correct
### Suggested Action
Specific fix or improvement to make
### Metadata
- Source: conversation | error | user_feedback
- Related Files: path/to/file.ext
- Tags: tag1, tag2
- See Also: LRN-20250110-001 (if related to existing entry)
- Pattern-Key: simplify.dead_code | harden.input_validation (optional, for recurring-pattern tracking)
- Recurrence-Count: 1 (optional)
- First-Seen: 2025-01-15 (optional)
- Last-Seen: 2025-01-15 (optional)
---
Append to .learnings/ERRORS.md:
## [ERR-YYYYMMDD-XXX] skill_or_command_name
**Logged**: ISO-8601 timestamp
**Priority**: high
**Status**: pending
**Area**: frontend | backend | infra | tests | docs | config
### Summary
Brief description of what failed
### Error
Actual error message or output
### Context
- Command/operation attempted
- Input or parameters used
- Environment details if relevant
- Summary or redacted excerpt of relevant output (avoid full transcripts and secret-bearing data by default)
### Suggested Fix
If identifiable, what might resolve this
...安装 self-improving-agent 后,可以对 AI 说这些话来触发它
Help me get started with self-improving-agent
Explains what self-improving-agent does, walks through the setup, and runs a quick demo based on your current project
Use self-improving-agent to captures learnings, errors, and corrections to enable continuous im...
Invokes self-improving-agent with the right parameters and returns the result directly in the conversation
What can I do with self-improving-agent in my ai agent & automation workflow?
Lists the top use cases for self-improving-agent, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/self-improving-agent/ 目录(个人级,所有项目可用),或 .claude/skills/self-improving-agent/(项目级)。重启 AI 客户端后,用 /self-improving-agent 主动调用,或让 AI 根据上下文自动发现并使用。
self-improving-agent 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
self-improving-agent 可免费安装使用。请查阅仓库了解许可证信息。
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
self-improving-agent 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my ai agent & automation tasks using self-improving-agent
Identifies repetitive steps in your workflow and sets up self-improving-agent to handle them automatically