add_lesson
Record a lesson learned with summary and optional detail, domain, source, and validation. Use when explicitly stating a pitfall or technical finding.
Instructions
记录单条经验教训(你已经知道要记什么)。 / Record one lesson learned when you already know what to save.
**Lifecycle: writeback** — 对话中学到可复用的经验时调用。
Lifecycle: writeback — call when reusable experience is learned during conversation.
用途:用户明确说出一条踩坑经验或技术发现时调用。
Purpose: Call when the user explicitly states a lesson, pitfall, or technical finding.
注意:如果用户给了一段会话摘要让你自动提取,请用 extract_session_insights 而不是本工具。
Note: If the user gives a session summary for automatic extraction, use extract_session_insights instead.
Args:
summary: 教训的一行摘要。 / One-line lesson summary.
detail: 详细说明(可选)。 / Detailed explanation (optional).
domain: 技术领域(可选),可填多个,逗号分隔,如 'python,testing'。 / Technical domain (optional); may contain multiple comma-separated labels such as 'python,testing'.
source_tool: 记录来源工具,如 'claude_code', 'codex'(可选,建议填写)。 / Source tool, such as 'claude_code' or 'codex' (optional but recommended).
source_url: 如果教训来自外部内容,填写来源 URL(可选)。 / Source URL when the lesson comes from external content (optional).
source_agent: 产生/校验此条目的 agent 身份(可选,如 'claude_code',比 source_tool 更细)。 / Agent identity that produced or validated this entry (optional; finer-grained than source_tool).
run_id: 产生此条目的工作流/会话运行 ID(可选)。 / Workflow/session run id that produced this entry (optional).
last_validated_at: 人/agent 最近确认此条目仍然成立的 ISO-8601 时间(可选)。 / ISO-8601 time this entry was last confirmed to still hold (optional).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | ||
| detail | No | ||
| domain | No | ||
| source_tool | No | ||
| source_url | No | ||
| source_agent | No | ||
| run_id | No | ||
| last_validated_at | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |