synthesis_lesson

Capture reusable knowledge when you solve a problem or discover a technique.

When to Call

Create a lesson when you:

Lesson Types

TypeUse For
incidentBug fixes, errors solved, problems debugged
patternUseful techniques, best practices, approaches

Input Schema

ParameterTypeRequiredDescription
project_idstringYesProject ID from synthesis_start
type"incident" | "pattern"YesType of lesson
titlestringYesShort title
what_happenedstringYesProblem or context
solutionstringYesHow it was solved
keywordsstring[]NoSearch 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.