error-experience-library
错误经验库:自动捕获错误模式、根因和解决方案,支持查询和反馈更新。 当遇到 build error、runtime error 或需要查找历史错误解决方案时使用。
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 1.6k
- Forks
- 491
01 前言 Front Matter
- name
- error-experience-library
- description
- 错误经验库:自动捕获错误模式、根因和解决方案,支持查询和反馈更新。 当遇到 build error、runtime error 或需要查找历史错误解决方案时使用。
02 资源文件 1
- 参考文档agents/openai.yaml1.6 KB
03 SKILL.md 正文
Error Experience Library
用途
- 自动从错误中学习:每次错误解决后,将根因-解决方案对沉淀到经验库
- 历史查询:遇到错误时,先查询经验库是否有已知模式
- 反馈更新:根据实际解决结果更新经验库的成功/失败计数
- 持续优化:高成功率的模式优先推荐,低成功率的模式标记为警示
核心操作
1. 记录错误模式 (record)
当成功解决一个错误后,将经验沉淀:
错误类型: [如: build_error, runtime_error, type_error]
错误信息片段: [可匹配的关键词]
根因: [为什么会发生]
解决方案: [如何修复]
语言/框架: [如: python, typescript, react]
文件模式: [可选,如: **/*.ts]
标签: [如: null-check, async, import]
2. 查询错误模式 (search)
遇到错误时,先查询经验库:
查询关键词: [错误信息或类型]
返回: 按成功率排序的匹配模式
3. 提供反馈 (feedback)
解决方案验证后,更新成功率:
pattern_id: 模式ID
success: true/false
存储位置
- 本地:
~/.claude/memory/error_experience/patterns/ - 每个模式一个 JSON 文件,包含 success_count 和 failure_count
触发信号
- 遇到 build error 或 runtime error 时
- 成功解决错误后,应该记录到经验库
- 使用
/error-lookup命令快速查询
配合约束
- 记录时尽量包含具体的错误信息片段,便于后续匹配
- 根因要具体,不要只写"代码有 bug"
- 解决方案要包含具体的修改内容
- 标签要准确,便于按领域查询
- 验证结果后务必提供反馈,更新成功率
相关工具
scripts/lib/memory_store.py- 底层存储接口search_error_patterns()- 查询模式save_error_pattern()- 保存新模式record_pattern_feedback()- 记录反馈
命令接入
/error-lookup <关键词>- 查询历史错误模式/error-record- 记录当前错误的解决方案/error-feedback <pattern_id> <success|failure>- 更新反馈
04 同仓库更多 Skills
worktable-review-with-annotations
Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.
worktable-find-and-synthesize-context
Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.
worktable-create-or-update-docs
Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.
worktable-create-or-manage-records
Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.
worktable-create-or-manage-interactive-html
Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.
worktable-collaborate-threads
Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.