self-improvement

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Self-Improvement Skill

自我改进Skill

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.
将学习内容和错误记录到Markdown文件中,以实现持续改进。编码Agent后续可将这些内容转化为修复方案,重要的学习内容会被提升至项目记忆库。

Quick Reference

快速参考

SituationAction
Command/operation failsLog to
.learnings/ERRORS.md
User corrects youLog to
.learnings/LEARNINGS.md
with category
correction
User wants missing featureLog to
.learnings/FEATURE_REQUESTS.md
API/external tool failsLog to
.learnings/ERRORS.md
with integration details
Knowledge was outdatedLog to
.learnings/LEARNINGS.md
with category
knowledge_gap
Found better approachLog to
.learnings/LEARNINGS.md
with category
best_practice
Similar to existing entryLink with
**See Also**
, consider priority bump
Broadly applicable learningPromote to
CLAUDE.md
,
AGENTS.md
, and/or
.github/copilot-instructions.md
Workflow improvementsPromote to
AGENTS.md
(OpenClaw workspace)
Tool gotchasPromote to
TOOLS.md
(OpenClaw workspace)
Behavioral patternsPromote to
SOUL.md
(OpenClaw workspace)
场景操作
命令/操作失败记录至
.learnings/ERRORS.md
用户纠正你记录至
.learnings/LEARNINGS.md
,分类标记为
correction
用户需要缺失的功能记录至
.learnings/FEATURE_REQUESTS.md
API/外部工具故障记录至
.learnings/ERRORS.md
,并添加集成详情
知识过时记录至
.learnings/LEARNINGS.md
,分类标记为
knowledge_gap
发现更优方法记录至
.learnings/LEARNINGS.md
,分类标记为
best_practice
与现有条目相似添加
**See Also**
链接,考虑提升优先级
广泛适用的学习内容提升至
CLAUDE.md
AGENTS.md
和/或
.github/copilot-instructions.md
工作流改进提升至
AGENTS.md
(OpenClaw工作区)
工具注意事项提升至
TOOLS.md
(OpenClaw工作区)
行为模式提升至
SOUL.md
(OpenClaw工作区)

OpenClaw Setup (Recommended)

OpenClaw配置(推荐)

OpenClaw is the primary platform for this skill. It uses workspace-based prompt injection with automatic skill loading.
OpenClaw是使用此Skill的主要平台,它基于工作区的提示注入功能,可自动加载Skill。

Installation

安装

Via ClawdHub (recommended):
bash
clawdhub install self-improving-agent
Manual:
bash
git clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent
通过ClawdHub安装(推荐):
bash
clawdhub install self-improving-agent
手动安装:
bash
git clone https://github.com/peterskoett/self-improving-agent.git ~/.openclaw/skills/self-improving-agent

Workspace Structure

工作区结构

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
OpenClaw会将以下文件注入到每个会话中:
~/.openclaw/workspace/
├── AGENTS.md          # 多Agent工作流、委托模式
├── SOUL.md            # 行为准则、个性、原则
├── TOOLS.md           # 工具能力、集成注意事项
├── MEMORY.md          # 长期记忆(仅主会话)
├── memory/            # 每日记忆文件
│   └── YYYY-MM-DD.md
└── .learnings/        # 此Skill的日志文件
    ├── LEARNINGS.md
    ├── ERRORS.md
    └── FEATURE_REQUESTS.md

Create Learning Files

创建学习文件

bash
mkdir -p ~/.openclaw/workspace/.learnings
Then create the log files (or copy from
assets/
):
  • LEARNINGS.md
    — corrections, knowledge gaps, best practices
  • ERRORS.md
    — command failures, exceptions
  • FEATURE_REQUESTS.md
    — user-requested capabilities
bash
mkdir -p ~/.openclaw/workspace/.learnings
然后创建日志文件(或从
assets/
复制):
  • LEARNINGS.md
    — 修正内容、知识缺口、最佳实践
  • ERRORS.md
    — 命令失败、异常
  • FEATURE_REQUESTS.md
    — 用户请求的功能

Promotion Targets

提升目标

When learnings prove broadly applicable, promote them to workspace files:
Learning TypePromote ToExample
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"
当学习内容被证明具有广泛适用性时,将其提升至工作区文件:
学习类型提升至示例
行为模式
SOUL.md
"保持简洁,避免免责声明"
工作流改进
AGENTS.md
"为长任务生成子Agent"
工具注意事项
TOOLS.md
"Git push需要先配置认证"

Inter-Session Communication

跨会话通信

OpenClaw provides tools to share learnings across sessions:
  • sessions_list — View active/recent sessions
  • sessions_history — Read another session's transcript
  • sessions_send — Send a learning to another session
  • sessions_spawn — Spawn a sub-agent for background work
OpenClaw提供工具以在会话间共享学习内容:
  • sessions_list — 查看活跃/近期会话
  • sessions_history — 读取另一个会话的记录
  • sessions_send — 向另一个会话发送学习内容
  • sessions_spawn — 生成子Agent处理后台工作

Optional: Enable Hook

可选:启用钩子

For automatic reminders at session start:
bash
undefined
如需在会话开始时自动提醒:
bash
undefined

Copy hook to OpenClaw hooks directory

复制钩子到OpenClaw钩子目录

cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement
cp -r hooks/openclaw ~/.openclaw/hooks/self-improvement

Enable it

启用钩子

openclaw hooks enable self-improvement

See `references/openclaw-integration.md` for complete details.

---
openclaw hooks enable self-improvement

完整详情请参见`references/openclaw-integration.md`。

---

Generic Setup (Other Agents)

通用配置(其他Agent)

For Claude Code, Codex, Copilot, or other agents, create
.learnings/
in your project:
bash
mkdir -p .learnings
Copy templates from
assets/
or create files with headers.
对于Claude Code、Codex、Copilot或其他Agent,在你的项目中创建
.learnings/
目录:
bash
mkdir -p .learnings
assets/
复制模板,或创建带标题的文件。

Logging Format

记录格式

Learning Entry

学习条目

Append to
.learnings/LEARNINGS.md
:
markdown
undefined
追加至
.learnings/LEARNINGS.md
markdown
undefined

[LRN-YYYYMMDD-XXX] category

[LRN-YYYYMMDD-XXX] 分类

Logged: ISO-8601 timestamp Priority: low | medium | high | critical Status: pending Area: frontend | backend | infra | tests | docs | config
记录时间: ISO-8601时间戳 优先级: low | medium | high | critical 状态: pending 领域: 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)

undefined
  • 来源: conversation | error | user_feedback
  • 相关文件: path/to/file.ext
  • 标签: tag1, tag2
  • 另请参阅: LRN-20250110-001(如果与现有条目相关)

undefined

Error Entry

错误条目

Append to
.learnings/ERRORS.md
:
markdown
undefined
追加至
.learnings/ERRORS.md
markdown
undefined

[ERR-YYYYMMDD-XXX] skill_or_command_name

[ERR-YYYYMMDD-XXX] skill_or_command_name

Logged: ISO-8601 timestamp Priority: high Status: pending Area: frontend | backend | infra | tests | docs | config
记录时间: ISO-8601时间戳 优先级: high 状态: pending 领域: 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
  • 尝试执行的命令/操作
  • 使用的输入或参数
  • 相关的环境详情(如有)

Suggested Fix

建议修复方案

If identifiable, what might resolve this
如果可识别,可能的解决方法

Metadata

元数据

  • Reproducible: yes | no | unknown
  • Related Files: path/to/file.ext
  • See Also: ERR-20250110-001 (if recurring)

undefined
  • 可复现: yes | no | unknown
  • 相关文件: path/to/file.ext
  • 另请参阅: ERR-20250110-001(如果重复出现)

undefined

Feature Request Entry

功能请求条目

Append to
.learnings/FEATURE_REQUESTS.md
:
markdown
undefined
追加至
.learnings/FEATURE_REQUESTS.md
markdown
undefined

[FEAT-YYYYMMDD-XXX] capability_name

[FEAT-YYYYMMDD-XXX] capability_name

Logged: ISO-8601 timestamp Priority: medium Status: pending Area: frontend | backend | infra | tests | docs | config
记录时间: ISO-8601时间戳 优先级: medium 状态: pending 领域: frontend | backend | infra | tests | docs | config

Requested Capability

请求的功能

What the user wanted to do
用户想要实现的操作

User Context

用户上下文

Why they needed it, what problem they're solving
他们的需求原因、要解决的问题

Complexity Estimate

复杂度评估

simple | medium | complex
simple | medium | complex

Suggested Implementation

建议实现方案

How this could be built, what it might extend
如何构建、可扩展现有哪些功能

Metadata

元数据

  • Frequency: first_time | recurring
  • Related Features: existing_feature_name

undefined
  • 频率: first_time | recurring
  • 相关功能: existing_feature_name

undefined

ID Generation

ID生成规则

Format:
TYPE-YYYYMMDD-XXX
  • TYPE:
    LRN
    (learning),
    ERR
    (error),
    FEAT
    (feature)
  • YYYYMMDD: Current date
  • XXX: Sequential number or random 3 chars (e.g.,
    001
    ,
    A7B
    )
Examples:
LRN-20250115-001
,
ERR-20250115-A3F
,
FEAT-20250115-002
格式:
TYPE-YYYYMMDD-XXX
  • TYPE:
    LRN
    (学习)、
    ERR
    (错误)、
    FEAT
    (功能)
  • YYYYMMDD: 当前日期
  • XXX: 序号或随机3字符(例如
    001
    A7B
示例:
LRN-20250115-001
,
ERR-20250115-A3F
,
FEAT-20250115-002

Resolving Entries

条目处理

When an issue is fixed, update the entry:
  1. Change
    **Status**: pending
    **Status**: resolved
  2. Add resolution block after Metadata:
markdown
undefined
当问题被修复后,更新条目:
  1. **Status**: pending
    改为
    **Status**: resolved
  2. 在元数据后添加处理模块:
markdown
undefined

Resolution

处理详情

  • Resolved: 2025-01-16T09:00:00Z
  • Commit/PR: abc123 or #42
  • Notes: Brief description of what was done

Other status values:
- `in_progress` - Actively being worked on
- `wont_fix` - Decided not to address (add reason in Resolution notes)
- `promoted` - Elevated to CLAUDE.md, AGENTS.md, or .github/copilot-instructions.md
  • 解决时间: 2025-01-16T09:00:00Z
  • 提交/PR: abc123 或 #42
  • 备注: 简要描述处理内容

其他状态值:
- `in_progress` - 正在处理中
- `wont_fix` - 决定不处理(在处理备注中添加原因)
- `promoted` - 已提升至CLAUDE.md、AGENTS.md或.github/copilot-instructions.md

Promoting to Project Memory

提升至项目记忆库

When a learning is broadly applicable (not a one-off fix), promote it to permanent project memory.
当学习内容具有广泛适用性(非一次性修复)时,将其提升至永久项目记忆库。

When to Promote

提升时机

  • Learning applies across multiple files/features
  • Knowledge any contributor (human or AI) should know
  • Prevents recurring mistakes
  • Documents project-specific conventions
  • 学习内容适用于多个文件/功能
  • 所有贡献者(人类或AI)都应了解的知识
  • 可防止重复犯错
  • 记录项目特定的约定

Promotion Targets

提升目标

TargetWhat Belongs There
CLAUDE.md
Project facts, conventions, gotchas for all Claude interactions
AGENTS.md
Agent-specific workflows, tool usage patterns, automation rules
.github/copilot-instructions.md
Project context and conventions for GitHub Copilot
SOUL.md
Behavioral guidelines, communication style, principles (OpenClaw workspace)
TOOLS.md
Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace)
目标文件适用内容
CLAUDE.md
项目事实、约定、所有Claude交互的注意事项
AGENTS.md
Agent特定工作流、工具使用模式、自动化规则
.github/copilot-instructions.md
GitHub Copilot的项目上下文和约定
SOUL.md
行为准则、沟通风格、原则(OpenClaw工作区)
TOOLS.md
工具能力、使用模式、集成注意事项(OpenClaw工作区)

How to Promote

提升步骤

  1. Distill the learning into a concise rule or fact
  2. Add to appropriate section in target file (create file if needed)
  3. Update original entry:
    • Change
      **Status**: pending
      **Status**: promoted
    • Add
      **Promoted**: CLAUDE.md
      ,
      AGENTS.md
      , or
      .github/copilot-instructions.md
  1. 提炼:将学习内容浓缩为简洁的规则或事实
  2. 添加:添加至目标文件的对应章节(如文件不存在则创建)
  3. 更新原始条目:
    • **Status**: pending
      改为
      **Status**: promoted
    • 添加
      **Promoted**: CLAUDE.md
      AGENTS.md
      .github/copilot-instructions.md

Promotion Examples

提升示例

Learning (verbose):
Project uses pnpm workspaces. Attempted
npm install
but failed. Lock file is
pnpm-lock.yaml
. Must use
pnpm install
.
In CLAUDE.md (concise):
markdown
undefined
学习内容(详细版):
项目使用pnpm工作区。尝试执行
npm install
失败。 锁定文件为
pnpm-lock.yaml
。必须使用
pnpm install
在CLAUDE.md中(简洁版):
markdown
undefined

Build & Dependencies

构建与依赖

  • Package manager: pnpm (not npm) - use
    pnpm install

**Learning** (verbose):
> When modifying API endpoints, must regenerate TypeScript client.
> Forgetting this causes type mismatches at runtime.

**In AGENTS.md** (actionable):
```markdown
  • 包管理器:pnpm(非npm)- 使用
    pnpm install

**学习内容**(详细版):
> 修改API端点后,必须重新生成TypeScript客户端。
> 忘记此步骤会导致运行时类型不匹配。

**在AGENTS.md中**(可操作版):
```markdown

After API Changes

API修改后步骤

  1. Regenerate client:
    pnpm run generate:api
  2. Check for type errors:
    pnpm tsc --noEmit
undefined
  1. 重新生成客户端:
    pnpm run generate:api
  2. 检查类型错误:
    pnpm tsc --noEmit
undefined

Recurring Pattern Detection

重复模式检测

If logging something similar to an existing entry:
  1. Search first:
    grep -r "keyword" .learnings/
  2. Link entries: Add
    **See Also**: ERR-20250110-001
    in Metadata
  3. Bump priority if issue keeps recurring
  4. Consider systemic fix: Recurring issues often indicate:
    • Missing documentation (→ promote to CLAUDE.md or .github/copilot-instructions.md)
    • Missing automation (→ add to AGENTS.md)
    • Architectural problem (→ create tech debt ticket)
如果要记录的内容与现有条目相似:
  1. 先搜索
    grep -r "keyword" .learnings/
  2. 链接条目:在元数据中添加
    **See Also**: ERR-20250110-001
  3. 提升优先级:如果问题重复出现
  4. 考虑系统性修复:重复问题通常表明:
    • 缺少文档(→ 提升至CLAUDE.md或.github/copilot-instructions.md)
    • 缺少自动化(→ 添加至AGENTS.md)
    • 架构问题(→ 创建技术债务工单)

Periodic Review

定期回顾

Review
.learnings/
at natural breakpoints:
在合适的节点回顾
.learnings/
内容:

When to Review

回顾时机

  • Before starting a new major task
  • After completing a feature
  • When working in an area with past learnings
  • Weekly during active development
  • 开始新的重大任务前
  • 完成一个功能后
  • 在有过往学习内容的领域工作时
  • 活跃开发期间每周回顾

Quick Status Check

快速状态检查

bash
undefined
bash
undefined

Count pending items

统计待处理项数量

grep -h "Status**: pending" .learnings/*.md | wc -l
grep -h "Status**: pending" .learnings/*.md | wc -l

List pending high-priority items

列出待处理的高优先级项

grep -B5 "Priority**: high" .learnings/*.md | grep "^## ["
grep -B5 "Priority**: high" .learnings/*.md | grep "^## ["

Find learnings for a specific area

查找特定领域的学习内容

grep -l "Area**: backend" .learnings/*.md
undefined
grep -l "Area**: backend" .learnings/*.md
undefined

Review Actions

回顾操作

  • Resolve fixed items
  • Promote applicable learnings
  • Link related entries
  • Escalate recurring issues
  • 标记已修复的项为已解决
  • 提升适用的学习内容
  • 链接相关条目
  • 升级重复出现的问题

Detection Triggers

检测触发条件

Automatically log when you notice:
Corrections (→ learning with
correction
category):
  • "No, that's not right..."
  • "Actually, it should be..."
  • "You're wrong about..."
  • "That's outdated..."
Feature Requests (→ feature request):
  • "Can you also..."
  • "I wish you could..."
  • "Is there a way to..."
  • "Why can't you..."
Knowledge Gaps (→ learning with
knowledge_gap
category):
  • User provides information you didn't know
  • Documentation you referenced is outdated
  • API behavior differs from your understanding
Errors (→ error entry):
  • Command returns non-zero exit code
  • Exception or stack trace
  • Unexpected output or behavior
  • Timeout or connection failure
当你注意到以下情况时自动记录:
修正内容(→ 分类为
correction
的学习条目):
  • “不对,不是这样的……”
  • “实际上,应该是……”
  • “你错了……”
  • “这已经过时了……”
功能请求(→ 功能请求条目):
  • “你还能……吗?”
  • “我希望你能……”
  • “有没有办法……?”
  • “为什么你不能……?”
知识缺口(→ 分类为
knowledge_gap
的学习条目):
  • 用户提供了你不知道的信息
  • 你参考的文档已过时
  • API行为与你的理解不符
错误(→ 错误条目):
  • 命令返回非零退出码
  • 异常或堆栈跟踪
  • 意外输出或行为
  • 超时或连接失败

Priority Guidelines

优先级指南

PriorityWhen to Use
critical
Blocks core functionality, data loss risk, security issue
high
Significant impact, affects common workflows, recurring issue
medium
Moderate impact, workaround exists
low
Minor inconvenience, edge case, nice-to-have
优先级适用场景
critical
阻碍核心功能、存在数据丢失风险、安全问题
high
影响重大、影响常见工作流、重复出现的问题
medium
影响中等、存在替代方案
low
轻微不便、边缘情况、锦上添花的功能

Area Tags

领域标签

Use to filter learnings by codebase region:
AreaScope
frontend
UI, components, client-side code
backend
API, services, server-side code
infra
CI/CD, deployment, Docker, cloud
tests
Test files, testing utilities, coverage
docs
Documentation, comments, READMEs
config
Configuration files, environment, settings
用于按代码库区域过滤学习内容:
领域范围
frontend
UI、组件、客户端代码
backend
API、服务、服务器端代码
infra
CI/CD、部署、Docker、云服务
tests
测试文件、测试工具、覆盖率
docs
文档、注释、README
config
配置文件、环境、设置

Best Practices

最佳实践

  1. Log immediately - context is freshest right after the issue
  2. Be specific - future agents need to understand quickly
  3. Include reproduction steps - especially for errors
  4. Link related files - makes fixes easier
  5. Suggest concrete fixes - not just "investigate"
  6. Use consistent categories - enables filtering
  7. Promote aggressively - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md
  8. Review regularly - stale learnings lose value
  1. 立即记录 - 问题刚发生时上下文最清晰
  2. 具体明确 - 未来的Agent需要快速理解
  3. 包含复现步骤 - 尤其是错误条目
  4. 链接相关文件 - 便于修复
  5. 建议具体的修复方案 - 不只是“调查”
  6. 使用一致的分类 - 便于过滤
  7. 积极提升内容 - 如有疑问,添加至CLAUDE.md或.github/copilot-instructions.md
  8. 定期回顾 - 过时的学习内容会失去价值

Gitignore Options

Gitignore选项

Keep learnings local (per-developer):
gitignore
.learnings/
Track learnings in repo (team-wide): Don't add to .gitignore - learnings become shared knowledge.
Hybrid (track templates, ignore entries):
gitignore
.learnings/*.md
!.learnings/.gitkeep
本地保留学习内容(每位开发者):
gitignore
.learnings/
在仓库中跟踪学习内容(团队共享): 不要添加到.gitignore - 学习内容成为共享知识。
混合模式(跟踪模板,忽略条目):
gitignore
.learnings/*.md
!.learnings/.gitkeep

Hook Integration

钩子集成

Enable automatic reminders through agent hooks. This is opt-in - you must explicitly configure hooks.
通过Agent钩子启用自动提醒。此功能为可选 - 你必须显式配置钩子。

Quick Setup (Claude Code / Codex)

快速配置(Claude Code / Codex)

Create
.claude/settings.json
in your project:
json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/activator.sh"
      }]
    }]
  }
}
This injects a learning evaluation reminder after each prompt (~50-100 tokens overhead).
在你的项目中创建
.claude/settings.json
json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/activator.sh"
      }]
    }]
  }
}
这会在每个提示后注入学习评估提醒(约50-100令牌开销)。

Full Setup (With Error Detection)

完整配置(含错误检测)

json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/activator.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/error-detector.sh"
      }]
    }]
  }
}
json
{
  "hooks": {
    "UserPromptSubmit": [{
      "matcher": "",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/activator.sh"
      }]
    }],
    "PostToolUse": [{
      "matcher": "Bash",
      "hooks": [{
        "type": "command",
        "command": "./skills/self-improvement/scripts/error-detector.sh"
      }]
    }]
  }
}

Available Hook Scripts

可用钩子脚本

ScriptHook TypePurpose
scripts/activator.sh
UserPromptSubmitReminds to evaluate learnings after tasks
scripts/error-detector.sh
PostToolUse (Bash)Triggers on command errors
See
references/hooks-setup.md
for detailed configuration and troubleshooting.
脚本钩子类型用途
scripts/activator.sh
UserPromptSubmit任务完成后提醒评估学习内容
scripts/error-detector.sh
PostToolUse (Bash)命令错误时触发
详细配置与故障排除请参见
references/hooks-setup.md

Automatic Skill Extraction

自动Skill提取

When a learning is valuable enough to become a reusable skill, extract it using the provided helper.
当学习内容足够有价值可成为可复用Skill时,使用提供的工具提取。

Skill Extraction Criteria

Skill提取标准

A learning qualifies for skill extraction when ANY of these apply:
CriterionDescription
RecurringHas
See Also
links to 2+ similar issues
VerifiedStatus is
resolved
with working fix
Non-obviousRequired actual debugging/investigation to discover
Broadly applicableNot project-specific; useful across codebases
User-flaggedUser says "save this as a skill" or similar
当满足以下任一条件时,学习内容可提取为Skill:
标准描述
重复出现
See Also
链接至2个以上相似问题
已验证状态为
resolved
且修复方案有效
非显而易见需要实际调试/调查才能发现
广泛适用非项目特定;适用于多个代码库
用户标记用户说“将此保存为Skill”或类似表述

Extraction Workflow

提取流程

  1. Identify candidate: Learning meets extraction criteria
  2. Run helper (or create manually):
    bash
    ./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run
    ./skills/self-improvement/scripts/extract-skill.sh skill-name
  3. Customize SKILL.md: Fill in template with learning content
  4. Update learning: Set status to
    promoted_to_skill
    , add
    Skill-Path
  5. Verify: Read skill in fresh session to ensure it's self-contained
  1. 识别候选内容:学习内容满足提取标准
  2. 运行工具(或手动创建):
    bash
    ./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run
    ./skills/self-improvement/scripts/extract-skill.sh skill-name
  3. 自定义SKILL.md:使用模板填充学习内容
  4. 更新学习条目:设置状态为
    promoted_to_skill
    ,添加
    Skill-Path
  5. 验证:在新会话中读取Skill,确保其独立可用

Manual Extraction

手动提取

If you prefer manual creation:
  1. Create
    skills/<skill-name>/SKILL.md
  2. Use template from
    assets/SKILL-TEMPLATE.md
  3. Follow Agent Skills spec:
    • YAML frontmatter with
      name
      and
      description
    • Name must match folder name
    • No README.md inside skill folder
如果你偏好手动创建:
  1. 创建
    skills/<skill-name>/SKILL.md
  2. 使用
    assets/SKILL-TEMPLATE.md
    中的模板
  3. 遵循Agent Skills规范
    • 包含
      name
      description
      的YAML前置元数据
    • 名称必须与文件夹名称匹配
    • Skill文件夹内无README.md

Extraction Detection Triggers

提取检测触发条件

Watch for these signals that a learning should become a skill:
In conversation:
  • "Save this as a skill"
  • "I keep running into this"
  • "This would be useful for other projects"
  • "Remember this pattern"
In learning entries:
  • Multiple
    See Also
    links (recurring issue)
  • High priority + resolved status
  • Category:
    best_practice
    with broad applicability
  • User feedback praising the solution
注意以下信号,表明学习内容应转化为Skill:
对话中:
  • “将此保存为Skill”
  • “我总是遇到这个问题”
  • “这对其他项目也有用”
  • “记住这个模式”
学习条目中:
  • 多个
    See Also
    链接(重复问题)
  • 高优先级+已解决状态
  • 分类为
    best_practice
    且具有广泛适用性
  • 用户反馈称赞解决方案

Skill Quality Gates

Skill质量把关

Before extraction, verify:
  • Solution is tested and working
  • Description is clear without original context
  • Code examples are self-contained
  • No project-specific hardcoded values
  • Follows skill naming conventions (lowercase, hyphens)
提取前,验证:
  • 解决方案已测试且有效
  • 描述清晰,无需原始上下文
  • 代码示例独立可用
  • 无项目特定硬编码值
  • 遵循Skill命名规范(小写、连字符)

Multi-Agent Support

多Agent支持

This skill works across different AI coding agents with agent-specific activation.
此Skill可在不同的AI编码Agent中使用,每个Agent有特定的激活方式。

Claude Code

Claude Code

Activation: Hooks (UserPromptSubmit, PostToolUse) Setup:
.claude/settings.json
with hook configuration Detection: Automatic via hook scripts
激活方式:钩子(UserPromptSubmit、PostToolUse) 配置
.claude/settings.json
中的钩子配置 检测方式:通过钩子脚本自动检测

Codex CLI

Codex CLI

Activation: Hooks (same pattern as Claude Code) Setup:
.codex/settings.json
with hook configuration Detection: Automatic via hook scripts
激活方式:钩子(与Claude Code模式相同) 配置
.codex/settings.json
中的钩子配置 检测方式:通过钩子脚本自动检测

GitHub Copilot

GitHub Copilot

Activation: Manual (no hook support) Setup: Add to
.github/copilot-instructions.md
:
markdown
undefined
激活方式:手动(无钩子支持) 配置:添加至
.github/copilot-instructions.md
markdown
undefined

Self-Improvement

自我改进

After solving non-obvious issues, consider logging to
.learnings/
:
  1. Use format from self-improvement skill
  2. Link related entries with See Also
  3. Promote high-value learnings to skills
Ask in chat: "Should I log this as a learning?"

**Detection**: Manual review at session end
解决非显而易见的问题后,考虑将内容记录至
.learnings/
  1. 使用自我改进Skill的格式
  2. 使用See Also链接相关条目
  3. 将高价值学习内容提升为Skill
在聊天中询问:“我应该将此记录为学习内容吗?”

**检测方式**:会话结束时手动回顾

OpenClaw

OpenClaw

Activation: Workspace injection + inter-agent messaging Setup: See "OpenClaw Setup" section above Detection: Via session tools and workspace files
激活方式:工作区注入+Agent间通信 配置:参见上方“OpenClaw配置”部分 检测方式:通过会话工具和工作区文件

Agent-Agnostic Guidance

Agent通用指南

Regardless of agent, apply self-improvement when you:
  1. Discover something non-obvious - solution wasn't immediate
  2. Correct yourself - initial approach was wrong
  3. Learn project conventions - discovered undocumented patterns
  4. Hit unexpected errors - especially if diagnosis was difficult
  5. Find better approaches - improved on your original solution
无论使用哪种Agent,在以下场景应用自我改进:
  1. 发现非显而易见的内容 - 解决方案并非立即可得
  2. 自我纠正 - 初始方法错误
  3. 学习项目约定 - 发现未文档化的模式
  4. 遇到意外错误 - 尤其是诊断困难的情况
  5. 找到更优方法 - 改进原始解决方案

Copilot Chat Integration

Copilot Chat集成

For Copilot users, add this to your prompts when relevant:
After completing this task, evaluate if any learnings should be logged to
.learnings/
using the self-improvement skill format.
Or use quick prompts:
  • "Log this to learnings"
  • "Create a skill from this solution"
  • "Check .learnings/ for related issues"
对于Copilot用户,在相关提示中添加以下内容:
完成此任务后,评估是否有任何学习内容应使用自我改进Skill的格式记录至
.learnings/
或使用快速提示:
  • “将此记录至学习内容”
  • “从此解决方案创建Skill”
  • “检查.learnings/中的相关问题”