Skip to content

Commit d3fac3b

Browse files
CreatmanCEOclaude
andauthored
P0–P2 polish: badges, architecture diagram, output mock-up, RU mirror, CI (#1)
P0 — credibility & accuracy - Hero: badges for License, Stars, Validate CI, Built on notebooklm-mcp-cli, Claude Code Opus 4.7, MCP, platforms - Hero blurb leads with concrete production proof: 7 commands, 41K-message Telegram forum tested, 30+ frameworks - Flagship value-prop quote ("MCP server = hands · workflow commands = hands + a checklist") elevated to a callout under the hero - Topics + description applied via gh api after merge P1 — structural strengthening - docs/architecture.svg — pipeline diagram showing how a single slash command drives a deterministic three-phase recipe (Collect → Analyse → Artifacts) over notebooklm-mcp-cli MCP tools - docs/output-mockup.svg — visual mock-up of /research output: structured findings, patterns, contradictions with inline citations - "What /research returns" section anchored by output-mockup.svg - "Measured impact" table — 5 production scenarios with before/after numbers - "When to use which research command" decision helper - "Limitations" section — cookie expiry, 500K word cap, /edit-source workaround caveat, forum heuristic, opaque rate limits, Claude Code only, Windows-only notifications, upstream MCP dependency - "Related" cross-links to all three sister repos: claude-code-antiregression-setup, ai-context-hierarchy, claude-statusline - Project structure tree now matches actual filesystem - CLAUDE.md — Level 1 file documenting architecture, key files, CRITICAL RULES, commands, patterns. Pairs with ai-context-hierarchy. - CHANGELOG.md (Keep a Changelog) starting at 0.1.0 → 0.2.0 - CONTRIBUTING.md with priority list (Linux/macOS native notifications, expanded URL dictionary, new slash commands, locale translations, chunker improvements for WhatsApp/Discord/Slack) - .github/workflows/validate.yml — bash -n, ShellCheck error severity, Python compile, command frontmatter check, SVG well-formed XML, every docs/* asset referenced from README exists, internal Markdown links resolve P2 — content - README.ru.md fully mirrored to the new EN structure with the same badges, diagrams, Limitations, Measured impact, Related, decision helper. Russian-language hero blurb leads with the same production numbers. - Author signature expanded with Habr / dev.to profile links Excluded (P3 separate work): - Habr / dev.to companion article (no NotebookLM-specific article exists yet; documented as next traffic-driver in CHANGELOG notes) - Issue / PR to jacob-bd/notebooklm-mcp-cli proposing reciprocal link - awesome-claude-code submission (channel still locked for non-collaborators) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 35f9c24 commit d3fac3b

9 files changed

Lines changed: 721 additions & 240 deletions

File tree

.github/workflows/validate.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Validate
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
validate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: LICENSE exists
16+
run: test -s LICENSE || (echo "::error::LICENSE missing or empty" && exit 1)
17+
18+
- name: CHANGELOG.md exists
19+
run: test -s CHANGELOG.md || (echo "::error::CHANGELOG.md missing or empty" && exit 1)
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.12'
24+
25+
- name: Python compile check
26+
run: |
27+
set -e
28+
fail=0
29+
for f in $(git ls-files '*.py'); do
30+
if ! python -m py_compile "$f"; then
31+
echo "::error file=$f::python compile error"
32+
fail=1
33+
fi
34+
done
35+
exit $fail
36+
37+
- name: Bash syntax check on .sh files
38+
run: |
39+
set -e
40+
fail=0
41+
for f in $(git ls-files '*.sh'); do
42+
if ! bash -n "$f"; then
43+
echo "::error file=$f::bash syntax error"
44+
fail=1
45+
fi
46+
done
47+
exit $fail
48+
49+
- name: ShellCheck (error severity)
50+
# Severity 'error' only — style warnings (SC1090, SC2034, SC2155 etc.)
51+
# are not gated here; track them separately if desired.
52+
uses: ludeeus/action-shellcheck@master
53+
with:
54+
severity: error
55+
scandir: '.'
56+
57+
- name: Every command file has a heading and a parameter section
58+
run: |
59+
set -e
60+
fail=0
61+
for f in $(git ls-files 'commands/*.md'); do
62+
if ! head -5 "$f" | grep -qE '^# /'; then
63+
echo "::error file=$f::missing '# /command' heading on first line"
64+
fail=1
65+
fi
66+
done
67+
exit $fail
68+
69+
- name: SVG files are well-formed XML
70+
run: |
71+
set -e
72+
fail=0
73+
for f in $(git ls-files 'docs/*.svg' '*.svg'); do
74+
if ! python -c "import xml.etree.ElementTree as ET; ET.parse('$f')" 2>/dev/null; then
75+
echo "::error file=$f::malformed SVG XML"
76+
fail=1
77+
fi
78+
done
79+
exit $fail
80+
81+
- name: All docs/* assets referenced from README exist
82+
run: |
83+
set -e
84+
fail=0
85+
for ref in $(grep -hoE 'docs/[a-zA-Z0-9_/-]+\.(svg|png|jpg|jpeg|gif)' README.md README.ru.md | sort -u); do
86+
if [ ! -f "$ref" ]; then
87+
echo "::error file=README.md::missing referenced asset $ref"
88+
fail=1
89+
fi
90+
done
91+
exit $fail
92+
93+
- name: Internal Markdown links resolve
94+
run: |
95+
set -e
96+
fail=0
97+
for src in README.md README.ru.md CHANGELOG.md CONTRIBUTING.md CLAUDE.md; do
98+
[ -f "$src" ] || continue
99+
base="$(dirname "$src")"
100+
for tgt in $(grep -hoE '\]\([^)]+\)' "$src" | sed 's/](\(.*\))/\1/' | sed 's/#.*$//'); do
101+
case "$tgt" in
102+
http*|mailto:*|"") continue ;;
103+
esac
104+
[ "$base" = "." ] && resolved="$tgt" || resolved="$base/$tgt"
105+
if [ ! -e "$resolved" ] && [ ! -e "$tgt" ]; then
106+
echo "::error file=$src::broken internal link → $tgt"
107+
fail=1
108+
fi
109+
done
110+
done
111+
exit $fail

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
__pycache__/
55
.DS_Store
66
Thumbs.db
7+
*.pyc

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) · [SemVer](https://semver.org/spec/v2.0.0.html).
5+
6+
## [0.2.0] — 2026-04-30
7+
8+
### Added
9+
10+
- `docs/architecture.svg` — pipeline diagram showing how a single slash command (e.g. `/research`) drives a deterministic three-phase recipe (Collect → Analyse → Artifacts) over the upstream `notebooklm-mcp-cli` MCP tools.
11+
- `docs/output-mockup.svg` — visual mock-up of what a typical `/research` response looks like: structured findings / patterns / contradictions with inline citations linking to NotebookLM sources.
12+
- `CLAUDE.md` for this repository — Level 1 file documenting the architecture, key files, CRITICAL RULES, commands, patterns. Pairs with the [ai-context-hierarchy](https://github.com/CreatmanCEO/ai-context-hierarchy) sister repo.
13+
- `CHANGELOG.md` (this file)
14+
- `CONTRIBUTING.md` with a priority list for community submissions
15+
- `.github/workflows/validate.yml` — CI that runs `bash -n` on shell scripts, `python -m py_compile` on Python scripts, ShellCheck (severity error), confirms every `docs/*` asset referenced from README exists, and validates that all internal Markdown links resolve from `README.md` / `README.ru.md` / `CHANGELOG.md` / `CONTRIBUTING.md` / `CLAUDE.md`
16+
- `Limitations` section to both READMEs — cookie expiry rhythm, 500 K word source cap, `/edit-source` workaround caveat, forum-detection heuristic, opaque NotebookLM rate limits, Claude Code-only, Windows-only native notifications, upstream-MCP dependency
17+
- `Measured impact` section with concrete numbers (research-pipeline tool-call savings, 41 K-message Telegram forum tested in <2 min, YouTube 429 workaround, 30+ frameworks, daily auth check)
18+
- `When to use which research command` decision helper distinguishing `/research`, `/deep-research`, `/youtube-research`, `/telegram-to-notebook`
19+
- `Related` cross-links to all three sister repos: [claude-code-antiregression-setup](https://github.com/CreatmanCEO/claude-code-antiregression-setup), [ai-context-hierarchy](https://github.com/CreatmanCEO/ai-context-hierarchy), [claude-statusline](https://github.com/CreatmanCEO/claude-statusline)
20+
- Six new badges: License, Stars, Validate CI, Built on `notebooklm-mcp-cli`, Claude Code Opus 4.7, MCP-compatible
21+
22+
### Changed
23+
24+
- README hero rewritten to lead with concrete production proof (41 K-message Telegram, 30+ frameworks, 7 commands) instead of an abstract feature list
25+
- The flagship value-prop quote (*"MCP server = Claude has hands · workflow commands = Claude has hands + a checklist"*) elevated to a callout under the hero
26+
- Project structure tree now matches the actual filesystem (was missing `docs/`, `CHANGELOG.md`, `CONTRIBUTING.md`, `CLAUDE.md`, `.github/workflows/`)
27+
- Author signature expanded with Habr / dev.to profile links
28+
29+
### Notes
30+
31+
- Topics on GitHub applied separately via `gh api` after merge.
32+
- No companion article published yet for this repo specifically. Tracked as a P3 follow-up: a Habr / dev.to article along the lines of *"How I turned NotebookLM into a 7-command research assistant for Claude Code"* is the natural next traffic-driver, mirroring what was done for [claude-code-antiregression-setup](https://habr.com/ru/articles/1013330/) and [claude-statusline](https://habr.com/ru/articles/1013414/).
33+
34+
## [0.1.0] — 2026-04-05
35+
36+
### Added
37+
38+
- Initial release with five core slash commands:
39+
- `/research` — full research pipeline with auto-expand and Obsidian export
40+
- `/deep-research` — multi-iteration deep dive with topic tree
41+
- `/youtube-research` — YouTube video analysis via NotebookLM (workaround for HTTP 429 on transcript APIs)
42+
- `/init-notebook` — auto-create a docs notebook for a tech stack, with URL hints for 30+ popular frameworks
43+
- `/telegram-to-notebook` — import Telegram exports including forum supergroups with topic detection
44+
- Two additional commands:
45+
- `/analytics-report` — analytics data → NotebookLM analysis → infographic / report
46+
- `/edit-source` — workaround for editing NotebookLM sources (extract → edit → replace)
47+
- `scripts/telegram-chunker.py` — Python utility for splitting Telegram JSON exports into NotebookLM-compatible chunks. Handles forum-supergroup topic detection, filters stickers / GIFs / video, keeps text / code / PDFs. Tested on a 41 K-message corpus (12 topics, 586 K words → 13 NotebookLM sources, under 2 minutes).
48+
- `scripts/nlm-auth-check.sh` — daily auth probe with Windows toast notification (BurntToast preferred, MessageBox fallback)
49+
- `scripts/setup-nlm-scheduler.ps1` — one-click Windows Task Scheduler installer
50+
- `config/CLAUDE.md` — global instruction snippet teaching Claude to proactively use NotebookLM for unfamiliar libraries
51+
- Bilingual README (English + Russian)
52+
- MIT license

CLAUDE.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# notebooklm-claude-workflows — CLAUDE.md (Level 1)
2+
3+
> Level 1 file for **this** repository. (`config/CLAUDE.md` is a snippet shipped to *downstream users* — different file, different audience.)
4+
5+
## Status: ACTIVE
6+
Public Claude Code slash-command pack + automation for Google NotebookLM. MIT-licensed. Built on top of [`notebooklm-mcp-cli`](https://github.com/jacob-bd/notebooklm-mcp-cli) — no functionality without it.
7+
8+
## Architecture
9+
10+
The whole project is a workflow layer over a third-party MCP server. There is no runtime of our own:
11+
12+
- `commands/*.md` — Claude Code slash-command recipes. Each is a deterministic 2–3-phase pipeline of MCP tool calls (`notebook_create`, `source_add`, `notebook_query`, `studio_create`, `research_start`, `research_status`, `research_import`).
13+
- `scripts/telegram-chunker.py` — Python utility for one specific pain point: turning Telegram forum-supergroup exports into NotebookLM-sized markdown chunks. Detects topics via `topic_message_id` + `forum_topic_created`. Output is plain markdown ready for `source_add`.
14+
- `scripts/nlm-auth-check.sh` — Bash daily auth probe. Calls `nlm notebook list`, parses for `"id"` keys, logs to `~/Documents/scripts/nlm-auth.log`. On Windows, fires a BurntToast notification (with MessageBox fallback) when auth has expired.
15+
- `scripts/setup-nlm-scheduler.ps1` — PowerShell installer that registers the auth probe as a Windows Task Scheduler job.
16+
- `config/CLAUDE.md` — content fragment to be appended to a downstream user's `~/.claude/CLAUDE.md`. Teaches Claude to proactively use NotebookLM for unfamiliar libraries.
17+
18+
## Key files (when touching)
19+
20+
- `commands/research.md` — three-phase pipeline. The order matters: Phase 1 sources, Phase 2 queries, Phase 3 artifacts. Do not collapse phases.
21+
- `commands/deep-research.md` — five-question-per-topic deep dive. Builds a topic tree first, then iterates. Distinct from `research.md`; both should remain.
22+
- `commands/telegram-to-notebook.md` — references `scripts/telegram-chunker.py`. Keep paths consistent if you move the script.
23+
- `scripts/telegram-chunker.py` — 13 KB, pure stdlib. No third-party deps by design (so it runs anywhere Python 3.10+ is available).
24+
- `scripts/nlm-auth-check.sh``bash`-portable, no `set -euo pipefail` because the failure path is the whole point. If you add `set -e`, the toast-notification logic stops working when `nlm notebook list` fails.
25+
26+
## CRITICAL RULES — when editing this repo
27+
28+
- **NEVER** introduce a hard dependency on a specific `notebooklm-mcp-cli` version unless you also pin it in README and `CHANGELOG.md`. Upstream is third-party — pinning is a real cost.
29+
- **NEVER** silently drop the `wait=true` semantics in any command. The whole "deterministic vs raw MCP" value prop hinges on `wait=true` being applied consistently.
30+
- **NEVER** rename a slash command without updating the README's command tables (English AND Russian) and adding a `CHANGELOG.md` "Breaking changes" entry. Users have shell aliases / scripts referencing the names.
31+
- **ALWAYS** mirror customer-facing changes between `README.md` and `README.ru.md`. They have feature parity and must stay parity.
32+
- **ALWAYS** update `CHANGELOG.md` for any change visible to users (new command, removed command, output-format change, breaking workflow change).
33+
- **ALWAYS** keep `scripts/telegram-chunker.py` stdlib-only. The whole point is "drop-in script with zero install"; adding `pip install` requirements breaks that contract.
34+
- **ALWAYS** flag commands that depend on a not-yet-released MCP tool with a clear note in the command file ("requires notebooklm-mcp-cli ≥ X.Y").
35+
36+
## Commands (for me)
37+
38+
- `python -m py_compile scripts/telegram-chunker.py` — syntax check
39+
- `bash -n scripts/nlm-auth-check.sh` — syntax check
40+
- `python scripts/telegram-chunker.py result.json --list-topics` — quick smoke test against a real export
41+
- `nlm notebook list` — confirm auth still valid before running any command file by hand
42+
43+
## Key patterns
44+
45+
1. **Three-phase pipeline.** Every research command follows Collect → Analyse → Artifacts. Distinct phases let Claude show progress and let users abort cleanly between phases.
46+
2. **`wait=true` discipline.** Every `source_add` call uses `wait=true` so subsequent `notebook_query` calls actually have content to query. This is invisible discipline that distinguishes "raw MCP" from "workflow command".
47+
3. **Sequential queries with `conversation_id`.** Multi-question deep-research uses the same `conversation_id` across queries so NotebookLM keeps context. Drop this and the analyses become decontextualised.
48+
4. **Filter at chunk boundaries.** `telegram-chunker.py` filters stickers / GIFs / video at message-extract time, not at chunk-write time, so chunk word counts reflect actual signal.
49+
50+
## External dependencies
51+
52+
- [`notebooklm-mcp-cli`](https://github.com/jacob-bd/notebooklm-mcp-cli) — required. If upstream breaks, every command in this repo breaks.
53+
- Claude Code (Opus 4.7 / 1M context recommended for `/deep-research`).
54+
- Python 3.10+ for `telegram-chunker.py`.
55+
- Bash 4+ and `nlm` CLI on PATH for `nlm-auth-check.sh`.
56+
- Windows + PowerShell for `setup-nlm-scheduler.ps1` and BurntToast notifications.
57+
58+
## Sister repos (same author)
59+
60+
- [Claude Code Anti-Regression Setup](https://github.com/CreatmanCEO/claude-code-antiregression-setup) — pairs with this: anti-regression keeps Claude from breaking code while running these workflows.
61+
- [ai-context-hierarchy](https://github.com/CreatmanCEO/ai-context-hierarchy)`config/CLAUDE.md` here is a Level 0 fragment that fits naturally into that hierarchy.
62+
- [claude-statusline](https://github.com/CreatmanCEO/claude-statusline) — Claude Code statusline; complementary tool from the same ecosystem.
63+
64+
## Recent changes
65+
66+
See [CHANGELOG.md](CHANGELOG.md).

CONTRIBUTING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Contributing
2+
3+
Thanks for considering a contribution. The bar: real use case, deterministic workflow, MCP-tool calls visible in the command file, no hidden dependencies.
4+
5+
## Priorities (highest impact first)
6+
7+
1. **Native notifications for Linux and macOS**`scripts/nlm-auth-check.sh` currently only fires Windows toast notifications. Add `osascript -e 'display notification ...'` for macOS and `notify-send` (with `dunstify` fallback) for Linux. Detect the platform via `uname -s` and branch.
8+
2. **Expanded URL dictionary in `/init-notebook`** — current list covers 30+ frameworks. PRs welcome to extend with: Solid.js, SvelteKit, Astro, Hono, NestJS, Bun, Deno, tRPC, TanStack Query, Zod, Pydantic, SQLAlchemy, Polars, DuckDB, ClickHouse, Temporal, Hatchet, Convex.
9+
3. **New slash commands** that map cleanly onto the three-phase pattern:
10+
- `/pdf-research <topic>` — PDF papers → NotebookLM → analysis
11+
- `/podcast-to-notebook <feed-url>` — podcast feed → episode transcripts (via NotebookLM) → topic-aware analysis
12+
- `/csv-research <file>` — CSV / TSV / Parquet → analytics queries against the data
13+
4. **Translation of command files** — currently command bodies are bilingual where it matters but a few are Russian-only. Extract user-visible strings into a small translation table or duplicate each command with `.en.md` / `.ru.md` suffix.
14+
5. **Telegram chunker improvements** — current chunker is forum-aware, but could also handle:
15+
- WhatsApp exports (different format)
16+
- Discord channel exports (also has thread structure)
17+
- Slack channel exports (per-channel JSON)
18+
19+
## What we will not merge
20+
21+
- Changes that introduce a non-stdlib dependency in `scripts/telegram-chunker.py`. The whole point is "drop-in script, zero install." If you need a non-stdlib lib, write a sister script.
22+
- Changes that bypass `wait=true` semantics in command files. The deterministic workflow contract depends on it.
23+
- Slash commands that wrap a single MCP tool call with no added value. If it is one-call, it is not a workflow — the user should call the MCP tool directly.
24+
- Pull requests that rename existing commands without a CHANGELOG entry under "Breaking changes" and a deprecation alias kept for at least one minor version.
25+
26+
## Pull request checklist
27+
28+
- [ ] If you added a slash command: it has a clear `## Phase 1` / `## Phase 2` / `## Phase 3` structure (or a documented reason for fewer)
29+
- [ ] If you touched `scripts/telegram-chunker.py`: `python -m py_compile` clean, stdlib-only, `--list-topics` smoke test passed locally
30+
- [ ] If you touched `scripts/nlm-auth-check.sh`: `bash -n` clean, ShellCheck severity `error` clean
31+
- [ ] `README.md` updated AND `README.ru.md` mirrored
32+
- [ ] `CHANGELOG.md` entry added under Unreleased or a new minor version
33+
- [ ] `validate.yml` workflow passes locally
34+
35+
## Style
36+
37+
- Command files: imperative voice (*"Create a notebook"*, *"Add each source"*). Phase headings are bold and numbered.
38+
- Bash: `bash -n` and ShellCheck-error clean. `[[ ]]` over `[ ]`, `$()` over backticks, quoted variable expansions.
39+
- Python: stdlib only, type hints on public functions, no print debugging in committed code.
40+
- One feature per PR. Stack PRs if you have multiple.
41+
42+
## Author / maintainer
43+
44+
[@CreatmanCEO](https://github.com/CreatmanCEO) — Nick Podolyak. Open an issue first for anything larger than one command file or one chunker improvement.

0 commit comments

Comments
 (0)