self-improvement
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSelf-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
快速参考
| Situation | Action |
|---|---|
| Command/operation fails | Log to |
| User corrects you | Log to |
| User wants missing feature | Log to |
| API/external tool fails | Log to |
| Knowledge was outdated | Log to |
| Found better approach | Log to |
| Similar to existing entry | Link with |
| Broadly applicable learning | Promote to |
| Workflow improvements | Promote to |
| Tool gotchas | Promote to |
| Behavioral patterns | Promote to |
| 场景 | 操作 |
|---|---|
| 命令/操作失败 | 记录至 |
| 用户纠正你 | 记录至 |
| 用户需要缺失的功能 | 记录至 |
| API/外部工具故障 | 记录至 |
| 知识过时 | 记录至 |
| 发现更优方法 | 记录至 |
| 与现有条目相似 | 添加 |
| 广泛适用的学习内容 | 提升至 |
| 工作流改进 | 提升至 |
| 工具注意事项 | 提升至 |
| 行为模式 | 提升至 |
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-agentManual:
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-agentWorkspace 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.mdOpenClaw会将以下文件注入到每个会话中:
~/.openclaw/workspace/
├── AGENTS.md # 多Agent工作流、委托模式
├── SOUL.md # 行为准则、个性、原则
├── TOOLS.md # 工具能力、集成注意事项
├── MEMORY.md # 长期记忆(仅主会话)
├── memory/ # 每日记忆文件
│ └── YYYY-MM-DD.md
└── .learnings/ # 此Skill的日志文件
├── LEARNINGS.md
├── ERRORS.md
└── FEATURE_REQUESTS.mdCreate Learning Files
创建学习文件
bash
mkdir -p ~/.openclaw/workspace/.learningsThen create the log files (or copy from ):
assets/- — corrections, knowledge gaps, best practices
LEARNINGS.md - — command failures, exceptions
ERRORS.md - — user-requested capabilities
FEATURE_REQUESTS.md
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 Type | Promote To | Example |
|---|---|---|
| Behavioral patterns | | "Be concise, avoid disclaimers" |
| Workflow improvements | | "Spawn sub-agents for long tasks" |
| Tool gotchas | | "Git push needs auth configured first" |
当学习内容被证明具有广泛适用性时,将其提升至工作区文件:
| 学习类型 | 提升至 | 示例 |
|---|---|---|
| 行为模式 | | "保持简洁,避免免责声明" |
| 工作流改进 | | "为长任务生成子Agent" |
| 工具注意事项 | | "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
undefinedCopy 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 in your project:
.learnings/bash
mkdir -p .learningsCopy templates from or create files with headers.
assets/对于Claude Code、Codex、Copilot或其他Agent,在你的项目中创建目录:
.learnings/bash
mkdir -p .learnings从复制模板,或创建带标题的文件。
assets/Logging Format
记录格式
Learning Entry
学习条目
Append to :
.learnings/LEARNINGS.mdmarkdown
undefined追加至:
.learnings/LEARNINGS.mdmarkdown
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(如果与现有条目相关)
undefinedError Entry
错误条目
Append to :
.learnings/ERRORS.mdmarkdown
undefined追加至:
.learnings/ERRORS.mdmarkdown
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(如果重复出现)
undefinedFeature Request Entry
功能请求条目
Append to :
.learnings/FEATURE_REQUESTS.mdmarkdown
undefined追加至:
.learnings/FEATURE_REQUESTS.mdmarkdown
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
undefinedID Generation
ID生成规则
Format:
TYPE-YYYYMMDD-XXX- TYPE: (learning),
LRN(error),ERR(feature)FEAT - YYYYMMDD: Current date
- XXX: Sequential number or random 3 chars (e.g., ,
001)A7B
Examples: , ,
LRN-20250115-001ERR-20250115-A3FFEAT-20250115-002格式:
TYPE-YYYYMMDD-XXX- TYPE: (学习)、
LRN(错误)、ERR(功能)FEAT - YYYYMMDD: 当前日期
- XXX: 序号或随机3字符(例如、
001)A7B
示例: , ,
LRN-20250115-001ERR-20250115-A3FFEAT-20250115-002Resolving Entries
条目处理
When an issue is fixed, update the entry:
- Change →
**Status**: pending**Status**: resolved - Add resolution block after Metadata:
markdown
undefined当问题被修复后,更新条目:
- 将改为
**Status**: pending**Status**: resolved - 在元数据后添加处理模块:
markdown
undefinedResolution
处理详情
- 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.mdPromoting 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
提升目标
| Target | What Belongs There |
|---|---|
| Project facts, conventions, gotchas for all Claude interactions |
| Agent-specific workflows, tool usage patterns, automation rules |
| Project context and conventions for GitHub Copilot |
| Behavioral guidelines, communication style, principles (OpenClaw workspace) |
| Tool capabilities, usage patterns, integration gotchas (OpenClaw workspace) |
| 目标文件 | 适用内容 |
|---|---|
| 项目事实、约定、所有Claude交互的注意事项 |
| Agent特定工作流、工具使用模式、自动化规则 |
| GitHub Copilot的项目上下文和约定 |
| 行为准则、沟通风格、原则(OpenClaw工作区) |
| 工具能力、使用模式、集成注意事项(OpenClaw工作区) |
How to Promote
提升步骤
- Distill the learning into a concise rule or fact
- Add to appropriate section in target file (create file if needed)
- Update original entry:
- Change →
**Status**: pending**Status**: promoted - Add ,
**Promoted**: CLAUDE.md, orAGENTS.md.github/copilot-instructions.md
- Change
- 提炼:将学习内容浓缩为简洁的规则或事实
- 添加:添加至目标文件的对应章节(如文件不存在则创建)
- 更新原始条目:
- 将改为
**Status**: pending**Status**: promoted - 添加、
**Promoted**: CLAUDE.md或AGENTS.md.github/copilot-instructions.md
- 将
Promotion Examples
提升示例
Learning (verbose):
Project uses pnpm workspaces. Attemptedbut failed. Lock file isnpm install. Must usepnpm-lock.yaml.pnpm install
In CLAUDE.md (concise):
markdown
undefined学习内容(详细版):
项目使用pnpm工作区。尝试执行失败。 锁定文件为npm install。必须使用pnpm-lock.yaml。pnpm install
在CLAUDE.md中(简洁版):
markdown
undefinedBuild & 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中**(可操作版):
```markdownAfter API Changes
API修改后步骤
- Regenerate client:
pnpm run generate:api - Check for type errors:
pnpm tsc --noEmit
undefined- 重新生成客户端:
pnpm run generate:api - 检查类型错误:
pnpm tsc --noEmit
undefinedRecurring Pattern Detection
重复模式检测
If logging something similar to an existing entry:
- Search first:
grep -r "keyword" .learnings/ - Link entries: Add in Metadata
**See Also**: ERR-20250110-001 - Bump priority if issue keeps recurring
- 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)
如果要记录的内容与现有条目相似:
- 先搜索:
grep -r "keyword" .learnings/ - 链接条目:在元数据中添加
**See Also**: ERR-20250110-001 - 提升优先级:如果问题重复出现
- 考虑系统性修复:重复问题通常表明:
- 缺少文档(→ 提升至CLAUDE.md或.github/copilot-instructions.md)
- 缺少自动化(→ 添加至AGENTS.md)
- 架构问题(→ 创建技术债务工单)
Periodic Review
定期回顾
Review at natural breakpoints:
.learnings/在合适的节点回顾内容:
.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
undefinedbash
undefinedCount 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
undefinedgrep -l "Area**: backend" .learnings/*.md
undefinedReview Actions
回顾操作
- Resolve fixed items
- Promote applicable learnings
- Link related entries
- Escalate recurring issues
- 标记已修复的项为已解决
- 提升适用的学习内容
- 链接相关条目
- 升级重复出现的问题
Detection Triggers
检测触发条件
Automatically log when you notice:
Corrections (→ learning with category):
correction- "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 category):
knowledge_gap- 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
优先级指南
| Priority | When to Use |
|---|---|
| Blocks core functionality, data loss risk, security issue |
| Significant impact, affects common workflows, recurring issue |
| Moderate impact, workaround exists |
| Minor inconvenience, edge case, nice-to-have |
| 优先级 | 适用场景 |
|---|---|
| 阻碍核心功能、存在数据丢失风险、安全问题 |
| 影响重大、影响常见工作流、重复出现的问题 |
| 影响中等、存在替代方案 |
| 轻微不便、边缘情况、锦上添花的功能 |
Area Tags
领域标签
Use to filter learnings by codebase region:
| Area | Scope |
|---|---|
| UI, components, client-side code |
| API, services, server-side code |
| CI/CD, deployment, Docker, cloud |
| Test files, testing utilities, coverage |
| Documentation, comments, READMEs |
| Configuration files, environment, settings |
用于按代码库区域过滤学习内容:
| 领域 | 范围 |
|---|---|
| UI、组件、客户端代码 |
| API、服务、服务器端代码 |
| CI/CD、部署、Docker、云服务 |
| 测试文件、测试工具、覆盖率 |
| 文档、注释、README |
| 配置文件、环境、设置 |
Best Practices
最佳实践
- Log immediately - context is freshest right after the issue
- Be specific - future agents need to understand quickly
- Include reproduction steps - especially for errors
- Link related files - makes fixes easier
- Suggest concrete fixes - not just "investigate"
- Use consistent categories - enables filtering
- Promote aggressively - if in doubt, add to CLAUDE.md or .github/copilot-instructions.md
- Review regularly - stale learnings lose value
- 立即记录 - 问题刚发生时上下文最清晰
- 具体明确 - 未来的Agent需要快速理解
- 包含复现步骤 - 尤其是错误条目
- 链接相关文件 - 便于修复
- 建议具体的修复方案 - 不只是“调查”
- 使用一致的分类 - 便于过滤
- 积极提升内容 - 如有疑问,添加至CLAUDE.md或.github/copilot-instructions.md
- 定期回顾 - 过时的学习内容会失去价值
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/.gitkeepHook 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 in your project:
.claude/settings.jsonjson
{
"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.jsonjson
{
"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
可用钩子脚本
| Script | Hook Type | Purpose |
|---|---|---|
| UserPromptSubmit | Reminds to evaluate learnings after tasks |
| PostToolUse (Bash) | Triggers on command errors |
See for detailed configuration and troubleshooting.
references/hooks-setup.md| 脚本 | 钩子类型 | 用途 |
|---|---|---|
| UserPromptSubmit | 任务完成后提醒评估学习内容 |
| PostToolUse (Bash) | 命令错误时触发 |
详细配置与故障排除请参见。
references/hooks-setup.mdAutomatic 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:
| Criterion | Description |
|---|---|
| Recurring | Has |
| Verified | Status is |
| Non-obvious | Required actual debugging/investigation to discover |
| Broadly applicable | Not project-specific; useful across codebases |
| User-flagged | User says "save this as a skill" or similar |
当满足以下任一条件时,学习内容可提取为Skill:
| 标准 | 描述 |
|---|---|
| 重复出现 | 有 |
| 已验证 | 状态为 |
| 非显而易见 | 需要实际调试/调查才能发现 |
| 广泛适用 | 非项目特定;适用于多个代码库 |
| 用户标记 | 用户说“将此保存为Skill”或类似表述 |
Extraction Workflow
提取流程
- Identify candidate: Learning meets extraction criteria
- 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 - Customize SKILL.md: Fill in template with learning content
- Update learning: Set status to , add
promoted_to_skillSkill-Path - Verify: Read skill in fresh session to ensure it's self-contained
- 识别候选内容:学习内容满足提取标准
- 运行工具(或手动创建):
bash
./skills/self-improvement/scripts/extract-skill.sh skill-name --dry-run ./skills/self-improvement/scripts/extract-skill.sh skill-name - 自定义SKILL.md:使用模板填充学习内容
- 更新学习条目:设置状态为,添加
promoted_to_skillSkill-Path - 验证:在新会话中读取Skill,确保其独立可用
Manual Extraction
手动提取
If you prefer manual creation:
- Create
skills/<skill-name>/SKILL.md - Use template from
assets/SKILL-TEMPLATE.md - Follow Agent Skills spec:
- YAML frontmatter with and
namedescription - Name must match folder name
- No README.md inside skill folder
- YAML frontmatter with
如果你偏好手动创建:
- 创建
skills/<skill-name>/SKILL.md - 使用中的模板
assets/SKILL-TEMPLATE.md - 遵循Agent Skills规范:
- 包含和
name的YAML前置元数据description - 名称必须与文件夹名称匹配
- 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 links (recurring issue)
See Also - High priority + resolved status
- Category: with broad applicability
best_practice - 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: with hook configuration
Detection: Automatic via hook scripts
.claude/settings.json激活方式:钩子(UserPromptSubmit、PostToolUse)
配置:中的钩子配置
检测方式:通过钩子脚本自动检测
.claude/settings.jsonCodex CLI
Codex CLI
Activation: Hooks (same pattern as Claude Code)
Setup: with hook configuration
Detection: Automatic via hook scripts
.codex/settings.json激活方式:钩子(与Claude Code模式相同)
配置:中的钩子配置
检测方式:通过钩子脚本自动检测
.codex/settings.jsonGitHub Copilot
GitHub Copilot
Activation: Manual (no hook support)
Setup: Add to :
.github/copilot-instructions.mdmarkdown
undefined激活方式:手动(无钩子支持)
配置:添加至:
.github/copilot-instructions.mdmarkdown
undefinedSelf-Improvement
自我改进
After solving non-obvious issues, consider logging to :
.learnings/- Use format from self-improvement skill
- Link related entries with See Also
- Promote high-value learnings to skills
Ask in chat: "Should I log this as a learning?"
**Detection**: Manual review at session end解决非显而易见的问题后,考虑将内容记录至:
.learnings/- 使用自我改进Skill的格式
- 使用See Also链接相关条目
- 将高价值学习内容提升为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:
- Discover something non-obvious - solution wasn't immediate
- Correct yourself - initial approach was wrong
- Learn project conventions - discovered undocumented patterns
- Hit unexpected errors - especially if diagnosis was difficult
- Find better approaches - improved on your original solution
无论使用哪种Agent,在以下场景应用自我改进:
- 发现非显而易见的内容 - 解决方案并非立即可得
- 自我纠正 - 初始方法错误
- 学习项目约定 - 发现未文档化的模式
- 遇到意外错误 - 尤其是诊断困难的情况
- 找到更优方法 - 改进原始解决方案
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 tousing the self-improvement skill format..learnings/
Or use quick prompts:
- "Log this to learnings"
- "Create a skill from this solution"
- "Check .learnings/ for related issues"
对于Copilot用户,在相关提示中添加以下内容:
完成此任务后,评估是否有任何学习内容应使用自我改进Skill的格式记录至。.learnings/
或使用快速提示:
- “将此记录至学习内容”
- “从此解决方案创建Skill”
- “检查.learnings/中的相关问题”