Capture a lesson learned
session_capture_lessonRecord mistakes or corrections as structured lessons to prevent future errors. Surface past lessons when similar situations arise, improving accuracy over time.
Instructions
Capture a lesson learned from a mistake or correction. Use this when the user corrects you, expresses frustration, or points out an error. These lessons are surfaced in future sessions to prevent repeating the same mistakes.
Example triggers:
User says "No, you should..." or "That's wrong"
User expresses frustration (caps, "COME ON", "WTF")
Code breaks due to a preventable mistake
The lesson will be tagged with 'lesson' and stored with structured metadata for easy retrieval.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| title | Yes | Lesson title - what to remember (e.g., "Always verify assets in git before pushing") | |
| impact | Yes | What went wrong (e.g., "Production 404 errors - broken landing page") | |
| trigger | Yes | What action caused the problem (e.g., "Pushed code referencing images without committing them") | |
| category | Yes | Category of the lesson | |
| keywords | No | Keywords for matching in future contexts (e.g., ["git", "images", "assets", "push"]) | |
| severity | No | Severity: critical for production issues, high for breaking changes, medium for workflow, low for minor | medium |
| prevention | Yes | How to prevent in future (e.g., "Run git status to check untracked files before pushing") | |
| project_id | No | Project ID (UUID). | |
| workspace_id | No | Workspace ID (UUID). |