# Blog Notebooklm > Consulta cuadernos de Google NotebookLM para obtener respuestas ancladas en tus propios documentos y con citas: gestiona la biblioteca de cuadernos, la autenticación con Google y el descubrimiento de contenido. Fuente: https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-notebooklm Markdown: https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-notebooklm.md Repositorio: https://github.com/AgriciDaniel/claude-blog Autor: AgriciDaniel Licencia: MIT Actualizado: hace 19 días Coste de contexto: 133 tok instalada, 2.5k tok al activarse, 28.2k tok con todos los archivos del bundle Bundle: 15 archivos, 110 KB Permisos que pide: ninguno declarado ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent claude-code # Cursor npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent cursor # Codex npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent codex # Gemini CLI npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent gemini # Windsurf npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent windsurf # Cline npx -y skills add AgriciDaniel/claude-blog --skill blog-notebooklm --agent cline ``` ## Qué hace - Abre una sesión de navegador headless por pregunta, recupera la respuesta de los documentos subidos y la cierra - Obliga a pasar por el envoltorio `python3 scripts/run.py`, que crea el venv, instala dependencias y prepara Chrome - Tras cada respuesta obliga a analizar huecos y encadenar preguntas de seguimiento antes de contestar al usuario - Gestiona la biblioteca: listar, añadir con metadatos descubiertos, buscar por palabra clave, activar y eliminar cuadernos - Nunca cita la URL privada del cuaderno como fuente pública: registra el título y la fecha del documento original ## Cuándo usarla - El usuario dice "notebooklm", "consultar cuaderno", "investigación con fuentes propias" o "consulta documental" - blog-write o blog-researcher necesitan contexto anclado en documentos que el usuario ha subido ## Qué la activa - "Pregunta a mi cuaderno de NotebookLM qué dice sobre este tema" - "Añade este cuaderno a la biblioteca" ## Antes de instalar - Necesita cuenta de Google con acceso a NotebookLM, Python 3.11+, Chrome y un login interactivo una sola vez; el plan gratuito limita a 50 consultas al día. - Necesita en el PATH: python3 - Variables de entorno: BLOG_DEBUG, PATCHRIGHT_NO_SANDBOX - makes network requests - reads environment config ## Archivos - SKILL.md — 10 KB - references/commands.md — 6 KB - references/troubleshooting.md — 4 KB - scripts/__init__.py — 3 KB - scripts/ask_question.py — 10 KB - scripts/auth_manager.py — 13 KB - scripts/browser_session.py — 9 KB - scripts/browser_utils.py — 5 KB - scripts/cleanup_manager.py — 10 KB - scripts/config.py — 2 KB - scripts/notebook_manager.py — 16 KB - scripts/requirements.lock — 7 KB - scripts/requirements.txt — 609 B - scripts/run.py — 4 KB - scripts/setup_environment.py — 10 KB ## SKILL.md Reproducido tal cual desde AgriciDaniel/claude-blog bajo MIT. Esta sección es el documento original y está en inglés. # Blog NotebookLM: Source-Grounded Research from Your Documents Query Google NotebookLM notebooks directly from Claude Code for citation-backed answers from Gemini. Each question opens a headless browser session, retrieves the answer from your uploaded documents, and closes. Responses are source-grounded model answers, not proof of truth: uploaded documents may be primary or secondary, and the answer can still omit context. Answers provide usable provenance only when the returned citation identifies a verifiable underlying source. Record a stable source URL and a publication, study-period, or retrieval date when that detail affects verification or interpretation. Use the underlying source title as the inline citation. Do not cite the private NotebookLM URL as the bibliography entry for public content. ## Quick Reference | Command | What it does | |---------|-------------| | `/blog notebooklm ask ` | Query a notebook for source-grounded answers | | `/blog notebooklm discover ` | Smart-discover notebook content before cataloging | | `/blog notebooklm library list` | List all notebooks in library | | `/blog notebooklm library add ` | Add a notebook to library | | `/blog notebooklm library search ` | Search notebooks by keyword | | `/blog notebooklm library remove ` | Remove a notebook from library | | `/blog notebooklm setup` | One-time Google authentication (browser visible) | | `/blog notebooklm status` | Check authentication status | | `/blog notebooklm cleanup` | Clean browser state (preserves library) | ## Prerequisites - Google account with NotebookLM access - Python 3.11+ (venv managed automatically by `run.py`) - Google Chrome (installed automatically on first run via Patchright) - One-time authentication setup (interactive Google login in visible browser) ## Use the run.py Wrapper Call scripts only through the run.py wrapper: `python3 scripts/run.py [script]`: ```bash # CORRECT: python3 scripts/run.py auth_manager.py status python3 scripts/run.py ask_question.py --question "..." # Do not call files under scripts/ directly. The wrapper owns venv setup. ``` The `run.py` wrapper automatically creates `.venv`, installs dependencies, sets up Chrome, and executes the target script. ## Auth Check (Gate Pattern) Before any query operation, check authentication: ```bash python3 scripts/run.py auth_manager.py status ``` - If authenticated: proceed with the query - If not authenticated: inform user and guide to setup: "NotebookLM requires Google login. Run `/blog notebooklm setup` to authenticate." - **When called internally** (from blog-write or blog-researcher): return silently with no error if not authenticated. Never block the writing workflow. ## Setup Workflow For `/blog notebooklm setup`: ```bash # Opens a visible browser for manual Google login (one-time) python3 scripts/run.py auth_manager.py setup ``` Tell the user: "A browser window will open. Please log in to your Google account." Authentication persists via browser profile + cookie injection (hybrid approach). Other auth commands: ```bash python3 scripts/run.py auth_manager.py status # Check auth python3 scripts/run.py auth_manager.py reauth # Re-authenticate python3 scripts/run.py auth_manager.py clear # Clear all auth data ``` ## Query Workflow For `/blog notebooklm ask `: ### Step 1: Check Auth Run auth check (see gate pattern above). If not authenticated, guide to setup. ### Step 2: Resolve Notebook Determine which notebook to query: - If `--notebook-url` provided: validate it is a NotebookLM notebook URL, then use it - If `--notebook-id` provided: look up in library - If neither: use active notebook from library - If no active notebook: show library and ask user to select ### Step 3: Ask the Question ```bash # Basic query (uses active notebook) python3 scripts/run.py ask_question.py --question "Your question here" # Query specific notebook by ID python3 scripts/run.py ask_question.py --question "..." --notebook-id notebook-id # Query by URL directly python3 scripts/run.py ask_question.py --question "..." --notebook-url "https://..." # JSON output (for internal/programmatic use) python3 scripts/run.py ask_question.py --question "..." --json # Show browser for debugging python3 scripts/run.py ask_question.py --question "..." --show-browser ``` ### Step 4: Analyze and Follow Up Every response ends with a follow-up prompt. **Required behavior:** 1. **STOP**: do not immediately respond to the user 2. **ANALYZE**: compare the answer to the user's original request 3. **IDENTIFY GAPS**: determine if more information is needed 4. **ASK FOLLOW-UP**: if gaps exist, immediately ask a follow-up question 5. **REPEAT**: continue until information is complete 6. **SYNTHESIZE**: combine all answers before responding to the user ## Smart Discovery Workflow For `/blog notebooklm discover `: When adding a notebook without knowing its content, query it first: ```bash # Step 1: Discover content python3 scripts/run.py ask_question.py \ --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" \ --notebook-url "" # Step 2: Add with discovered metadata python3 scripts/run.py notebook_manager.py add \ --url "" \ --name "" \ --description "" \ --topics "" ``` Do not guess descriptions; discover or ask the user. ## Library Management ```bash # List all notebooks python3 scripts/run.py notebook_manager.py list # Add notebook (all params required -- discover or ask user!) python3 scripts/run.py notebook_manager.py add \ --url "https://notebooklm.google.com/notebook/..." \ --name "Descriptive Name" \ --description "What this notebook contains" \ --topics "topic1,topic2,topic3" # Search by keyword python3 scripts/run.py notebook_manager.py search --query "keyword" # Set active notebook python3 scripts/run.py notebook_manager.py activate --id notebook-id # Remove notebook python3 scripts/run.py notebook_manager.py remove --id notebook-id # Library statistics python3 scripts/run.py notebook_manager.py stats ``` ## Internal API (for blog-write / blog-researcher) When invoked as a Task subagent from blog-write or blog-researcher: **Input** (provided by calling skill): - `question`: Research question relevant to the blog topic - `notebook_id` or `notebook_url`: Which notebook to query - `context`: "internal" (signals graceful fallback mode) **Process:** 1. Check auth status: if not authenticated, return empty result silently 2. Query the notebook with the research question 3. Parse and return structured response **Output** (returned to calling skill): ```markdown ### NotebookLM Research - **Source:** [Notebook name] - **Question:** [What was asked] - **Answer:** [Source-grounded response from user's documents] - **Underlying Source:** [Public source URL or document identifier] - **Underlying Source Date:** [Publication date or retrieval date] - **Source Quality:** [Tier 1-3 after classifying the underlying document] ``` **Graceful fallback:** If auth is missing or query fails, return immediately with no error. The calling workflow continues with WebSearch-based research. Never block blog-write or blog-rewrite because NotebookLM is unavailable. ## Data Storage All data stored inside the skill directory: - `data/library.json`: Notebook metadata and library - `data/auth_info.json`: Authentication status - `data/browser_state/`: Chrome profile with cookies **Security:** All data directories are gitignored. Never commit auth or browser state. Browser lifecycle and authenticated-context isolation are centralized in `scripts/browser_session.py`. Command scripts must use that helper instead of opening an additional persistent profile or copying cookies into another file. ## Error Handling | Error | Resolution | |-------|-----------| | Not authenticated | Run `/blog notebooklm setup` | | ModuleNotFoundError | Always use `run.py` wrapper | | Browser crash | `cleanup_manager.py --confirm --preserve-library`, then re-auth | | Rate limit (50/day) | Wait until midnight PST or switch Google account | | Notebook not found | Check with `notebook_manager.py list` | | Query timeout (120s) | Retry with simpler question or `--show-browser` to debug | | MCP unavailable (internal) | Return silently: writing workflow uses WebSearch | ## Limitations - No session persistence (each question = new browser session) - Rate limits on free Google accounts (50 queries/day) - Manual upload required (user must add docs to NotebookLM web UI) - Browser overhead (few seconds per question for launch + teardown) - Local Claude Code only (not available in web UI) ## Reference Documentation Load on-demand: do NOT load all at startup: - `references/commands.md`: Full CLI commands, parameters, and workflow patterns - `references/troubleshooting.md`: Error solutions, recovery procedures, debugging ## Dónde encaja - Categoría: [Investigación](https://skillsagentes.com/categorias/investigacion.md) — Investigación estructurada, búsqueda de fuentes y síntesis. - Creador: [AgriciDaniel](https://skillsagentes.com/creators/agricidaniel.md) — 80 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Blog](https://skillsagentes.com/skills/agricidaniel/claude-blog/blog.md): Motor de blog de ciclo completo con 31 subskills, 12 plantillas, puntuación sobre 100 y 5 agentes. Enruta cada petición a la subskill correcta: escribir, reescribir, analizar, auditar, schema, clusters y publicación multilingüe. - [Blog Google](https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-google.md): Integración con las APIs de Google para rendimiento de blog: PageSpeed Insights, CrUX con 25 semanas de histórico, Search Console, URL Inspection, Indexing API, GA4, NLP de entidades, YouTube y Keyword Planner. - [Blog Audio](https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-audio.md): Genera narración en audio de posts con Google Gemini TTS: resumen hablado, lectura completa o diálogo tipo pódcast a dos voces, con 30 voces y salida MP3 más el código de inserción HTML5. - [Blog Image](https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-image.md): Generación y edición de imágenes con IA para contenido de blog mediante Gemini por MCP: portadas, ilustraciones, tarjetas sociales y OG, con 6 modos de dominio y retorno silencioso si el MCP no está disponible. - [Blog Cluster](https://skillsagentes.com/skills/agricidaniel/claude-blog/blog-cluster.md): Motor de clusters temáticos semánticos: investiga keywords desde el SERP, agrupa por intención y solapamiento, construye una arquitectura hub-and-spoke, genera un mapa SVG y ejecuta el cluster llamando a blog-write. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)