/second-brain:session-recapfrom second-brain
Documents Claude Code sessions by extracting knowledge into cross-referenced documentation. Triggers on 'recap the session', 'summarize the work', or after significant code changes.
Ships in second-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Systematically document Claude Code sessions into the knowledge bank.
Knowledge Bank Location: Read from ~/.claude/plugins/config/second-brain/config.json. Configure via skills/common/setup_kb_path.sh --configure.
Philosophy: Knowledge Bank = BRAIN, not ARCHIVE. Preserve workflows, edge cases, decisions—not verbose traces. Target 95% size reduction, 100% actionable knowledge.
Important: a recap runs in a dedicated recap session, started by the launcher. Not in the session being recapped, and not in whatever session you happen to have open. Phase 1.0 stops it otherwise.
Exit the work session. The SessionEnd hook finishes session.md and, when auto_recap is not
off, stamps recap_status: requested on it.
Start the recap through the launcher, which is also the command the start-of-session notice prints:
<plugin root>/hooks/scripts/recap_launcher.sh --manual {KB_PATH}/_sessions/YYYY-MM-DD/{session_id}/
Under the Herdr TUI or the Herdr app this runs the recap in the pane you typed it in, if that pane is at a
shell prompt, and beside it if something is already running there — which is the case when a session runs
this through its Bash tool: the TUI splits a pane, the app starts a worker that its agents sidebar lists
(ADR-0011). Anywhere else it prints a
command to paste into a new terminal. Either way the recap session carries SECOND_BRAIN_RECAP_OF, which is what makes
its own hooks register it as a recap and never recap it in turn
(ADR-0003).
Typing /second-brain:session-recap <folder> into an ordinary session stops at the gate on purpose. That
session has no recap_of, so finishing the recap there would either write the subject's description onto
the wrong note or leave this session to be recapped as if it had done the work.
If no session folder exists (e.g., hooks were not configured), you can still provide a raw .jsonl transcript path:
Recap the session at /path/to/session-id.jsonl
Two reasons, and the second is why a merely new session is not enough. Running inside the subject would
miss the end of its own conversation, since the transcript has to be fully written before knowledge can be
extracted from it. And the recap now writes the subject's project, tags and summary as well as its
status, so it has to be unambiguous which note is the subject's and which is its own. recap_of, set at
registration from the launcher's marker, is that answer.
recap_launcher.sh --manual <subject folder>/second-brain:session-recap <subject folder> — only inside a recap session; it stops
at the Phase 1.0 gate anywhere elseSkill({ skill: "second-brain:session-recap" })recap-group <key> --complete-at <UTC time>, which starts a session that runs
/second-brain:session-recap --group <key> (see Group Recap)| Setting | Value | Effect |
|---|---|---|
user-invocable | true | Visible in slash menu, Skill tool allowed |
This skill uses RFC 2119 keywords:
Every session recap executes all 5 phases completely — no exceptions. A daily log alone is not a recap; it's a log entry. The knowledge bank compounds from extracted concepts, reflections, and best practices, not from session summaries. Skipping phases produces a diary, not a brain.
Even when processing many sessions in a batch, each session gets its own full Phase 2.1 reflection gate, Phase 2.4 source ingestion plan, Phase 2.7 improvement scan, and Phase 3 document creation. Do not put the sessions of a batch into a single daily log or skip phases for throughput. A group recap is the one case where many sessions share one set of documents: they were declared at launch to be one piece of work, and the phases run once, for the group (see Group Recap).
When recapping multiple sessions (e.g., "recap all sessions since March 29"):
Discover — list all sessions in date range, read each session.md for metadata
Triage — by recap_status on each subject's note, which is the recorded answer rather than a guess:
recap_status | Meaning | Action |
|---|---|---|
done | already recapped | skip; a person's --force requested reopens it, and so does the end hook when the subject's transcript has grown by five assistant records since the recap, unless the note carries recap_exempt (then the inventory of Phase 1.0 is non-empty and Phase 3.0 updates in place) |
exempt | deliberately never recapped: a recap session, a session too small to hold knowledge, or one its launcher declared exempt (recap_exempt on its note) | skip |
deferred | belongs to a recap group (recap_group on its note), and is recapped with its group once the group is declared complete | skip, as exempt is skipped; a person who wants one of them recapped alone uses the launcher, and the group recap then leaves it out |
running | a recap holds the claim, unless it is this session's own subject | skip, unless your recap_of names it, in which case the claim is yours and you proceed |
requested or failed | waiting, or stalled | candidate; claim each one as you reach it |
| empty | never requested | candidate if it has a transcript |
A batch claims each subject itself, because no wrapper ran for the ones it picks up. That is the
difference from the single-subject path in Phase 1.0, where the claim already exists. A subject a person
wants re-requested is cleared with recap_status.sh <folder> clear --force, which removes the status so
the session is requested again at its next exit. A member of a recap group is deferred again at that exit.
Also skip a session with no transcript, and one that is trivial: fewer than five assistant records
(grep -c -m5 '"type":"assistant"'), the same test the end hook applies. Not a count of user messages:
sessions here are long autonomous runs on a handful of prompts, and that test exempted a third of the
real ones. Every candidate gets Phases 1.2 and 5.5 in full — a batch describes every session it recaps.
Process chronologically — full 5-phase workflow per session, each gets its own daily log + extracted docs; a Phase 2.6 proposal blocks the batch until the person answers, and later sessions weigh names proposed earlier (see 2.6)
Parallelize when independent — different projects/topics can use parallel agents; same investigation thread should be sequential for cross-references
Integrate once at end — index regeneration and log append after all sessions, not per session
A recap group is the sessions declared at launch to be recapped together as one piece of work
(GLOSSARY,
ADR-0013). A group
recap is one set of documents distilled from all of them together, where a batch gives every subject a recap
of its own. It runs as /second-brain:session-recap --group <key>, in a session that the group command
started: recap-group <key> --complete-at <UTC time>, called by whatever launched the group, or by a person
with --here. Typed anywhere else it stops at the gate.
The five phases run once, for the group. This section says what differs from a recap of one subject; everything it does not mention is unchanged.
What the run left for you, in the group's state folder, ~/.local/state/second-brain/groups/<key>/:
| File | Holds |
|---|---|
manifest | key; complete_at, when the group was declared complete; log_date, the day of that moment, which dates the daily log; project, the domain most members resolve to, which may be empty; members; and the paths of the next three |
members.tsv | One row for each member this run claimed, tab-separated: session folder, session id, name, domain (- for none), assistant records, digest path. These are your subjects, and no others |
digests/<session id>.md | One member's digest, made by code: a header, the output of parse_transcript.sh <transcript> all, and the member's own Debrief blocks |
left-out.tsv | One row for each member that the group has left out because its transcript is missing or cannot be read, tab-separated: session folder, session id, name, reason. It is the group's whole list as it stands at this run, and it is empty when the group has left nobody out. These members are not subjects |
1.0 Gate, claim, inventory.
Gate. Your own note's recap_of must read group:<key>. If it does not, stop, print this and do nothing else:
This session is not the recap session of group <key>, so recapping here would misfile every member.
Run: ~/.claude/plugins/config/second-brain/bin/recap-group <key> --complete-at <UTC time> --here
Claim. The run claimed every member in members.tsv before it started you, so each reads running
and you make no writer call for it. A listed member that reads anything else was moved by somebody else:
leave it out, and say so in the daily log. Never take a session that is not listed, whatever its
recap_group says: a member that had not ended is left for a later run.
Inventory. grep -rl "^recap-group: <key>" "$KB_PATH" --include="*.md". A non-empty list means this run
is a catch-up, for members that ended after the group's first recap, and Phase 3.0 applies to the group's
documents.
Phase 1: read digests, not transcripts.
manifest and members.tsv, then the digests. A digest stands for 1.1 and 1.3 of its member.=== Errors & Failures ===,
one file modified again and again, a prompt or an inbound message that redirects the work, or a Debrief
block whose next steps name a blocker or an ask. Read only the section you need, with
./scripts/parse_transcript.sh <transcript> <section>; the transcript's path is in the digest's header.members.tsv into chunks of about 15
rows and hand each chunk to a subagent with one brief: for each member, a one-line summary, its outcome,
candidate tags, and any error, rework or ask with the line that shows it; then the patterns it saw across
its chunk. Join what the subagents return. The lines for each member become its description in 5.5, and
the patterns feed Phase 2.project in manifest, when validate_project accepts it. An
empty one goes to Phase 2.6, asked once for the whole group. Each member keeps its own domain, the fourth
column of its row, and a member with none takes the group's.docs/ folder.Phase 2: once. One reflection gate (2.1): its two questions are asked of the group as a whole, and a pattern across members is what a group's reflection records. One improvement scan (2.7); each candidate names the member its evidence comes from. At most one Phase 2.6 question, in this session.
Phase 3: one set of documents.
log_date. It lists every member with a link to its session note,
[[_sessions/<date>/<id>/session|<name>]], so that each member's note shows the entry among its backlinks.
Name the entry for the group and its work, never for a count or a list of its members: a catch-up adds
members and keeps the file name.left-out.tsv: one line that begins
Left out:, each member as a link to its session note followed by its reason. The start-of-session
notice shows a failed recap only from the fourteen newest date folders, so this line is where a person
finds them. Write nothing else about such a member and make no writer call for it: it stays failed, and
recap_launcher.sh --manual <folder> recaps it alone. With an empty file, write no such line.recap-group: <key> in its frontmatter, where a recap of one subject writes
session-folder. That field is what the inventory of a catch-up finds. A proposed improvement carries
session-folder as well, naming the member its evidence comes from.Left out: line from the file as it stands now, so that a member that has since been
recapped drops out of it, and remove the line when the file is empty. Create only what is missing (3.0).Phase 5.5: one call for each member, after 4.1 passed:
"$PLUGIN_ROOT/skills/common/recap_status.sh" "<member folder>" done "$OWN_SESSION_FOLDER" \
--project "<the member's domain>" --tags "<the member's tags>" --summary "<the member's one line>"
Each member's note gets its own project, tags and summary, by the rules of 5.5. A member you cannot describe
is marked failed, with a reason=<text> line in its own recap.log as in 2.6, and the others still
settle. The session ends itself once every member in members.tsv reads done
(ADR-0010); a member that
is not done when the session ends is failed by its wrapper, and a later call of the group command starts
a run for it.
Goal: Load session data and extract facts.
Prompt exactly once in this skill — the domain proposal of Phase 2.6 — and nowhere else. A recap
pane is checked, not watched: the one decision only a person can make may wait for them, and a pane
closed on the open question is recovered by the stale-running notice
(ADR-0007). For
anything else missing, do what needs nothing, record the gap, and mark the subject failed with the
reason. The start-of-session notice asks a person.
(1) Dedicated-session gate. Read your own session's note — its folder is in the SessionStart context
you were given — and require its recap_of to equal the subject folder you were asked to recap:
source "$PLUGIN_ROOT/skills/common/obsidian_helpers.sh"
OWN_RECAP_OF=$(read_frontmatter_prop "$OWN_SESSION_FOLDER/session.md" "recap_of")
If it does not match, stop. Print exactly this and do nothing else:
This session is not a recap session, so recapping here would misfile both sessions.
Run: <plugin root>/hooks/scripts/recap_launcher.sh --manual <subject folder>
Two failures this prevents. A recap run inside a working session would either mark that session's note
with the subject's outcome, or leave it unmarked so that it is itself recapped afterwards; and this skill
writes the subject's project, tags and summary, which in the wrong session overwrites the
description of real work with someone else's.
(2) Verify the claim. Do not re-take it. In every sanctioned path your wrapper already moved the
subject from requested to running before claude started, so the claim is normally yours and calling
the writer for it again would be refused and would leave a misleading refused running->running in
recap.log. Read the status and decide:
SUBJECT_STATUS=$(read_frontmatter_prop "$SUBJECT/session.md" "recap_status")
| Status | What it means | What to do |
|---|---|---|
running, and step 1 matched your recap_of to this subject | your own wrapper claimed it | proceed, and make no writer call |
requested, failed or deferred | the wrapper never claimed: it died first, or the command was pasted without the child script | claim it now with recap_status.sh "$SUBJECT" running, and stop if that is refused |
done | already recapped | stop; a person's --force requested reopens it, as does the end hook once the transcript has grown by five assistant records since the recap, and either lands here as requested |
running, but your recap_of names a different subject, or you have none | another recap holds it | stop |
| empty | nothing requested this | stop; a recap should not invent its own subject |
A refusal is fatal only when this session is not the registered recap session for that subject. That is the distinction step 1 already established, so use it rather than asking the writer a question it will answer with a refusal either way.
(3) Prior recap inventory. A retry resumes rather than starts over, and recap never deletes a document:
grep -rl "^session-folder: _sessions/<date>/<id>" "$KB_PATH" --include="*.md"
One root, not four. Adding daily-log/ projects/ reflections/ beside $KB_PATH gives grep four
search roots, so every hit is printed twice under two different path forms, and the relative ones resolve
only when the working directory happens to be the vault. Phase 3.0 then treats one daily log as two
documents to reconcile, which is the duplication it exists to prevent. $KB_PATH already covers all three
directories.
Record the list. Non-empty means this is a resumed recap, which changes Phase 3.
If session folder provided:
First, read session.md as the hub note for both metadata and content navigation:
obsidian vault="knowledge-bank" read path="_sessions/{date}/{session_id}/session.md"
Frontmatter metadata (supplements later phases):
project, session_name, tags, summary, duration_seconds, started_at, ended_at, transcript_sourceBody navigation — follow session.md body sections:
| Section | Content | How to use |
|---|---|---|
## Generated Artifacts | WikiLinks to docs in docs/ | Read for additional context |
## Transcript | Source path to original .jsonl | Use for parse_transcript.sh |
## Compaction Points | Line counts per segment boundary | Context on session length/compaction |
## Memory Snapshot | WikiLinks to memory/*.md | Read auto-memory for project context |
Then locate the transcript:
# Preferred: read transcript_source from session.md frontmatter (v2.1+)
TRANSCRIPT_SOURCE=$(read_frontmatter_prop "$SESSION_FOLDER/session.md" "transcript_source")
if [ -n "$TRANSCRIPT_SOURCE" ] && [ -f "$TRANSCRIPT_SOURCE" ]; then
TRANSCRIPT="$TRANSCRIPT_SOURCE"
else
# Fallback for old sessions: find latest segment copy
LATEST_SEGMENT=$(ls -d "$SESSION_FOLDER"/segment-* 2>/dev/null | grep -v 'segment-final' | sort -t- -k2 -n | tail -1)
[ -z "$LATEST_SEGMENT" ] && [ -d "$SESSION_FOLDER/segment-final" ] && LATEST_SEGMENT="$SESSION_FOLDER/segment-final"
TRANSCRIPT="$LATEST_SEGMENT/transcript.jsonl"
fi
If no folder (current conversation mode): Skip session.md reading. Analyze current conversation context.
project names a knowledge-bank domain, one of the folders under projects/
(ADR-0004). Non-empty is not the
same as resolved: notes written before that decision hold a directory basename, and hundreds of them
exist. Validate, never trust. Try three sources in order and stop at the first that resolves:
source ../common/resolve_project.sh
# 1. what the note already says, but only if it names a real domain
PROJECT=$(validate_project "$(read_frontmatter_prop "$SESSION_FOLDER/session.md" project)")
# 2. the directory the subject ran in, through the shared map
[ -n "$PROJECT" ] || PROJECT=$(resolve_project "$CWD")
# 3. the conversation itself — choose only from this set, never invent a name
[ -n "$PROJECT" ] || list_project_domains
The third source is yours to judge: read what the session was actually about and pick the domain it
belongs to, drawn only from list_project_domains. You are the first reader with the whole conversation,
which is why this decision is here and not at session start
(ADR-0006).
Phase 5.5 writes the result. Because the note's own valid value is the first source, writing it back overwrites only a value that is not a domain, which is exactly the legacy-basename case.
When no domain fits, defer to Phase 2.6. Do not invent a name here, and do not fail yet: whether this session warrants a new domain is judged against the Phase 2 plan, where the one sanctioned question lives (ADR-0007). Record the project as unresolved and carry on.
Never fall back to ./scripts/parse_transcript.sh project for a decision: it reports the working
directory and the domain that directory maps to, and nothing more. Filing under a name no domain matches
invents the very thing ADR-0004 exists to keep visibly missing.
./scripts/parse_transcript.sh "$TRANSCRIPT" all
Extracts: user requests, files read, files modified, commands, errors, subagents, insights.
Scan session.md body sections and transcript for ingestible knowledge:
./scripts/detect_session_sources.sh "$SESSION_FOLDER" "$TRANSCRIPT"
Outputs classified sources, one per line: artifact|<path>|<description> or reference|<path>|<description>.
| session.md Section | What it contains | Ingest as |
|---|---|---|
## Generated Artifacts | Docs in docs/ (designs, plans, research, investigations, SOPs) | artifact — high-value, already distilled |
## Plans | Claude Code plan files (architectural decisions, implementation approaches) | artifact — captures decision rationale |
## Memory Snapshot | Auto-memory files (project context, lessons learned) | reference — supplements context |
| Transcript | Non-code files read (.md, .pdf, .txt) and URLs fetched (WebFetch) | reference — external knowledge consumed |
Record the classified list for Phase 2.5.
Goal: Determine what to document and whether reflection is required; when Phase 1.2 resolved nothing, whether to propose a domain; and what the session's friction says the environment should change (2.7).
Answer these questions:
| Question | Answer |
|---|---|
| 1. Did this session involve debugging or problem-solving? | YES / NO |
| 2. Did this session discover a workflow pattern? | YES / NO |
Decision:
A reflection records how the work went; it never proposes (GLOSSARY). Tool or process friction is deliberately not a question here: friction is evidence for the Phase 2.7 improvement scan, which is where a suggestion to change the environment belongs.
Record decision for Phase 4 verification.
./scripts/search_cross_references.sh "keyword"
Target 10-15 cross-references distributed across:
See cross-reference-guide.md for methodology.
If external investigation documents exist (100+ KB):
./scripts/detect_external_docs.sh "$SESSION_FOLDER"
./scripts/analyze_for_distillation.sh "$DOC_PATH"
See distillation-guide.md for detailed methodology.
For each source detected in Phase 1.4, decide:
| Decision | When | Action |
|---|---|---|
| Ingest as KB doc | High-value, reusable knowledge (design doc, investigation, best practice) | Create concept/component/best-practice doc (5-8 WikiLinks) |
| Distill and ingest | Large source (>100KB) needing reduction | Apply distillation-guide.md, then create doc |
| Skip | Transient, already covered by daily log, or not knowledge-bearing | Note in daily log only |
Guidelines:
docs/ are high-value by default — they were already distilled during the sessionRecord decisions for Phase 3 creation.
If insights were extracted in Phase 1.3, classify each:
| Insight Content | Classification | Action |
|---|---|---|
| Reveals architectural pattern | Concept | SHOULD create concept doc |
| Describes component behavior | Component | SHOULD update/create component doc |
| Documents methodology | Best Practice | SHOULD create best practice doc |
| Reveals workflow pattern | Reflection | SHOULD create reflection |
| Identifies anti-pattern | Reflection | SHOULD create reflection |
| Suggests an environment change (tool, check, rule, structure) | Proposed improvement | Record as a Phase 2.7 candidate |
| General educational context | Daily Log | MUST include in daily log |
Record classifications for Phase 3.
The one prompt this skill is allowed, and the only place a domain name may be invented — put to the person attending the pane, created only on their answer (ADR-0007). It sits after planning because the plan is the evidence a person approves on.
First, check there is anything to ask about. A domain exists to hold filed knowledge. When the
Phase 2 plan creates no concept, component or best-practice docs, or the docs it does create cohere
into no single domain of work, there is no proposal to make. Keep the failure path: write what needs
no domain, list in the daily log anything that could not be filed and why, then at Phase 5.5 write the
tags and summary, leave project empty, and mark the subject failed with the reason, which the notice
shows to a person:
printf '%s failed reason=%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
"no knowledge-bank domain fits, set project on its note" >> "$SUBJECT/recap.log"
"$PLUGIN_ROOT/skills/common/recap_status.sh" "$SUBJECT" failed --tags "$TAGS" --summary "$SUMMARY"
Write the reason as reason=<text> on its own line in recap.log: the notice reads the last such line
and shows it, so anything else leaves a person with "failed" and nowhere to look. A retry resumes in place
through the Phase 1.0 inventory once the project is set.
Otherwise derive the proposal before asking:
| Field | Rule |
|---|---|
| Name | a slug like every existing domain (^[a-z0-9][a-z0-9-]*$), not already in list_project_domains |
| Description | one line on what the domain holds |
| Rationale | why the nearest existing domains do not fit this work |
| Map entry | the subject's git repository root — its exact cwd when there is none — plus default tags; the cwd comes from ./scripts/parse_transcript.sh "$TRANSCRIPT" project |
| Near miss | the one closest existing domain, for option 2 below |
In a batch, weigh names proposed earlier in the batch before coining another, so sessions about the same work converge on one domain instead of a family of near-synonyms.
Ask with AskUserQuestion: one question, three options. The tool adds a free-text "Other" itself, so say in the question that a different slug typed there creates under that name instead.
<name> (Recommended) — the option description carries the dossier: the one-line
description, the docs that will file under it, the map entry it will add<near miss> instead — the likeliest wrong proposal is a sibling of something that
already fits, so correcting it is one keypressAct on the answer, and record it first — one proposal=<name> line and one decision=<...> line
in recap.log, and a sentence in the daily log:
| Answer | decision= | Then |
|---|---|---|
| Create, or "Other" with a new slug | approved, or renamed:<slug> | "$PLUGIN_ROOT/skills/common/create_domain.sh" <name> --map <prefix> --tags "<tags>", then PROJECT=<name> |
| The near miss, or "Other" naming an existing domain | existing:<domain> | PROJECT=<domain>; create nothing |
| No project | none | PROJECT stays empty; list the unfiled docs in the daily log; Phase 5.5 marks the subject done with --project "" — a person decided, so nothing nags again |
The question blocks until answered, mid-batch included; that is the accepted cost of a synchronous
answer. A pane closed on an open question leaves the subject running, which the stale-running notice
surfaces, and the forced retry re-derives and re-asks.
Walk the transcript against seven categories — navigation, guardrails, steering files, tool economy, tool reliability, information access, validation approach — each with a use when trigger defined in improvement-scan.md. A category fires only on evidence; zero candidates is a legitimate outcome, and no YES/NO gate forces one.
For each candidate record its category, severity, concrete target, evidence, and route:
mechanical and judgment candidates become proposal files in {KB}/_proposals/ (Phase 3,
item 7); a validation-approach candidate that is a technique rather than a mechanizable
check becomes a best-practice doc instead (Phase 3, item 3), where knowledge-bank-lookup can
find it.
Proposals are derived here, ratified by a person later — the same shape as proposed domains and proposed tags, minus the prompt: an improvement never blocks the recap, so nothing here asks. Pending proposals reach a person through the start-of-session notice (ADR-0008).
Record the candidate list and routes for Phase 3 creation and Phase 4 verification.
Goal: Write documentation in priority order.
When the inventory found documents already carrying this subject's session-folder, this is a retry of a
recap that got part-way. You MUST update those documents in place and reuse the existing daily-log
filename rather than choosing a new topic; create only what is missing. Recap never deletes a
knowledge-bank document (ADR-0001), and a
second daily log for one session is how a retry turns into a duplicate that nobody reconciles.
docs/ artifacts, plans). Use 5-8 WikiLinks. Frontmatter: source-type: artifact, ingested-from: {path}source-type: reference, ingested-from: {path or URL}{KB}/_proposals/ per improvement-scan.md, plus one proposed_improvement=<filename> line each in the subject's recap.log| Type | Location | Template |
|---|---|---|
| Concept | {KB}/projects/{project}/concepts/ | concept-template.md |
| Component | {KB}/projects/{project}/components/ | component-template.md |
| Best Practice | {KB}/projects/{project}/best-practices/ | best-practice-template.md |
| Reflection | {KB}/reflections/{category}/ | process-reflection-template.md |
| Proposed improvement | {KB}/_proposals/ | improvement-scan.md |
| Daily Log | {KB}/daily-log/YYYY-MM-DD [Topic].md | daily-log-template.md |
| Category | Folder | Trigger |
|---|---|---|
| Architecture Patterns | architecture-patterns/ | Threading, state, design patterns |
| Development Workflow | development-workflow/ | Utility discovery, test-first, deps |
| Anti-Patterns | anti-patterns/ | Wrong approaches, confusion |
| DX Improvements | dx-improvements/ | Search gaps, missing docs, tools |
Note: These are example categories. The system discovers reflection categories dynamically from subdirectories in
{KB}/reflections/. Create any category folders that fit your workflow.
Every document MUST include:
Verify with:
./scripts/count_wikilinks.sh document.md
---
title: Document Title
aliases: [Alt 1, Alt 2]
tags: [category, topic]
type: concept|component|best-practice|daily-log|reflection
created: YYYY-MM-DD
modified: YYYY-MM-DD
project: Claude Code
session-folder: _sessions/YYYY-MM-DD/{session_id}
source-type: session|artifact|reference # Optional: how this knowledge entered the KB
ingested-from: /path/to/source.md # Optional: provenance for artifact/reference docs
---
The session-folder field applies to ALL recap-created docs (daily log, concepts, components, best practices, reflections). It creates a reverse reference — Obsidian's backlinks panel on session.md will show all KB docs extracted from that session. Omit if no session folder was provided (current conversation mode).
Proposed improvements carry their own frontmatter (type: proposed-improvement, severity,
category, target, classification, session-folder, status), defined in
improvement-scan.md, not this schema.
When obsidian skills are available, MUST invoke before creating knowledge bank documents:
/obsidian:obsidian-markdown
This ensures proper Obsidian Flavored Markdown syntax for:
[[Note]], [[Note#Heading]], [[Note|Display]]> [!note], > [!warning], > [!tip], etc.#tag, #nested/tag![[Note]], ![[image.png]][[Note#^block-id]]Verification: Check if obsidian skills exist in available skills list before creating documents.
Goal: Confirm all requirements met before declaring complete.
./scripts/verify_session_recap.sh \
--kb-path "$KB_PATH" \
--project "$PROJECT" \
--daily-log "YYYY-MM-DD [Topic].md" \
--reflection-required \
--proposals "2026-10-06-slug.md,2026-10-06-other.md"
# --reflection-required or --no-reflection, from the Phase 2.1 decision
# --proposals <comma-separated filenames> or --no-proposals, from the Phase 2.7 scan
./scripts/validate_obsidian_syntax.sh "$DAILY_LOG_PATH"
./scripts/validate_obsidian_syntax.sh "$REFLECTION_PATH" # if reflection created
MUST validate:
[!note], [!warning], etc.)Documentation (MUST verify):
Reflection Gate (MUST verify):
Improvement Scan (MUST verify):
_proposals/ with complete frontmatter and status: pendingrecap.log one proposed_improvement= line eachQuality (MUST verify):
Syntax Validation (MUST verify):
validate_obsidian_syntax.sh exits with code 0 for daily logvalidate_obsidian_syntax.sh exits with code 0 for reflections (if created)Index Maintenance (MUST verify):
_meta/index.md)_meta/log.md)Subject Note (MUST verify):
recap_status to done, in one callIf new categories or significant content: Add links to relevant MOC.
Goal: Update knowledge bank indices and visualizations.
MUST regenerate indices when new documents added to knowledge bank:
./scripts/generate_knowledge_base.sh --project "$PROJECT"
Generates queryable indices for concepts, components, practices, and sessions.
Without this, newly created docs won't appear in _meta/index.md and knowledge-bank-lookup can't discover them via the unified catalog:
source skills/common/generate_index.sh
generate_index "$KB_PATH"
The operation log feeds kb-lint's staleness detection and provides an audit trail of what changed when:
source skills/common/obsidian_helpers.sh
append_kb_log "$KB_PATH" "ingest" "session-recap" "Created: [list created docs]. Updated: [list updated docs]"
MUST update canvas when MOC files modified:
./scripts/generate_moc_canvas.sh "$MOC_PATH"
Creates visual JSON Canvas representation of knowledge relationships.
One call, one lock, one order: project, tags, summary, then the status.
"$PLUGIN_ROOT/skills/common/recap_status.sh" "$SUBJECT" done "$OWN_SESSION_FOLDER" \
--project "$PROJECT" --tags "$TAGS" --summary "$SUMMARY"
All three overwrite what is on the note, deliberately. By now you have read the whole conversation and nothing else ever will, so the values already there were inputs to your decision, not limits on it (ADR-0006). They travel through this one script because it holds a per-folder lock and writes all four inside it, which is what keeps a concurrent SessionEnd rewrite from reading a half-written description.
| Value | What it is |
|---|---|
--project | The domain from Phase 1.2 or 2.6. Pass "" when the person chose no project at 2.6 — done, deliberately domainless. Omit it only when 2.6 had nothing to propose, and mark failed instead of done |
--tags | Canonical tags for the work, from tag-canonicalization.md automatic mode |
--summary | One line on what the session accomplished |
Tags follow tag-canonicalization.md, whose automatic mode is
yours now: load the vault's tags, write every tag that has a canonical form, and coin a tag the vault has
never seen only when the conversation gives repeated evidence for it, such as a tool, component or
technique that recurs. Otherwise record it as a proposed tag in the daily log and in recap.log and write
nothing for it. Do not call the Obsidian CLI for tags: that writes outside the lock and would duplicate or
contradict the write above. An empty --tags writes nothing rather than clearing the note, so a subject
that inherited tags from a fork keeps them when you matched none. project_default_tags from the subject
directory's map entry is a hint to weigh, never a value to pass through unexamined.
Write nothing on your own session's note. Registration already recorded what it is, from the marker the launcher passed. A skill that reclassified the session it runs in is the hazard Phase 1.0 exists to prevent.
| Script | Purpose | Phase |
|---|---|---|
recap_status.sh | Claim the subject, describe it, set its status (the only writer) | 1.0, 1.2, 5.5 |
recap-group (hooks/scripts/recap_group.sh) | Start a group recap's session, with its members claimed and digested | before 1.0 |
parse_transcript.sh | Extract data from session transcript | 1.3 |
detect_session_sources.sh | Detect ingestible references and artifacts | 1.4 |
resolve_project.sh | Resolve and validate a knowledge-bank domain | 1.2 |
create_domain.sh | Create an approved domain: folder, then map entry via --set-domain | 2.6 |
search_cross_references.sh | Find cross-reference targets | 2.2 |
detect_external_docs.sh | Scan for investigation documents | 2.3 |
analyze_for_distillation.sh | Analyze docs for distillation | 2.3 |
count_wikilinks.sh | Count WikiLinks in document | 3 |
verify_session_recap.sh | Final verification gate | 4.1 |
validate_obsidian_syntax.sh | Validate Obsidian markdown syntax | 4.2 |
validate_cross_references.sh | Check for broken WikiLinks | 4.3 |
verify_quality.sh | Verify document quality | 4.3 |
generate_knowledge_base.sh | Generate Obsidian Base indices | 5.1 |
generate_index.sh | Regenerate _meta/index.md content catalog | 5.2 |
append_kb_log | Append operation entry to _meta/log.md | 5.3 |
generate_moc_canvas.sh | Create MOC visualization canvas | 5.4 |
Session recap is complete when:
verify_session_recap.sh exits with code 0--no-proposals was the truthrecap_status is done, with its project, tags and summary written by 5.5 —
project empty when the person chose none at 2.6 — or failed with the reason in recap.log
when 2.6 had nothing to propose. For a group recap, this holds for every member in members.tsvOnly then declare: "✅ Session Recap Complete"
CHANGELOG.md (opens in a new tab)README.md (opens in a new tab)VERSION (opens in a new tab)references/best-practice-template.md (opens in a new tab)references/common-mistakes.md (opens in a new tab)references/completion-checklist.md (opens in a new tab)references/component-template.md (opens in a new tab)references/concept-template.md (opens in a new tab)references/cross-reference-guide.md (opens in a new tab)references/daily-log-template.md (opens in a new tab)references/distillation-guide.md (opens in a new tab)references/distilled-concept-template.md (opens in a new tab)references/improvement-scan.md (opens in a new tab)references/process-reflection-template.md (opens in a new tab)references/quality-standards.md (opens in a new tab)references/templates.md (opens in a new tab)scripts/analyze_for_distillation.sh (opens in a new tab)scripts/count_wikilinks.sh (opens in a new tab)scripts/detect_external_docs.sh (opens in a new tab)scripts/detect_session_sources.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/kb-ingestIngest external sources into the knowledge bank through interactive study or quick filing. Two modes — Quick (summarize → file) and Study (theme-by-theme deep dive with online research and personal notes → multi-layer KB output → optional blog/slack synthesis). Triggers on "ingest this", "study this article", "add to knowledge bank", "learn from this", "process this article", "take notes on this", "what are the key takeaways", "break this down for me", or when user provides external reference material for long-term retention. Also use when user says "let's go through this", wants to deeply engage with a source document, or shares an article/gist/doc and asks about its content./kb-lintHealth-check the knowledge bank for orphan documents, stale content, broken WikiLinks, index drift, and missing frontmatter. Generates a severity-graded report. Use this skill whenever the user mentions lint, health check, KB maintenance, stale docs, broken links, orphan pages, missing references, knowledge bank quality, or hasn't run a check in a while. Also trigger when the user asks "what's not cross-referenced?", "are there any dead links?", or expresses concern about KB quality./knowledge-bank-lookupDelegates knowledge bank lookups to Explore subagents with reflections-first strategy that learns from past mistakes. Checks /reflections/ directory before documentation to extract documented failures to avoid and proven approaches to apply. Automatically triggers when user mentions services ([project-a], [project-b], [project-c], Claude Code), requests investigations, or queries past lessons. Returns structured, actionable insights achieving 69-94% context reduction. (project, gitignored)npx claudepluginhub sxhmilyoyo/sundayhao-plugins --plugin second-brain