Skills / Skills / Notebooklm Create Library
All skills

/ skill

notebooklm-create-library

Skills/notebooklm-create-library.md

Bootstrap a new content library — create the NotebookLM notebook AND the matching Wiki/Libraries/{slug}.md node, atomically.

Open as raw file

Run this skill

Heads up — this skill doesn’t have a structured form yet, so type the full prompt with all decisions baked in (the subprocess can’t answer follow-up questions). Edit me if needed.

Runs with bypassPermissions — local dev only.

notebooklm-create-library

Stand up a content library — backed by a NotebookLM notebook on the cloud side, and a Wiki/Libraries/{slug}.md node on the vault side. The two are 1:1 and stay in sync.

Pre-flight checks

  1. slug is kebab-case (lowercase letters, digits, hyphens; no spaces/underscores).
  2. Wiki/Libraries/{slug}.md does not already exist.
  3. NotebookLM session is valid (Phase 2+). If NOTEBOOKLM_SESSION_PATH is unset OR the session file is missing/expired:
    • Phase 1 (architecture-only): scaffold the wiki node with notebooklm_id: "" and status: pending-installation. Don't fail.
    • Phase 2+: abort with a clear "run notebooklm login first" message.

Procedure

1. Create the NotebookLM notebook (Phase 2+)

  • Use notebooklm-py's create-notebook function with display_name.
  • Capture the returned notebooklm_id (and share URL if supported).

2. Scaffold the wiki node

  • Copy Templates/library.template.md to Wiki/Libraries/{slug}.md.
  • Fill frontmatter:
    • slug, display_name, subject_kind, subject_link
    • notebooklm_id: from step 1 (or empty in Phase 1)
    • created and last_synced and last_summarized: today
    • source_count: 0
    • tags: [library] plus subject_kind-specific tag (person/<slug> if person, brand/<slug> if brand, topic/<slug> if topic).
  • Replace <kebab-case> and <Display Name> placeholders in body.

3. Seed initial sources

If initial_sources non-empty, for each:

4. Cross-link the subject

If subject_link is provided (e.g., <a class="wikilink wikilink-broken" href="#">Wiki/People/naval</a>):

  • Edit the subject node's frontmatter to add library: "<a class="wikilink wikilink-broken" href="#">Wiki/Libraries/{slug}</a>".
  • Append a "Library: Wiki/Libraries/{slug}" line to the subject node's body if not already present.

5. Append Log entry

  • input: slug={slug}, kind={subject_kind}, sources={count}
  • artifacts: <a class="wikilink wikilink-broken" href="#">Wiki/Libraries/{slug}</a>
  • notes: include notebooklm_id (or pending-installation in Phase 1).

Atomicity

If step 1 succeeds but step 2 fails (or vice versa), roll back the side that succeeded so the vault and NotebookLM stay 1:1. Specifically:

  • If notebook created but wiki node write fails: delete the NotebookLM notebook, then re-raise.
  • If wiki node written but notebook creation fails: delete the wiki node.

Hard rules

  • Never create two libraries with the same slug.
  • Never sync sensitive content (Raw/Health/, Context/MI.md, brand compliance docs) into a library — Google retains content per their TOS.
  • Always create the wiki node — even in Phase 1 (architecture-only) the node lets agents start using it as a placeholder.

Failure modes

  • NotebookLM rate-limited — surface to Adam, suggest retry; don't silently fail.
  • Subject link doesn't exist — abort and ask Adam to create the subject node first (e.g., onboard the brand or create the People node).
  • Phase 1 placeholder mode — note in the Log that the notebook side wasn't created; Phase 2 install will need a /library bind {slug} follow-up to attach the wiki node to a freshly-created notebook.