/onebrain:importfrom onebrain
Imports local files (PDF, Word, Excel, PowerPoint, images, video, scripts) from an inbox or explicit path into structured markdown notes in a resources folder. Useful for bringing local files into a vault.
Ships in onebrain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Process local files into permanent vault notes in [resources_folder]/ (resolved from onebrain.yml; default: 04-resources/).
Usage:
/import : scan default import staging inbox ([inbox_folder]/imports/, resolved from onebrain.yml)/import /path/to/file : import a single explicit file/import --attach : scan inbox and copy supported files into vault for inline Obsidian preview/import /path/to/file --attach : single file with attachResolve additional folders from onebrain.yml (read the file if it exists at the vault root):
onebrain.yml does not exist: use all defaults below.onebrain.yml exists but cannot be parsed: report the error and stop : do not proceed with unknown folder paths.folders.import_inbox → default: [inbox_folder]/imports (import staging folder; substituting the resolved [inbox_folder] placeholder)folders.attachments → default: attachments (for --attach copies)Use [inbox_folder] and [resources_folder] from session config. Store resolved [attachments_folder] from onebrain.yml above.
Parse arguments:
--attach flag if present (remove from path consideration)/import: this is single-file modeSingle-file mode:
[filename]is not a supported file type. Supported: PDF, Word, Excel, PowerPoint, images, video, Python/Shell/SQL scripts. Then stop.
Batch mode:
[inbox_folder] resolved in Step 1 above (default: [inbox_folder]/imports from onebrain.yml).Import inbox not found at
[inbox path]. Run/onboardingto set up your vault, or use/import /path/to/fileto import a specific file. Then stop.
[inbox path]). Add files or use /import /path/to/file.
Then stop.Group files by type. Show a confirmation table:
Found N files to import:
report.pdf PDF document
budget.xlsx Excel spreadsheet
hero-image.png Image
cleanup.sh Shell script
deck.pptx PowerPoint
unknown.xyz ⚠ Unsupported : will be skipped
Proceed with all? Or type filenames to skip (comma-separated, or "all"):
(Inbox files will be removed after successful import)
Unsupported file types are listed with a warning but not processed.
Wait for user response:
Note: In batch mode, subagents auto-select subfolders without user confirmation. Users can move notes to different subfolders after import.
For each file in the confirmed set, dispatch one subagent in parallel. Each subagent receives:
--attach flag is setEach subagent runs the appropriate handler section from this skill (see below).
After all subagents complete, show a summary:
──────────────────────────────────────────────────────────────
📂 Import Complete — {N} notes
──────────────────────────────────────────────────────────────
`[resources_folder]/research/report.md` (from report.pdf)
`[resources_folder]/finance/budget-summary.md` (from budget.xlsx)
`[resources_folder]/media/hero-image.md` (from hero-image.png)
`[resources_folder]/scripts/cleanup.md` (from cleanup.sh)
{N} files removed from inbox.
If any subagent failed:
⚠️ {N} file(s) failed:
`{filename}` — {reason}
If any files were skipped due to unsupported type:
⏭ {N} file(s) skipped (unsupported — left in inbox):
`{filename}`
If a note was created but the inbox delete failed (partial success):
⚠️ {N} partial success:
`{filename}` — note created at `{vault path}`, but inbox file could not be deleted. Delete manually.
Skip this step if 0 notes were successfully created.
Ask using AskUserQuestion:
If "skip": done.
If "yes": For each successfully created note (process one at a time):
Find related vault notes: Search using the search tools if available, otherwise Grep [knowledge_folder]/**/*.md, [resources_folder]/**/*.md, [projects_folder]/**/*.md for keywords from the imported note's title, tags, and Summary section (when falling back to Grep, append the |mcp-miss alternation to the pattern — see SEARCH.md). For search-tool results, only include candidates with rerank_score ≥ 0.30 (prefer ≥ 0.60) — drop anything below 0.30. Exclude the imported note itself.
Present suggestions:
──────────────────────────────────────────────────────────────
🔗 Integrate — `{imported-note-filename}`
──────────────────────────────────────────────────────────────
Related notes found:
1. [[Note A]] — {reason: overlapping topic or shared entity}
2. [[Note B]] — {reason}
3. No related notes found — adding to Related section only
For each suggested related note, ask what to do using AskUserQuestion:
link-only / append-excerpt / skip[[imported-note-title]] to the related note's ## Related section (bidirectional — also add the related note to the imported note's ## Related). If the related note has no ## Related section, append one at the end of the file before adding the wikilink.## From [[imported-note-title]] (YYYY-MM-DD) in the related noteAfter processing all suggestions for this note: confirm what was linked or appended.
onebrain search reindex
| Extension | Type | Reference file |
|---|---|---|
.pdf | references/pdf-handler.md | |
.docx | Word | references/word-handler.md |
.xlsx, .xls | Excel | references/excel-handler.md |
.pptx, .ppt | PowerPoint | references/pptx-handler.md |
.png, .jpg, .jpeg, .gif, .webp | Image | references/image-handler.md |
.svg | SVG | references/image-handler.md |
.mp4, .mov, .webm, .mkv | Video | references/video-handler.md |
.py | Python | references/script-handler.md |
.sh, .bash, .zsh | Shell | references/script-handler.md |
.sql | SQL | references/script-handler.md |
These rules apply to all handlers. No exceptions.
1. Cleanup is conditional on note creation success. Delete an inbox file ONLY after the Write tool confirms the note was created. If note creation fails for any reason: return an error, leave the inbox file untouched, stop.
2. Stub notes do NOT trigger cleanup. When a stub note is created (extraction tool unavailable, extraction failed, empty document): do NOT delete the inbox file. The user needs it to retry after fixing the issue.
3. Read/extraction failures stop processing. If the Read tool, markitdown, or any extraction step returns an error or empty output: do NOT create a note. Return an error. Do NOT delete the inbox file.
4. File validation before processing.
Check file size in bytes via Node (already required by the OneBrain CLI, so reliably on PATH). Pass the path via process.argv so Windows backslashes are not interpreted as escape sequences inside a string literal. The catch arm logs the errno code to stderr (visible in tool output) so EACCES / ENOTDIR / EISDIR / ENOENT are not collapsed into a single misleading "empty file" stub:
node -e "try { console.log(require('fs').statSync(process.argv[1]).size) } catch (e) { console.error(e.code || e.message); console.log(-1) }" -- "[filepath]"
If the output is 0, create a stub note ("File is empty : no content to extract."), do NOT delete inbox file, return. If the output is -1 (stat threw — read the stderr line for the errno code), the file is unreadable; create a stub note that names the actual error, and do not delete.
5. --attach directory creation.
Before every copy, ensure the target directory exists. Prefer Node (node -e "require('fs').mkdirSync(process.argv[1], { recursive: true })" -- "<dir>") — it is portable across Bash/PowerShell/cmd. Native shell forms also work when the active shell is known (mkdir -p Bash, New-Item -ItemType Directory -Force PowerShell, mkdir cmd); do not call mkdir -p from PowerShell — its mkdir alias would create a literal directory named -p. If the subsequent copy fails: skip the embed, report the failure, do NOT delete inbox file, stop.
6. Filename collision.
Before writing a note, check if the target path already exists. If it does: append (Imported YYYY-MM-DD) to the filename and note the rename in the summary.
Each subagent reads the relevant handler reference file before processing. Handler Safety Rules (above) apply to all handlers without exception.
references/markitdown-setup.mdreferences/note-template.md| File type | Read before processing |
|---|---|
references/pdf-handler.md | |
| Word (.docx) | references/word-handler.md |
| Excel (.xlsx/.xls) | references/excel-handler.md |
| PowerPoint (.pptx/.ppt) | references/pptx-handler.md |
| Image/GIF/SVG | references/image-handler.md |
| Video | references/video-handler.md |
| Script (.py/.sh/.sql) | references/script-handler.md |
This skill is long-running. Emit a 1-line status update after each major step so the user can see progress in real time.
In-session format:
→ [step N/M] <action being taken>
Examples:
→ [step 1/4] reading file · detecting format...
→ [step 2/4] extracting content (PDF parse / OCR / Markdown)...
→ [step 3/4] enriching via tag-suggester + link-suggester...
→ [step 4/4] writing to 04-resources/ + linking related notes...
Rules:
→ [step N/M] prefix exactly so they're visually distinct from skill outputPassword-protected PDFs and Word files. The Read tool returns empty content or a decryption error on protected files. When a non-trivially sized file (> 0 bytes) returns completely empty content, create a stub note with the message "File may be password-protected — content could not be extracted. Unlock the file and re-import."
Large PDFs need chunked reading. Claude's Read tool reads up to 20 pages per request. For PDFs with 20+ pages, read in consecutive page ranges (pages: "1-20", pages: "21-40", etc.) and synthesize across chunks. Without chunking, pages 21+ are silently truncated.
.xls legacy Excel format. markitdown may return garbled characters or fail silently on .xls files. The Excel stub fallback already has a special message for .xls — trust the stub path for .xls rather than retrying markitdown. The user should convert to .xlsx and re-import.
--attach flag with batch mode. In batch mode, cp operations for attach run inside subagents. If a subagent's cp fails, the orchestrator Step 5 report should include it as a partial failure — the note is created but the attachment copy was skipped.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub onebrain-ai/onebrain --plugin onebrain32 skills in this plugin
/bookmarkQuick URL bookmark capture : paste a link, AI generates name and description, suggests category, saves to Bookmarks.md in awesome-list format. Invoke when user wants to save a URL for later — bare URL with no other context defaults to this. Do NOT use for: deeply processing or summarizing the URL content now (use summarize), saving a note that is not a URL (use capture), or researching a topic from scratch (use research)./braindumpCapture a stream of raw thoughts : classify them and file to inbox with action items extracted. Use when the user signals a free-form, stream-of-consciousness dump with multiple unrelated threads — 'let me dump everything on my mind'. Do NOT use for: a single titled idea (use capture), saving a URL (use bookmark), or anything structured and focused./captureQuick note capture with automatic wikilink suggestions to related existing notes. Use when the user wants to save a single, specific, titled idea, insight, or piece of information to the vault. Do NOT use for: unstructured multi-thread thought dumps (use braindump), saving a URL for later (use bookmark), deeply summarizing an article or URL (use summarize), processing a book (use reading-notes), or teaching the agent a preference (use learn)./cloneClone your agent's portable context (agent folder including MEMORY.md) to a folder for transfer to another vault. Use only when the user explicitly wants to migrate or copy agent memory to a new vault. Do NOT use for: backing up the whole vault, updating OneBrain (use update), or reviewing memory (use memory-review)./connectFind connections between notes and suggest wikilinks to strengthen the knowledge graph. Use when the user wants to discover how existing notes relate to each other — 'find connections', 'what links to this note', 'strengthen my graph'. Do NOT use for: creating new notes (use capture), processing inbox (use consolidate), or searching for specific content (search directly)./consolidateReview inbox and recent notes, synthesize and merge into the knowledge base. Use when the user wants to process, organize, or clear the inbox regardless of topic — 'clean up my inbox', 'process my notes'. Do NOT use for: capturing new information now (use capture or braindump), synthesizing already-vaulted notes on a specific topic (use distill — consolidate works on the inbox), or finding note connections (use connect).Other plugins' skills for the same job