Synthesize

From BEKO2210/Firstbrain · View interactive version

Synthesize is an AI agent skill from the GitHub repository BEKO2210/Firstbrain. Generate a topic summary from related vault notes with wiki-link citations and AI provenance metadata

How to use this skill

Skill file

/synthesize -- Knowledge Synthesis

Transforms scattered vault knowledge into connected understanding. Given a topic, Claude discovers related notes, reads their content, and composes a new zettel that synthesizes ideas across sources -- with wiki-link citations and clear AI-generated provenance metadata. The result is a note that tells you "what the vault knows about X" in a way no single note could.

Usage

/synthesize "Docker"                # Synthesize what the vault knows about Docker
/synthesize productivity systems    # Multi-word topic synthesis
/synthesize --top 5 "time mgmt"    # Limit to top 5 most relevant sources

What It Does

The synthesis process has three distinct phases:

| Phase | Action | Details |

|-------|--------|---------|

| Discover | Find related notes | Search by tags, titles, and semantic similarity (if available) |

| Read | Load source content | Read full content of top-N related notes (default: top 10 by relevance) |

| Synthesize | Compose new zettel | Claude reads all source content and writes a coherent summary connecting ideas, identifying patterns, and citing sources via [[wiki-links]] |

This is NOT a list of note summaries -- it is genuine synthesis that connects ideas across notes and adds the "so what?" layer.

Execution Flow

Claude follows these steps when /synthesize is invoked:

  1. Ensure fresh indexes: Call ensureFreshIndexes('.') to rebuild indexes if stale (>5 min).
  1. Discover related notes: Call findTopicNotes('.', topic) from synthesize-utils.cjs. This searches three signal layers:
  1. Check minimum threshold: If fewer than 2 notes are found, respond with:

> "Not enough vault content about '{topic}' to synthesize. Found N note(s). Try a broader topic or add more notes first."

Do not create a note in this case.

  1. Select top N notes from the discovery results (default 10, configurable via --top flag). These become the source notes.
  1. Read full content of each selected note via fs.readFileSync. Pass the complete content to the synthesis step.
  1. Claude composes the synthesis by analyzing all source content:
  1. Create synthesis note: Call createSynthesisNote('.', topic, synthesisContent, sourceNotes) from synthesize-utils.cjs. This writes the note to 03 - Resources/ with full provenance metadata.
  1. Re-scan: Call scan('.') to update vault indexes with the new note.
  1. Add to relevant MOC if one exists for the topic (AUTO zone -- no approval needed).
  1. Log creation to .claude/changelog.md with the note path and source count.

Output Note Format

The generated synthesis note follows vault conventions with additional provenance fields:

---
type: zettel
created: 2026-03-07
updated: 2026-03-07
tags:
  - synthesis
  - docker
synthesized: true
synthesized_by: claude
source_notes:
  - "03 - Resources/Tool -- Docker.md"
  - "01 - Projects/Container Migration.md"
status: active
---

Provenance fields (PROA-06 compliant):

| Field | Purpose |

|-------|---------|

| synthesized: true | Marks note as AI-generated synthesis |

| synthesized_by: claude | Identifies the AI that created it |

| source_notes | Array of vault-relative paths to all source notes |

Body structure:

# Zettel -- {topic}

> Claude-synthesized summary based on vault knowledge.

{synthesis content with [[wiki-links]]}

## Connections

- **Source:** [[Source Note 1]]
- **Source:** [[Source Note 2]]
...

Quality Standards

A good synthesis meets these criteria:

Governance

| Zone | Action | Classification |

|------|--------|----------------|

| Content | Reading source note content | READ-ONLY |

| Content | Reading vault-index, tag-index | READ-ONLY |

| Structure | Creating the new synthesis note in 03 - Resources/ | AUTO |

| Structure | Adding synthesis note to existing MOC | AUTO |

| Content | Modifying source notes | NEVER |

The synthesis references source notes but never edits them. Source notes remain untouched.

Edge Cases

Utility Module

File: synthesize-utils.cjs

Provides topic discovery and note creation functions used during the execution flow:

const { findTopicNotes, createSynthesisNote, topicToTag } = require('./.agents/skills/synthesize/synthesize-utils.cjs');

Function Signatures

findTopicNotes(vaultRoot, topic)

Async function. Discovers notes related to a topic using three signal layers: tag matching (relevance 0.7), title matching (relevance 0.6, +0.3 boost for dual match), and optional semantic search (relevance = similarity * 0.5). Returns array of { path, name, relevance, source } sorted by relevance descending. Excludes templates, atlas notes, and system files.

createSynthesisNote(vaultRoot, topic, content, sourceNotes)

Creates a new zettel in 03 - Resources/ with complete frontmatter including synthesized: true, synthesized_by: claude, and source_notes array. Returns { path, name }. Handles filename collision with date suffix.

topicToTag(topic)

Converts a topic string to a tag-safe identifier. Handles edge cases like "Machine Learning" -> "machine-learning" and "C++" -> "c".

Dependencies

Limitations

Connections

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.