adapter
Route to, register, inspect, validate, and run explicitly trusted local private adapters…
Extract lessons learned from the current session. Scans conversation for error→fix patterns, user corrections, and discoveries, then saves structured lessons to the wiki.
> /plugin marketplace add nvk/llm-wiki > /plugin install wiki@llm-wiki
How it fires
How this command gets triggered: by you, by Claude, or both.
/llContext preview
What this command does when you run it.
Extract lessons learned from the current session. Scans conversation for error→fix patterns, user corrections, and discoveries, then saves structured lessons to the wiki.
description: "Extract lessons learned from the current session. Scans conversation for error→fix patterns, user corrections, and discoveries, then saves structured lessons to the wiki." argument-hint: "[\"topic hint\"] [--wiki <name>] [--local] [--dry-run] [--rules] [--include-archived]" allowed-tools: Read, Write, Edit, Glob, Grep, Bash(ls:*), Bash(wc:*), Bash(date:*), Bash(mkdir:*)
**Resolve the wiki.** Do NOT search the filesystem or read reference files — follow these steps: 1. Read `$HOME/.config/llm-wiki/config.json`. If it has `hub_path`, expand leading `~` only (not tildes in `com~apple~CloudDocs`) and prefer that path; use `resolved_path` only as a fallback cache when the expanded `hub_path` is unavailable and `resolved_path` is initialized. If config has only `resolved_path`, use it. If the configured path can be statted but reading `wikis.json` or listing `topics/` fails with `Operation not permitted`, stop and ask the user to grant Full Disk Access/iCloud Drive access to the launcher; do not fall back to `~/wiki` or `resolved_path`. Do not write machine-specific `resolved_path` into shared configs. 2. If no config → read `$HOME/wiki/_index.md`. If it exists → HUB = `$HOME/wiki`. If nothing found, ask the user where to create the wiki. 3. **Wiki location** (first match): `--local` → `.wiki/` in CWD; `--wiki <name>` → `HUB/wikis.json` lookup with portable path resolution (`<HUB>`, `~`, absolute, or HUB-relative); if the registry path is stale, fall back to `HUB/topics/<name>`; CWD has `.wiki/` → use it; else → HUB. 4. Read `<wiki>/_index.md` to verify. If missing and no wiki matches the session topic → offer to create one with `--new-topic`; otherwise target the most relevant existing wiki.
Archive rule: lessons learned go to active topic wikis by default. Skip archived topics when auto-targeting by session topic. If `--wiki <name>` resolves to an archived topic, stop and ask the user to restore it or rerun with `--include-archived`; explicit archived writes must stay inside the archived topic path and keep it archived.
Extract lessons learned from the current session and save them to the wiki's knowledge pipeline.
Inventory awareness: if a lesson implies a durable follow-up, recurring watch item, or source/corpus candidate, suggest an inventory record in addition to the raw lesson note. Do not turn every lesson into inventory; only use it when there is status, priority, or a next action to track.
target wiki.
Lessons-learned captures knowledge that was **learned by doing** — not by reading. The source material is the current session: errors hit, fixes discovered, corrections from the user, configuration changes, gotchas, and patterns that only emerged during implementation.
This differs from other commands:
"learn this", "learn that lesson", "lesson learned", "lessons learned", "absorb this", "capture what we learned", "what did we learn", "session takeaways", "ll"
---
Read the conversation history and identify lesson-worthy events. Look for these signals, in priority order:
Sequences where something failed, was diagnosed, and fixed. Extract:
Moments where the user redirected the approach: "no, not that", "wrong profile", "use X instead", "that's the wrong file." Each correction implies a lesson about what the correct approach is.
Things that worked unexpectedly, or where the solution required non-obvious knowledge. The test: "would this have been obvious to someone starting the same task?"
Files that were created or modified during the session — especially dotfiles, settings, profiles, shell configs. These represent materialized decisions.
Platform-specific behaviors, tool-specific edge cases, or undocumented behaviors encountered. Things that would trip up the next person doing similar work.
---
For each identified event, produce a structured lesson:
## Lesson N: <title> **Category**: gotcha | pattern | rule | discovery | correction **Context**: <what was being done when this was learned> **Symptom**: <the error or failure, if applicable> **Root cause**: <why it happened> **Fix**: <what was done> **Rule**: <the generalizable principle — one sentence that applies beyond this specific case>
Guidelines:
LLM-compiled knowledge bases for any AI agent. Parallel multi-agent research, thesis-driven investigation, source ingestion, wiki compilation, querying, and artifact generation.
Route to, register, inspect, validate, and run explicitly trusted local private adapters…
Archive or restore whole topic wikis so old interests stay preserved but out of default…
Assess a local repo against the active wiki's research body and the broader market. Gap…
Truth-seeking umbrella audit for llm-wiki. Combines active wiki maintenance, output drift…
Export, refresh, verify, or import a comprehensive cross-topic Project Knowledge Checkpoint…