商业产业 Hacker News Claude 2026-08-24T19:32 正文 ok 634 words

一项可恢复被导出限制拦截的 Kindle 划线内容的 Claude Code skill

英文标题:🔶 A Claude Code skill that recovers export-blocked Kindle highlights

开发者 l3a0 发布了一组 Claude Code plugins,其中一项 skill 可从 Kindle notebook 中导出用户自己的全部划线,并恢复被 Amazon 导出限制截断或完全隐藏的内容。该方案结合 Kindle 网页笔记本、Mac Kindle app 的同步标注数据库,以及 Cloud Reader 页面渲染与 Apple Vision OCR;在 4 本真实图书测试中,共提取 2,432 条划线,其中 815 条受导出限制影响的内容全部恢复。该工具仅支持 macOS,面向已登录用户自己的 Amazon 账户和个人笔记用途,并要求用户妥善处理受版权保护的书籍文本。
打开原文相关 3 · 机会 0
media129.0 KB

中文

l3a0 的 Claude Code plugins

这是一个个人维护的 Claude Code skills 合集,以 l3a0 命名空间下的单一插件形式发布。该仓库既是插件本身,也是它自己的 marketplace。

我会在 baowebdev.substack.com 撰写这些工具的构建过程,以及科技、商业与金融相关内容。

claude plugin marketplace add l3a0/claude-plugins
claude plugin install l3a0@l3a0

Skills 可通过 /l3a0:<skill-name> 调用(在没有其他已安装命令占用名称时,裸命令 /<skill-name> 也可使用)。当请求与某个 skill 的描述匹配时,Claude 也会自动调用它们。

当你从 Amazon 的笔记本页面导出一本包含大量划线的图书时,部分划线可能会在句中被截断,另一些则可能只返回一个没有正文的定位编号,并附带以下提示:

“由于导出限制,部分划线已被隐藏或截断。”

这些是你自己的笔记,保存在你自己的账户中,却受到 Amazon 未公开、且无法提高的配额限制。这个 skill 可以将它们找回:它会从 Kindle 笔记本(read.amazon.com/notebook)中提取一本书的每一条划线,汇总为一个逐字保留原文、标注位置引用的 Markdown 文件——包括那些被导出限制截断或完全隐藏的划线。这些内容会通过 Mac Kindle app 的同步标注位置,以及 Cloud Reader 的渲染页面恢复。

该方案已在 4 本真实图书上验证:共提取 2,432 条划线,其中 815 条受到导出限制影响(454 条被截断,361 条完全隐藏)——全部成功恢复。恢复出的文本与 Kindle app 自身的位置标尺相比,误差仅在几个字符以内(中位残差为 0–1)。该 skill 中的每一个坑,都是在这些实际调试过程中积累而来。其构建故事——导出限制为何存在、突破它的三个关键解锁点,以及导出内容库能够带来什么——可参阅 如何夺回你的 Kindle 划线,该文也发布于 Substack。

**适用范围:**该工具会通过控制你自己已登录的浏览器会话,并读取 Kindle app 在 Mac 上保存的文件,导出你自己 Amazon 账户中的划线。输出内容仅供个人笔记使用——书籍正文受版权保护,因此请将提取出的笔记保持私密。

前置条件(仅限 macOS)

这条处理流水线在三个层面上都仅支持 macOS:浏览器控制依赖 AppleScript,OCR 使用 Apple 的 Vision framework,划线位置则来自 Mac Kindle app 的数据文件。

  1. 安装了“Control Chrome”扩展的 Claude Desktop——这是 Anthropic 的浏览器控制 MCP,可在 Claude Desktop → Settings → Extensions 中一键安装。这是该 skill 已验证的、可在真实 Chrome 中执行 JavaScript 的路径(任何能在浏览器标签页中运行 JS 的 browser MCP 都可以替代)。它要求启用一项 Chrome 设置:Chrome 菜单栏 → View → Developer → Allow JavaScript from Apple Events → 勾选 → 退出并重新启动 Chrome。

  2. Google Chrome,已登录你的 Amazon 账户(该 skill 会控制 read.amazon.com)。

  3. 最新版 Mac Kindle app(通过 App Store 安装;bundle id 为 com.amazon.Lassen——不是经典的 Kindle.app),已登录同一个 Amazon 账户,且目标图书已下载。其同步标注数据库可提供精确的划线范围,不受导出限制影响。

  4. Xcode Command Line Tools(xcode-select --install)——批量恢复路径会编译一个小型 Swift OCR 辅助程序(swiftc),使用 Apple Vision。

  5. python3——用于生成最终 Markdown,并运行一个 localhost 接收器(127.0.0.1:8931),供阅读器页面通过 POST 提交捕获结果。

  6. 从笔记本页面的 DOM 中抓取全部划线并保存为 JSON(保留逐字排版)。

  7. 从 Kindle app 的 SQLite 数据库中读取精确到字符的划线位置——包括被网页导出完全隐藏的划线。

  8. 对于被拦截的文本,通过 canvas 捕获 Cloud Reader 的渲染页面(无需操作系统截图),在本地使用 Apple Vision 进行 OCR(不消耗 token),然后依据已知位置裁切文本。

  9. 输出一个 Markdown 文件,包含 ### Location N 小节、以引用块形式保留的逐字文本,以及所有已恢复或近似恢复内容的标记;随后执行 QA 检查。

MIT

English / 原文

l3a0's Claude Code plugins

A personal collection of Claude Code skills, published as a single plugin under the l3a0 namespace. This repo is both the plugin and its own marketplace.

I write about how these tools get built — and about technology, business, and finance — at baowebdev.substack.com.

claude plugin marketplace add l3a0/claude-plugins
claude plugin install l3a0@l3a0

Skills are invoked as /l3a0:<skill-name> (the bare /<skill-name> also works while no other installed command claims the name), and Claude auto-invokes them when a request matches a skill's description.

Export a heavily-highlighted book from Amazon's notebook page and some highlights come back cut off mid-sentence, while others come back as a bare location number with no text at all, under this notice:

"Some highlights have been hidden or truncated due to export limits."

Those are your own notes, in your own account, capped by a budget Amazon doesn't document and you can't raise. This skill gets them back: it extracts every highlight for a book from the Kindle notebook (read.amazon.com/notebook) into one combined, verbatim, location-cited Markdown file — including the highlights the export limit truncates or hides entirely, which are recovered from the Mac Kindle app's synced annotation positions plus the Cloud Reader's rendered pages.

Proven on four real books: 2,432 highlights extracted, 815 of them export-blocked (454 truncated + 361 fully hidden) — every one recovered , with recovered text landing within a couple of characters of the Kindle app's own position ruler (median residual 0–1). Every gotcha in the skill was earned by real debugging across those runs. The build story — why the export limit exists, the three unlocks that beat it, and what a library of exports becomes — is written up in How to Take Back Your Kindle Highlights, also published on Substack.

Scope: this exports your own highlights from your own Amazon account, by driving your own logged-in browser session and reading files the Kindle app stores on your Mac. The output is for your personal notes — book text is copyrighted, so keep extracted notes private.

Prerequisites (macOS only)

The pipeline is macOS-only three times over: browser control runs over AppleScript, OCR uses Apple's Vision framework, and highlight positions come from the Mac Kindle app's data files.

  1. Claude Desktop with the "Control Chrome" extension — Anthropic's browser-control MCP, installed in one click from Claude Desktop → Settings → Extensions. It is the skill's verified path for executing JavaScript in your real Chrome (any browser MCP that can run JS in the tab can substitute). It requires a Chrome setting: Chrome menu bar → View → Developer → Allow JavaScript from Apple Events → check → quit and relaunch Chrome.

  2. Google Chrome , signed in to your Amazon account (the skill drives read.amazon.com).

  3. The current Mac Kindle app (App Store; bundle id com.amazon.Lassen — not the classic Kindle.app), signed in to the same Amazon account, with the book downloaded. Its synced annotation database provides exact highlight extents with no export limit.

  4. Xcode Command Line Tools (xcode-select --install) — the bulk-recovery path compiles a small Swift OCR helper (swiftc) that uses Apple Vision.

  5. python3 — builds the final Markdown and runs a localhost receiver (127.0.0.1:8931) that the reader page POSTs captures to.

  6. Scrapes all highlights from the notebook page DOM to JSON (verbatim typography preserved).

  7. Reads exact character-precise highlight positions from the Kindle app's SQLite database — including highlights the web export hides completely.

  8. For blocked text, captures the Cloud Reader's rendered pages via canvas (no OS screenshots needed), OCRs them locally with Apple Vision (zero tokens), and cuts the text to the known positions.

  9. Emits one Markdown file with ### Location N sections, blockquoted verbatim text, and flags for anything recovered or approximate, then runs a QA pass.

MIT