self-reflection
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSelf-Reflection
自我反思
Use this skill when a task was particularly difficult, required multiple retries, or resulted in unexpected behavior/errors. The goal is to analyze what went wrong and store actionable insights to avoid future mistakes.
当任务执行特别困难、需要多次重试,或出现意外行为/错误时,请使用此技能。目标是分析问题所在,并存储可落地的见解,以避免未来重蹈覆辙。
Core Principles
核心原则
When reflecting on mistakes, consider these guidelines:
- Never Fabricate - Don't invent numbers, counts, paths, or URLs without verifying
- Verify Before Asserting - Read files, check paths, run commands to get real data
- Admit Uncertainty - Say "I don't know" rather than guessing with false confidence
- Be Consistent - Follow established output formats, count before stating counts
- Self-Correct Promptly - Acknowledge errors immediately, don't defend mistakes
反思错误时,请遵循以下准则:
- 绝不捏造 - 未经验证,不要编造数字、数量、路径或URL
- 先验证再断言 - 读取文件、检查路径、运行命令以获取真实数据
- 承认不确定性 - 与其带着虚假的自信猜测,不如说“我不知道”
- 保持一致性 - 遵循既定的输出格式,先统计再陈述数量
- 及时自我修正 - 立即承认错误,不要为错误辩解
Workflow
工作流程
1. Verify Output
1. 验证输出
Before concluding a task, always verify the final output against the user's original request and any relevant project specifications. Ensure all expected files, data points, and behaviors are present.
在完成任务前,始终对照用户的原始请求和相关项目规范验证最终输出。确保所有预期的文件、数据点和行为都已存在。
2. Analyze the Hiccup
2. 分析问题
If the verification fails or if the task was particularly difficult, review the conversation history and tool outputs to identify exactly where the execution deviated from the plan or encountered friction.
Ask yourself:
- What was the expected outcome?
- What actually happened?
- At what step did things go wrong?
- Was the error in understanding, execution, or verification?
如果验证失败,或任务执行特别困难,请回顾对话历史和工具输出,准确定位执行过程中偏离计划或遇到阻碍的具体环节。
自问:
- 预期结果是什么?
- 实际发生了什么?
- 问题出在哪个步骤?
- 错误是源于理解偏差、执行失误还是验证疏漏?
3. Draft a Reflection
3. 撰写反思记录
Summarize the issue, the root cause, and the specific strategy or "golden rule" that would have prevented it.
Reflection Template:
markdown
undefined总结问题、根本原因,以及能避免该问题的具体策略或“黄金准则”。
反思模板:
markdown
undefined{Date} - {Task/Tool Name}
{日期} - {任务/工具名称}
- Issue: {Brief description of the hiccup}
- Root Cause: {Why it happened}
- Lesson: {Actionable instruction for future self}
undefined- 问题:{对问题的简要描述}
- 根本原因:{问题产生的原因}
- 经验教训:{对未来自我的可落地指导}
undefined4. Human-in-the-Loop
4. 人工介入确认
Present the drafted reflection to the user:
- Explain what you intend to save to memory
- Ask for their agreement
- Ask if they have any additional input or corrections
将撰写好的反思记录呈现给用户:
- 说明你打算保存到内存中的内容
- 请求用户同意
- 询问用户是否有额外的意见或修正建议
5. Record to Memory
5. 记录到内存
Once approved, save the insight to a persistent location:
- Create or update a file like
memories/lessons-learned.md - Or use a task-specific file under
memories/troubleshooting/ - If no memory system is available, present the reflection for the user to save
获得批准后,将见解保存到持久化位置:
- 创建或更新类似的文件
memories/lessons-learned.md - 或保存到下的任务专属文件中
memories/troubleshooting/ - 如果没有可用的内存系统,请将反思记录呈现给用户,由用户自行保存
Example Entry
示例记录
markdown
undefinedmarkdown
undefined2026-01-30 - File Path Verification
2026-01-30 - 文件路径验证
- Issue: Assumed a config file existed at the expected path without checking
- Root Cause: Made an assumption based on typical project structure instead of verifying
- Lesson: Always use or equivalent to verify file existence before attempting to read or modify
test -f
undefined- 问题:未检查就假设配置文件存在于预期路径
- 根本原因:基于典型项目结构做出假设,而非实际验证
- 经验教训:在尝试读取或修改文件前,务必使用或等效命令验证文件是否存在
test -f
undefinedWhen to Trigger Self-Reflection
触发自我反思的场景
- Task required more than 2 retry attempts
- User had to correct an error in your output
- Tool call failed unexpectedly
- Output didn't match user expectations
- You had to apologize for a mistake
- 任务需要2次以上重试
- 用户必须纠正你输出中的错误
- 工具调用意外失败
- 输出不符合用户预期
- 你需要为错误道歉
Categories of Common Issues
常见问题分类
| Category | Example | Prevention |
|---|---|---|
| Assumption | Assumed file exists | Verify before acting |
| Misread | Misunderstood user intent | Clarify ambiguous requests |
| Tool Misuse | Wrong parameters | Check tool documentation |
| Fabrication | Made up a count or path | Always verify with tools |
| Incomplete | Missed a step | Review checklist before completing |
| 分类 | 示例 | 预防措施 |
|---|---|---|
| 假设偏差 | 假设文件存在 | 行动前先验证 |
| 理解错误 | 误解用户意图 | 澄清模糊的请求 |
| 工具误用 | 参数错误 | 查阅工具文档 |
| 信息捏造 | 编造数量或路径 | 始终通过工具验证 |
| 内容缺失 | 遗漏步骤 | 完成前检查核对清单 |
Benefits
优势
- Pattern Recognition - Identify recurring mistakes
- Continuous Improvement - Build a knowledge base of lessons
- Accountability - Document what went wrong and why
- Prevention - Avoid repeating the same mistakes
"The only real mistake is the one from which we learn nothing." — Henry Ford
- 模式识别 - 识别重复出现的错误
- 持续改进 - 构建经验教训知识库
- 责任追溯 - 记录问题及其产生原因
- 错误预防 - 避免重复犯相同的错误
“唯一真正的错误是我们从中学不到任何东西的错误。”——亨利·福特