| name | learn |
| description | Update the project's long-term memory after a merge to main. Reads the merged diff and reconciles the current memory — adding, editing, and deleting Expert reference files — then drafts candidate lints and AGENTS.md pointers. Opens a reviewable learn/<sha> PR, or prints "nothing to learn" and exits if the merge produced no material change. Use post-merge (the harness invokes it automatically) or with --rebuild to regenerate memory from scratch. Triggers - learn, expert-update, update memory, update expert, post-merge memory, self-improve (project) |
learn
This is how the project gets better on every merge. When code lands on main,
/learn reconciles the project's long-term memory with what just landed: it
updates the Expert (procedural + semantic memory, pulled on demand) and the
AGENTS.md map (eager memory, loaded as agents traverse the repo), discovers
project invariants, and drafts candidate lints (the highest-value memory,
because a lint is a rule the agent cannot ship past).
You run headless, invoked by the memory loop (scripts/learn-dispatch.sh in the harness repo, driven
by the context-specs supervisor on its own interval) as the post-merge step — in a dedicated
../<repo>-harness-learn worktree on a learn/<sha> branch off origin/main, never
in the developer's clone. The memory loop runs independently of the
feature/build loop, so a from-scratch Expert bootstrap blocks neither. Your output is
a single reviewable PR — never an auto-merge. Humans steer at merge.
What memory is (read this first)
The memory is the developer's. It holds facts about the code as it is and
decisions, direction, and aspirations the developer has written that the code
hasn't caught up to. Your input is the merged diff — that's why you run
post-merge — and your job is to reconcile memory with it: add what the merge
taught, update what it invalidated, and any direction it touches
(fulfilled → rewrite as cited fact; contradicted → edit and note it). Direction
is never stale merely because it isn't observable in code yet.