Get the FREE Ultimate OpenClaw Setup Guide →

nlm-new-topic

Scanned
npx machina-cli add skill dortort/skills/nlm-new-topic --openclaw
Files (1)
SKILL.md
7.5 KB

NLM New Topic — NotebookLM Learning Package Creator

Creates a complete NotebookLM learning package for any topic using the NLM CLI (/Users/user/.local/bin/nlm).

Input Format

/nlm-new-topic <topic> [--url <url1> --url <url2>] [--file <path>]
  • <topic> is required
  • --url and --file are optional; if provided, these sources are added alongside auto-research

Workflow

Execute the following 6 phases in order. Announce each phase as you enter it.


Phase 1: Create Notebook

Create the notebook and capture its ID:

nlm notebook create "<topic>"

Capture the notebook ID from the output. This ID is used in every subsequent command.

If notebook creation fails, run nlm doctor and report the error to the user. Do not proceed.


Phase 2: Research & Add Sources

Step 2a — Add user-provided sources first (if any):

For each --url argument:

nlm source add <notebook_id> --url <url> --wait

For each --file argument:

nlm source add <notebook_id> --file <path> --wait

Run these in parallel if multiple sources are provided.

Step 2b — Auto-research:

nlm research start "<topic>" -n <notebook_id> -m deep

This runs deep research (~5 minutes, ~40 sources). Then poll until complete:

nlm research status <notebook_id> --max-wait 300

Once complete, import all discovered sources:

nlm research import <notebook_id>

Step 2c — Verify source count:

nlm source list <notebook_id>

If fewer than 3 sources total, run a second fast research pass with a rephrased/broader query:

nlm research start "<broader topic query>" -n <notebook_id> -m fast
nlm research status <notebook_id> --max-wait 120
nlm research import <notebook_id>

If still 0 sources, ask the user to provide manual URLs.


Phase 3: Summary Artifacts

Fire all 5 summary artifact creation commands in parallel (do NOT wait between them):

nlm slides create <notebook_id> --focus "<topic>" -y
nlm video create <notebook_id> --focus "<topic>" -y
nlm audio create <notebook_id> --format deep_dive --focus "<topic>" -y
nlm report create <notebook_id> --format "Briefing Doc" -y
nlm mindmap create <notebook_id> --title "<topic>" -y
  • slides → summary slide deck
  • video → summary video overview
  • audio → audio overview (podcast-style deep dive)
  • report → briefing document
  • mindmap → topic mind map

All commands use -y to skip confirmation prompts.


Phase 4: Topic Decomposition

Get the AI summary of notebook content:

nlm notebook describe <notebook_id>

Then ask the notebook to decompose the topic into learning units:

nlm notebook query <notebook_id> "Break the topic '<topic>' into sequential learning units of roughly equal information density. Each unit should have a short title (3-6 words) and a one-sentence description. Order them logically: foundational concepts first, then intermediate, then advanced. Return as a numbered list with format: 'N. Title — Description'. Target count: 4-7 units."

Parse the response to extract unit titles for use as --focus parameters in Phase 5.

Adjust target count based on source richness:

  • Fewer than 5 sources → aim for 3-4 units
  • 5-9 sources → aim for 4-5 units
  • 10+ sources → aim for 5-7 units

Phase 5: Per-Unit Artifacts

Fire ALL per-unit artifact creation commands in parallel (maximize throughput):

For every learning unit, fire both commands simultaneously:

nlm infographic create <notebook_id> --focus "<unit title>" -y
nlm video create <notebook_id> --focus "<unit title>" -y

For example, with 5 units this fires 10 commands in parallel.

Error handling — retry with backoff:

If any command fails, retry up to 3 times with increasing backoff:

  1. Retry 1: Wait 30 seconds, then retry
  2. Retry 2: Wait 60 seconds, then retry
  3. Retry 3: Wait 120 seconds, then retry

If a command still fails after all retries and the error contains "Try again later":

  • Stop retrying that artifact type (e.g., all remaining infographics)
  • Tell the user which artifacts failed and that the cause is likely a daily creation limit imposed by NotebookLM on their account tier
  • List the exact commands the user can run manually later (tomorrow) to create the missing artifacts
  • Continue with any other artifact types that are still succeeding

Phase 6: Verify, Order & Report

Step 6a — Check artifact status:

nlm studio status <notebook_id> --json

Poll up to 3 times with 60-second intervals until all artifacts show complete status.

Step 6b — Rename videos in sequence order:

Use nlm studio rename to create a numbered playlist:

nlm studio rename <summary_video_id> "00 - <topic> Overview"
nlm studio rename <unit1_video_id> "01 - <unit1 title>"
nlm studio rename <unit2_video_id> "02 - <unit2 title>"

Continue for each unit video in learning order.

Step 6c — Present final report:

## Learning Package Complete: <topic>

**Notebook ID:** <notebook_id>
**Notebook URL:** https://notebooklm.google.com/notebook/<notebook_id>

### Sources
- <count> sources (N researched + M user-provided)

### Summary Artifacts
- Slide deck (full topic overview)
- Video overview: "00 - <topic> Overview"
- Audio overview (deep dive podcast)
- Briefing document
- Mind map

### Learning Units (Video Playlist Order)
- **01 - <unit1 title>** — Infographic + Video
- **02 - <unit2 title>** — Infographic + Video
- ...

### Download Commands
nlm download slide-deck <notebook_id>
nlm download video <notebook_id>
nlm download audio <notebook_id>
nlm download report <notebook_id>
nlm download infographic <notebook_id>
nlm download mind-map <notebook_id>

Error Handling

ScenarioAction
Notebook creation failsRun nlm doctor and report to user
0 sources foundTry broader query; if still 0, ask user for manual URLs
Artifact creation failsRetry up to 3 times with backoff (30s, 60s, 120s)
Artifact hits daily limitIf error contains "Try again later" after retries, stop retrying that type, inform user of likely daily limit, list commands for manual creation
Artifact stuck processingPoll up to 3 times at 60s intervals; note incomplete items in report

Key NLM CLI Flags Reference

CommandKey Flags
research start-n <notebook_id>, -m deep/fast, -s web/drive
research status-t <task_id>, --max-wait 300, --full
research importnotebook_id, optional task_id (auto-detects)
source add--url, --file, --youtube, --text, --wait
studio status--full/-a, --json/-j
studio rename<artifact_id> "<new_title>"
audio create--format deep_dive/brief/critique/debate, --focus
report create--format "Briefing Doc"/"Study Guide"/"Blog Post"
mindmap create--title "<title>"
download video--id <artifact_id>, -o <output_path>
All artifact creates-y (skip confirmation), --focus "<topic>"

Source

git clone https://github.com/dortort/skills/blob/main/skills/nlm-new-topic/SKILL.mdView on GitHub

Overview

nlm-new-topic auto-builds a NotebookLM learning package for any topic. It creates the notebook, performs source research (including user-provided URLs/files and deep auto-research), generates multi-format summaries (slides, video, audio, report, mindmap), decomposes the topic into learning units, and produces per-unit infographics and video overviews. Optional sources are supported.

How This Skill Works

The tool creates a NotebookLM notebook, adds any user-provided sources, then runs deep auto-research to gather ~40 sources. It ensures a minimum source count, imports sources, and fires five summary artifacts in parallel (slides, video, audio, report, mindmap). It asks the AI to decompose the topic into 4-7 learning units, then generates per-unit infographics and video overviews in parallel, keyed to each unit.

When to Use It

  • You need a ready-to-use, self-contained NotebookLM learning package for a new topic
  • You want multi-format learning assets (slides, video, audio, report, mindmap) for teaching or onboarding
  • You require a structured topic breakdown into sequential learning units (foundational to advanced)
  • You want to include sources from URLs or files to enrich the package
  • You want a fast, automated starter pack to kick off a course or self-study module

Quick Start

  1. Step 1: Run /nlm-new-topic <topic> [--url <url1> --url <url2>] [--file <path>]
  2. Step 2: Wait for notebook creation, research, and artifact generation to complete
  3. Step 3: Review per-unit infographics and video overviews, then use the unit-focused artifacts for study or teaching

Best Practices

  • Provide at least 3 sources to ensure rich coverage and robust unit decomposition
  • Include a mix of URLs and local files if available for diverse perspectives
  • Review the generated unit titles and adjust focus per unit to match your objectives
  • Trust the Phase 3 artifacts (slides, video, audio, report, mindmap) as reference material for learners
  • Aim for topics that can be broken into 4-7 units for optimal pacing

Example Use Cases

  • Quantum computing basics for engineers
  • Intro to Python data visualization with matplotlib
  • Sustainable energy fundamentals for product teams
  • Neural networks basics for product managers
  • Photovoltaics in solar energy: a topic pack

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers