教训
- 作者仓库星标 3,507
- 许可证 Apache-2.0
- 作者仓库 okteto
- 领域
- 工程开发
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @okteto · Apache-2.0
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 即装即用
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
第 2 步:确定课程
从用户更正中,提取: 错误:出了什么问题(要具体,而不是通用) 模式:未来应用的具体规则 触发器:应激活此规则的条件
第 3 步:追加条目
在 `.claude/lessons.local.md` 底部、结束评论上方添加一个新条目:使用绝对日期 (YYYY-MM-DD),切勿使用相对日期(“今天”、“上周”)。
第四步:确认
向用户简要报告新条目:
# Lessons Skill
Manages the self-improvement loop. Use this skill when:
- The user corrects a mistake or gives feedback that should change future behavior
- You want to review past lessons at the start of a session
- After completing a task, to capture any patterns worth preserving
## Lesson file
All lessons live in `.claude/lessons.local.md`.
## Workflow: Recording a Lesson
### Step 1: Read the current lessons file
```bash
cat .claude/lessons.local.md
```
### Step 2: Identify the lesson
From the user correction, extract:
- **Mistake**: What went wrong (be specific, not generic)
- **Pattern**: The concrete rule to apply going forward
- **Trigger**: The condition that should activate this rule
### Step 3: Append the entry
Add a new entry at the bottom of `.claude/lessons.local.md`, above the closing comment:
```markdown
## 2026-03-17 — [short title]
**Mistake**: [What went wrong]
**Pattern**: [Rule to apply going forward]
**Trigger**: [When to apply this rule]
```
Use absolute dates (YYYY-MM-DD), never relative ("today", "last week").
### Step 4: Confirm
Report the new entry to the user briefly:
```
Lesson recorded: [short title]
```
## Workflow: Reviewing Lessons
At the start of a session, or when asked:
1. Read `.claude/lessons.local.md`
2. Identify lessons relevant to the current task
3. Internalize them — do not re-state them all back to the user unless asked
4. Apply them silently
## Workflow: Pruning Lessons
Lessons become stale when:
- They reference a pattern that's been fixed in the code
- They duplicate another lesson
- They're too generic to be actionable
When pruning, remove the entry entirely. Don't leave tombstones.
## Rules
- Never invent a lesson that wasn't triggered by an actual correction
- Be specific: "always read the file before editing" is better than "be careful"
- One lesson per entry — don't bundle unrelated corrections together
- Update an existing lesson if a correction refines a known pattern rather than creating a duplicate
章节与文件索引
按说明文件中的顺序排列。
课程文件
第 2 步:确定课程
第 3 步:追加条目
第四步:确认
工作流程:复习课程
文件/命令 -> .claude/lessons.local.md
内容校验值 -> d2414a6b9d2d
当前原文的自动摘译,尚未人工审校。
课程文件
所有课程都在
.claude/lessons.local.md。工作流程:复习课程
在课程开始时,或当被问到时: 阅读
.claude/lessons.local.md识别与当前任务相关的课程 内化它们 — 除非被要求,否则不要将它们全部重新陈述给用户 静默应用它们