synthesis_lesson
Capture reusable knowledge when you solve a problem or discover a technique.
When to Call
Create a lesson when you:
- Fix a bug and identify the root cause
- Find a solution to a tricky problem
- Discover a useful technique or pattern
- Learn something that could help in future sessions
Lesson Types
| Type | Use For |
|---|---|
incident | Bug fixes, errors solved, problems debugged |
pattern | Useful techniques, best practices, approaches |
Input Schema
| Parameter | Type | Required | Description |
|---|---|---|---|
project_id | string | Yes | Project ID from synthesis_start |
type | "incident" | "pattern" | Yes | Type of lesson |
title | string | Yes | Short title |
what_happened | string | Yes | Problem or context |
solution | string | Yes | How it was solved |
keywords | string[] | No | Search keywords |
Example: Incident
{
"project_id": "my-api-project",
"type": "incident",
"title": "JWT tokens expiring immediately",
"what_happened": "Tokens were expiring right after creation in production",
"solution": "Server was using local time, client expected UTC. Fixed by using Date.now()",
"keywords": ["jwt", "token", "expiry", "timezone", "utc"]
}
Example: Pattern
{
"project_id": "my-api-project",
"type": "pattern",
"title": "Atomic file writes",
"what_happened": "Needed to prevent config file corruption during writes",
"solution": "Write to temp file, fsync, then rename. Atomic on POSIX systems.",
"keywords": ["file", "write", "atomic", "corruption"]
}
Response
{
"success": true,
"lesson_id": "2026-02-24-jwt-tokens-expiring",
"type": "incident",
"title": "JWT tokens expiring immediately",
"message": "Lesson created and indexed for future searches"
}
Cross-Project Learning
Lessons are stored in your account and searchable across all projects. A bug fix in one project can help you in another.