---
name: onenote-import
title: "OneNote Import"
description: "Guide the OneNote notebook import — list first, confirm scope with the user, then kick off the background import."
category: core
status: active
priority: 7
tools_granted:
  - onenote_list_notebooks
  - onenote_import
triggers:
  - "import my OneNote"
  - "import OneNote"
  - "sync OneNote"
  - "pull OneNote"
  - "pull my notebooks"
  - "import my notebooks"
  - "bring my OneNote into the vault"
  - "get my OneNote pages"
---

## Instructions

When the user asks to import OneNote, **always confirm scope before running** — imports are large, slow, and a wrong notebook filter wastes minutes. Follow this flow exactly:

### 1. List first — never import blindly

Call `onenote_list_notebooks()` first. It returns `{notebooks: [{name, id, page_count}, ...], total_notebooks, total_pages}`. This takes a few seconds and has zero side effects; it's a read-only probe.

If the call returns `{"error": ...}` (OneNote not installed, wrong version, COM failed), surface the error clearly and stop. Do NOT attempt `onenote_import` — it will fail for the same reason.

### 2. Summarize + propose defaults

Tell the user what you found and what you're about to do:

> You have **N notebooks** (~M pages total):
> - 01JA · 300 pages
> - 02FE · 420 pages
> - ...
>
> I'll import **all notebooks** into `<vault>/OneNote/` with **incremental mode** (skips pages unchanged since the last import). Estimated time: ~X minutes at 2.4 pages/sec. Proceed?

Notebook listing is how the user sanity-checks scope — it's also how they spot misspellings, deleted-then-resurrected notebooks, or the "oh I forgot I had that one" moment.

### 3. Wait for confirmation

Do not call `onenote_import` until the user says yes (or narrows the scope). Accept any clear affirmation: "yes", "go", "do it", "sure". If the user says something like "only 01JA" or "skip 02FE", pass `notebooks: [...]` with the narrowed list.

If the user doesn't respond or changes topics, drop it — don't chase them.

### 4. Fire the import

Call `onenote_import({...})` with the agreed parameters. It returns **immediately** with `{job_id, state: "running", progress_url, message}`. The import runs in the background.

Acknowledge the start:

> Started. ~N pages, ~X minutes. You'll see progress toasts in the top-right, and I'll post a follow-up here when it's done.

### 5. Don't wait, don't poll

Do NOT call `onenote_import_status` or similar to poll progress. The plugin:
- Fires batched `onenote_import_progress` activity events that appear as user toasts (~30 total, regardless of import size)
- Posts a **templated follow-up message back into this chat thread** when the job hits a terminal state (completed / failed / cancelled)

Your next turn is done. The user will see:
- Toasts for progress
- A final message from you (auto-posted by the plugin) summarizing counts, duration, errors

## Rules

- **Always call `onenote_list_notebooks` first.** Never skip to `onenote_import` even if the user seems impatient. The list takes 2-3 seconds and prevents 10+ minute mistakes.
- **Never invent notebook names.** If the user says "import notebook X" and X isn't in the list, say so and show the closest matches — don't guess.
- **Default to incremental.** Full re-imports (`incremental: false`) are rare; only do this when the user explicitly asks ("re-import everything", "force refresh", "full sync").
- **Default target folder is `OneNote`** (sibling of `agntspace-inbox/` in the vault root). Don't suggest custom folders unless the user asks — it just confuses things.
- **Never poll the job after starting it.** The plugin handles follow-up via a chat message. Polling wastes the user's LLM budget.
- **If the user re-asks during an active import** ("is it done? / how's it going?"), check `/api/plugins/onenote-import/status` via the tool only if you have to — prefer to remind them that toasts show progress and a message will land here automatically.

## Examples

### Good — typical flow

User: "import my OneNote"

Agent: *calls `onenote_list_notebooks()`*
→ `{"notebooks": [{"name": "01JA", "page_count": 300}, {"name": "02FE", "page_count": 420}, ...], "total_notebooks": 17, "total_pages": 4812}`

Agent: "You have **17 notebooks** with ~4,812 pages total:
- 01JA · 300 pages
- 02FE · 420 pages
- ... (15 more)

I'll import all of them into `<vault>/OneNote/` with **incremental mode** (skips unchanged pages on re-runs). Estimated time: ~33 minutes. Proceed?"

User: "yes"

Agent: *calls `onenote_import({"target_folder": "OneNote", "incremental": true})`*
→ `{"job_id": "abc123", "state": "running", "message": "Started. I'll post a follow-up..."}`

Agent: "Started. ~4,812 pages at ~2.4 pages/sec = ~33 minutes. Progress toasts will show in the top-right, and I'll post a completion note here when it's done."

### Good — narrowed scope

User: "import just my work notes from OneNote"

Agent: *calls `onenote_list_notebooks()`*

Agent: "I see these notebooks: 01JA, 02FE, Work Notes, Personal, Projects, ... Do you mean **Work Notes** (480 pages) — import just that one in incremental mode?"

User: "yes"

Agent: *calls `onenote_import({"notebooks": ["Work Notes"], "incremental": true})*

### Bad — skipped the list step

User: "import my OneNote"

Agent: *calls `onenote_import({})` immediately*

→ This is wrong. Even though it works, the user has no idea what's about to happen. If there are 17 notebooks and 5000 pages, that's a 35-minute commit without warning. Always list + confirm first.

### Bad — chasing the user

User: "import OneNote"

Agent: *lists, proposes defaults*

User: "actually nevermind, different topic" — user pivots.

Agent: *should drop it, not re-ask about the import*

## When not to use

Skip this skill entirely when:
- The user is asking about OneNote generally ("what's in my OneNote?" is a search / wiki query, not an import)
- The plugin is disabled (tool calls will fail cleanly — the agent should explain and stop)
- The user previously imported and is asking about the results ("what did you import yesterday?" is a memory query, not a new import)
