SlipBot Kindle Importer
Verified@jrswab
npx machina-cli add skill @jrswab/slipbot-kindle-importer --openclawKindle Import
Parse Kindle notebook exports (HTML) and create slipbox entries for user's notes.
Input Format
Kindle exports are XHTML files with this structure:
<div class="bookTitle">Book Title Here</div>
<div class="authors">Author Name</div>
...
<div class="sectionHeading">Chapter/Section Name</div>
<div class="noteHeading">Highlight (yellow) - Section > Page X</div>
<div class="noteText">Highlighted text from book</div>
<div class="noteHeading">Note - Section > Page X</div>
<div class="noteText">User's own note</div>
Key distinction:
noteHeadingstarting with "Highlight" → book text → SkipnoteHeadingstarting with "Note" → user's own thoughts → Import
Parsing Rules
Metadata Extraction
- Book title: content of
.bookTitlediv - Author: content of
.authorsdiv - Source type:
book
Content Extraction
- Find all
.noteHeadingelements - If heading starts with "Note" → get the following
.noteTextcontent → import - If heading starts with "Highlight" → skip
- Section info (e.g., "Client-side/Stateless Sessions > Page 28") can be ignored
Workflow
- Parse file → extract book title and author
- Extract user notes → collect only Note entries (not Highlights)
- Precheck → show user: book title, author, note count, ask for confirmation
- On confirmation → for each note, invoke slipbot:
- Type: note (
-prefix) - Source:
~ book, {title} by {author} - Let slipbot handle: filename, tags, links, graph update
- Type: note (
- Report → count of notes created
Example
Input file metadata:
- Title: "The JWT Handbook"
- Author: "Sebastian E Peyrott"
Parsed entries:
Highlight (yellow) - Page 28: "This is easily solved by..." → SKIP
Note - Page 28: "Applications should not allow unsigned JWTs..." → IMPORT
Slipbot call:
- Applications should not allow unsigned JWTs to be considered valid. ~ book, The JWT Handbook by Sebastian E Peyrott
Edge Cases
- No user notes (only Highlights): Report "no notes to import"
- Multiple authors: Preserve as-is from the file
- Missing author: Use "Unknown" as author
- Special characters in title/content: Preserve as-is
- HTML entities: Decode before storing (& → &, etc.)
Supported File Types
.htmlfiles exported from Kindle app- XHTML files (same structure)
- Files sent via Telegram (application/xml or text/plain mime types)
Overview
Parses Kindle HTML/XHTML notebook exports to import only the user’s notes into Slipbox. It extracts book title and author, skips Highlights, and runs Slipbot for each Note, preserving metadata and decoding HTML entities when needed.
How This Skill Works
The importer reads the Kindle export, grabbing the book title from .bookTitle and the author from .authors. It then finds all .noteHeading entries, importing the following .noteText only if the heading starts with 'Note' and skipping those starting with 'Highlight'. After a precheck confirmation, it invokes Slipbot for each note with type 'note' and a source string like '~ book, {title} by {author}'. Slipbot handles filenames, tags, links, and graph updates.
When to Use It
- User provides a Kindle notebook export file (HTML/XHTML) and wants to add only their notes to Slipbox
- Importing notes from multiple Kindle books in a batch to populate a slipbox
- A Kindle file lacks an author; you want to default to Unknown
- Notes are sent via Telegram as HTML/XHTML exports for quick ingestion
- All notes are Highlights (no Notes) and should report no notes to import
Quick Start
- Step 1: Upload the Kindle HTML/XHTML notebook export
- Step 2: Review the precheck (book title, author, note count) and confirm
- Step 3: Let Slipbot process each imported note (type: note, source: ~ book, {title} by {author})
Best Practices
- Always review the precheck summary (book title, author, note count) before importing
- Preserve author information exactly as it appears in the export; if missing, use Unknown
- Decode HTML entities (e.g., & → &) before storing notes
- Only import entries where the heading starts with 'Note' and skip 'Highlight' entries
- Test with a small export first to verify correct note extraction and source formatting
Example Use Cases
- Input: The JWT Handbook by Sebastian E Peyrott; Output: Slipbot entry for 'Applications should not allow unsigned JWTs to be considered valid' with source '~ book, The JWT Handbook by Sebastian E Peyrott'
- Input: A Kindle export containing multiple books; Output: Slipbot entries created for each user Note across books
- Input: Kindle export with only Highlights; Output: Reported as 'no notes to import'
- Input: Kindle export with missing author; Output: Author is stored as Unknown
- Input: Kindle HTML export sent via Telegram (HTML/XHTML); Output: Notes imported into Slipbox with proper source formatting