Skip to content

Commit 747726d

Browse files
authored
Merge pull request teng-lin#207 from teng-lin/improve/skill-installation-for-other-agents
feat: unify skill installation across agents
2 parents db9aa51 + 471d4f5 commit 747726d

File tree

11 files changed

+551
-166
lines changed

11 files changed

+551
-166
lines changed

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
2828
## What You Can Build
2929

30-
🤖 **AI Agent Tools** - Integrate NotebookLM into Claude Code, Codex, and other LLM agents. Ships with a [Claude Code skill](#agent-setup) (`notebooklm skill install`) and repo-level Codex instructions in [`AGENTS.md`](AGENTS.md), or build your own integrations with the async Python API.
30+
🤖 **AI Agent Tools** - Integrate NotebookLM into Claude Code, Codex, and other LLM agents. Ships with a root [NotebookLM skill](SKILL.md) for GitHub and `npx skills add` discovery, local `notebooklm skill install` support for Claude Code and `.agents` skill directories, and repo-level Codex guidance in [`AGENTS.md`](AGENTS.md).
3131

3232
📚 **Research Automation** - Bulk-import sources (URLs, PDFs, YouTube, Google Drive), run web/Drive research queries with auto-import, and extract insights programmatically. Build repeatable research pipelines.
3333

@@ -165,7 +165,7 @@ notebooklm language list # List supported output languages
165165
notebooklm metadata --json # Export notebook metadata and sources
166166
notebooklm share status # Inspect sharing state
167167
notebooklm source add-research "AI" # Start web research and import sources
168-
notebooklm skill status # Check Claude Code skill installation
168+
notebooklm skill status # Check local agent skill installation
169169
```
170170

171171
### Python API
@@ -206,16 +206,23 @@ asyncio.run(main())
206206
#### Claude Code
207207

208208
```bash
209-
# Install via CLI or ask Claude Code to do it
209+
# Install into local user-level Claude + .agents skill directories
210210
notebooklm skill install
211211
notebooklm agent show claude
212212

213-
# Then use natural language:
214-
# "Create a podcast about quantum computing"
215-
# "Download the quiz as markdown"
216-
# "/notebooklm generate video"
213+
# Install only the universal .agents/skills target in the current project
214+
notebooklm skill install --scope project --target agents
215+
216+
# Install from GitHub via the open skills ecosystem
217+
npx skills add teng-lin/notebooklm-py
217218
```
218219

220+
Supported paths:
221+
222+
- `notebooklm skill install` manages local `~/.claude/skills/notebooklm` and `~/.agents/skills/notebooklm` by default.
223+
- GitHub and `npx skills add teng-lin/notebooklm-py` discover the canonical root [SKILL.md](SKILL.md).
224+
- Agents that honor `.agents/skills` can consume the universal install path; Claude Code also supports `.claude/skills`.
225+
219226
#### Codex
220227

221228
Codex reads repo-level instructions from [`AGENTS.md`](AGENTS.md), so there is no separate install command. After installing dependencies and authenticating, ask Codex to use the `notebooklm` CLI or Python API directly.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ pip install "git+https://github.com/teng-lin/notebooklm-py@${LATEST_TAG}"
2323

2424
⚠️ **DO NOT install from main branch** (`pip install git+https://github.com/teng-lin/notebooklm-py`). The main branch may contain unreleased/unstable changes. Always use PyPI or a specific release tag, unless you are testing unreleased features.
2525

26-
After installation, install the Claude Code skill:
26+
**Skill install methods:**
27+
28+
- `notebooklm skill install` installs this skill into the supported local agent directories managed by the CLI.
29+
- `npx skills add teng-lin/notebooklm-py` installs this skill from the GitHub repository into compatible agent skill directories.
30+
- If you are already reading this file inside an agent skill directory, the skill is already installed. You only need the Python package and authentication below.
31+
32+
**CLI-managed install:**
2733
```bash
2834
notebooklm skill install
2935
```
@@ -560,4 +566,4 @@ notebooklm language --help # Language settings
560566
**Diagnose auth:** `notebooklm auth check` - shows cookie domains, storage path, validation status
561567
**Re-authenticate:** `notebooklm login`
562568
**Check version:** `notebooklm --version`
563-
**Update skill:** `notebooklm skill install`
569+
**Refresh a CLI-managed install:** `notebooklm skill install`

docs/cli-reference.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,16 +195,23 @@ notebooklm metadata -n abc123 --json
195195

196196
### Skill Commands (`notebooklm skill <cmd>`)
197197

198-
Manage Claude Code skill integration.
198+
Manage NotebookLM agent skill integration.
199199

200200
| Command | Description | Example |
201201
|---------|-------------|---------|
202-
| `install` | Install/update skill to ~/.claude/skills/ | `skill install` |
203-
| `status` | Check installation and version | `skill status` |
204-
| `uninstall` | Remove skill | `skill uninstall` |
205-
| `show` | Display skill content | `skill show` |
202+
| `install` | Install/update the skill for `claude`, `.agents`, or both | `skill install --target all` |
203+
| `status` | Check installed targets and version info | `skill status --scope project` |
204+
| `uninstall` | Remove one or more installed targets | `skill uninstall --target agents` |
205+
| `show` | Display the packaged skill or an installed target | `skill show --target source` |
206206

207-
After installation, Claude Code recognizes NotebookLM commands via `/notebooklm` or natural language like "create a podcast about X".
207+
Defaults:
208+
209+
- `skill install` uses `--scope user --target all`
210+
- `claude` maps to `.claude/skills/notebooklm/SKILL.md`
211+
- `agents` maps to `.agents/skills/notebooklm/SKILL.md`
212+
- `show --target source` prints the canonical packaged skill file
213+
214+
The packaged wheel includes the repo-root `SKILL.md`, so the same skill content powers `notebooklm skill install`, GitHub discovery, and `npx skills add teng-lin/notebooklm-py`.
208215

209216
Codex does not use the `skill` subcommand. In this repository it reads the root [`AGENTS.md`](../AGENTS.md) file and invokes the `notebooklm` CLI or Python API directly.
210217

docs/releasing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Proceed with release preparation?
7777
| Doc | Update when... |
7878
|-----|----------------|
7979
| [README.md](../README.md) | New features, changed capabilities, Beyond the Web UI section |
80-
| [SKILL.md](../src/notebooklm/data/SKILL.md) | New CLI commands, changed flags, new workflows |
80+
| [SKILL.md](../SKILL.md) | New CLI commands, changed flags, new workflows |
8181
| [cli-reference.md](cli-reference.md) | Any CLI changes |
8282
| [python-api.md](python-api.md) | New/changed Python API |
8383
| [troubleshooting.md](troubleshooting.md) | New known issues, fixed issues to remove |

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,13 @@ replacement = '](https://github.com/teng-lin/notebooklm-py/blob/v$HFPR_VERSION/S
8080
pattern = '\]\(LICENSE\)'
8181
replacement = '](https://github.com/teng-lin/notebooklm-py/blob/v$HFPR_VERSION/LICENSE)'
8282

83+
[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
84+
pattern = '\]\(SKILL\.md\)'
85+
replacement = '](https://github.com/teng-lin/notebooklm-py/blob/v$HFPR_VERSION/SKILL.md)'
86+
8387
[tool.hatch.build.targets.wheel]
8488
packages = ["src/notebooklm"]
89+
force-include = {"SKILL.md" = "notebooklm/data/SKILL.md", "AGENTS.md" = "notebooklm/data/CODEX.md"}
8590

8691
[tool.pytest.ini_options]
8792
testpaths = ["tests"]

src/notebooklm/cli/agent_templates.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
}
1010

1111
REPO_ROOT_AGENTS = Path(__file__).resolve().parents[3] / "AGENTS.md"
12+
REPO_ROOT_CLAUDE_SKILL = Path(__file__).resolve().parents[3] / "SKILL.md"
1213

1314

1415
def _read_package_data(filename: str) -> str | None:
1516
"""Read a packaged agent template file."""
1617
try:
1718
return (resources.files("notebooklm") / "data" / filename).read_text(encoding="utf-8")
18-
except (FileNotFoundError, TypeError):
19+
except (FileNotFoundError, TypeError, ModuleNotFoundError):
1920
return None
2021

2122

@@ -28,6 +29,11 @@ def get_agent_source_content(target: str) -> str | None:
2829
if normalized == "codex" and REPO_ROOT_AGENTS.exists():
2930
return REPO_ROOT_AGENTS.read_text(encoding="utf-8")
3031

32+
# Prefer the repo-root skill when running from a source checkout so both
33+
# GitHub discovery and local CLI installs use the same source of truth.
34+
if normalized == "claude" and REPO_ROOT_CLAUDE_SKILL.exists():
35+
return REPO_ROOT_CLAUDE_SKILL.read_text(encoding="utf-8")
36+
3137
filename = AGENT_TEMPLATE_FILES.get(normalized)
3238
if filename is None:
3339
return None

0 commit comments

Comments
 (0)