lesson_append
Materializes a class-level lesson into Thread Keeper's shared lessons.md, overwriting the same-title section idempotently after duplicate checks, so agents retain reusable guidance.
Instructions
Materialize a class-level lesson into ~/.threadkeeper/lessons.md.
title is sluggified to a stable key — repeated calls with the same
title overwrite the existing section (idempotent).
body is markdown; goes verbatim into the section body.
summary is an optional one-liner rendered as a blockquote right
after the header. Use when the body is long and a TL;DR helps the
next agent decide whether to read further.
source is a provenance tag — typically a thread id ("Tabc123")
when written by review_thread, or "shadow" when written by the
shadow_review observer. Empty is fine.
Every new lesson passes duplicate gates first. A near-duplicate is
refused with the neighbour's slug: extend it with lesson_patch. A
foreground author who has read that neighbour and is sure the rule is
different may pass its slug as new_despite. A lesson that debunks a
near-duplicate must correct that lesson instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| title | Yes | ||
| source | No | ||
| summary | No | ||
| new_despite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |