Suggest and select high-value past OpenCode sessions, extract James's durable preferences and principles, and synthesize them into AGENTS.md plus focused brain docs in the active repository. Use when James says things like "synthesize my brain", "use the last N sessions", "high-value conversations", or "distill my preferences/taste/guidance".
Run this skill as a one-shot agent workflow. James should not need to run scripts manually.
Parse scope from James's prompt.
ses_... IDs are present, use those directly.Suggest top candidates from history.
Run (agent-internal):
python3 ~/.config/opencode/skills/synthesize-brain/scripts/export_session_corpus.py \
--suggest 6 \
--recent-window 60 \
--query "<original user prompt>" \
--directory "<active repo absolute path>" \
--format markdown \
--output /tmp/brain-session-candidates.md
Show a short shortlist (3-6) with ID, title, date, and reason.
Confirm final selection.
Export corpus for selected sessions.
Run with explicit IDs:
python3 ~/.config/opencode/skills/synthesize-brain/scripts/export_session_corpus.py \
--session-id ses_a \
--session-id ses_b \
--format markdown \
--output /tmp/brain-corpus.md
Or auto-select N:
python3 ~/.config/opencode/skills/synthesize-brain/scripts/export_session_corpus.py \
--auto-select 3 \
--query "<original user prompt>" \
--directory "<active repo absolute path>" \
--format markdown \
--output /tmp/brain-corpus.md
Extract and classify durable principles.
references/synthesis-playbook.md.Source: ses_xxx - "quote".Synthesize into the active repository.
AGENTS.md with concise hard guardrails only.BRAIN.md with richer principles, rationale, and evidence.AGENTS.md only when guidance is clearly directory-specific.Return a synthesis report.
AGENTS.md short; move detail into BRAIN.md.