AgentSkillsCN

kindle-review

利用 Kindle Previewer 3 与 Gemini 视觉 API,在 Kindle 设备上预览并分析 EPUB 渲染效果。当用户希望测试 Kindle 兼容性、检查电子阅读器的渲染表现,或验证书籍是否能在 Kindle 设备上完美呈现时,可使用此技能。每当提及 Kindle 预览、电子阅读器测试,或 Kindle 兼容性时,此技能便会自动触发。

SKILL.md
--- frontmatter
name: kindle-review
description: Preview and analyze EPUB rendering on Kindle devices using Kindle Previewer 3 and Gemini vision API. Use when the user wants to test Kindle compatibility, check e-reader rendering, or verify the book displays correctly on Kindle devices. Triggers on mentions of Kindle preview, e-reader testing, or Kindle compatibility.

Kindle Preview Review

Preview the book's EPUB in Kindle Previewer 3, capture screenshots of how it renders on different Kindle devices, and analyze with Gemini's vision API.

Prerequisites

Kindle Previewer 3 must be installed manually (requires sudo):

bash
# Option 1: Homebrew (requires sudo password prompt)
brew install --cask kindle-previewer

# Option 2: Direct download from Amazon
# https://www.amazon.com/Kindle-Previewer/b?ie=UTF8&node=21381691011

Other requirements:

  • GEMINI_API_KEY in .env file
  • @google/genai npm package installed
  • macOS (uses AppleScript for automation)

Quick Start

bash
# Full review (all devices, 10 pages each)
source .env && GEMINI_API_KEY=$GEMINI_API_KEY npx tsx scripts/kindle-preview.ts

# Specific EPUB file
source .env && GEMINI_API_KEY=$GEMINI_API_KEY npx tsx scripts/kindle-preview.ts \
  --epub output/the-meta-engineer.epub

# Single device
source .env && GEMINI_API_KEY=$GEMINI_API_KEY npx tsx scripts/kindle-preview.ts \
  --device "Kindle Paperwhite 5"

# More pages
source .env && GEMINI_API_KEY=$GEMINI_API_KEY npx tsx scripts/kindle-preview.ts \
  --pages 20

# Screenshots only (no Gemini)
npx tsx scripts/kindle-preview.ts --screenshots-only

Supported Devices

The script tests on these Kindle devices/apps:

DeviceTypeNotes
Kindle Paperwhite 5E-inkMost popular e-reader
Kindle Oasis 3E-inkLarger screen
Kindle (2022)E-inkBasic e-reader
Kindle Fire HD 10TabletColor display
Kindle iOSAppiPhone/iPad rendering

Workflow

  1. Open in Kindle Previewer:

    • Launches Kindle Previewer 3 via AppleScript
    • Opens the EPUB file
    • Waits for rendering to complete
  2. Capture Screenshots:

    • Uses macOS screencapture to capture the preview window
    • Navigates through pages using keyboard simulation
    • Saves PNGs to .kindle-review/screenshots/<device>/
  3. Gemini Analysis:

    • Sends screenshots to gemini-2.5-flash vision model
    • Analyzes Kindle-specific rendering issues:
      • Code block readability on e-ink
      • Font sizing and typography
      • Table rendering on small screens
      • Image clarity and sizing
      • Page breaks and navigation
    • Saves report to .kindle-review-report.md
  4. Create Tasks (manual step after review):

    • Read .kindle-review-report.md
    • For critical Kindle issues, create tasks in tasks.json
    • Priority: issues affecting e-ink readability = high

Output Files

FileDescription
.kindle-review/screenshots/Device-specific screenshot folders
.kindle-review-report.mdGemini analysis report

All output files are gitignored.

Common Kindle Issues

After reviewing the report, common fixes include:

E-ink Readability

  • Increase code block font size
  • Ensure sufficient contrast
  • Avoid color-dependent information

Code Blocks

  • May need wider margins on Paperwhite
  • Consider shorter line lengths for better wrapping
  • Test syntax highlighting visibility on e-ink

Tables

  • Wide tables may need horizontal scrolling
  • Consider responsive table CSS
  • Test column alignment on narrow screens

Images

  • Verify diagrams are readable on e-ink
  • Check image sizing on different devices
  • Ensure alt text is meaningful

Differences from epub-review

Aspectepub-reviewkindle-review
ToolPlaywright (browser)Kindle Previewer (native)
FocusGeneral EPUB formattingKindle device compatibility
CSSCustom EPUB stylesheetKindle's built-in rendering
DevicesN/AMultiple Kindle models
OutputHow it looks in any readerHow it looks on Kindle

Troubleshooting

"Kindle Previewer 3 not installed"

Install with Homebrew (requires sudo):

bash
brew install --cask kindle-previewer

AppleScript Accessibility

Grant Terminal/Claude Code accessibility permissions in: System Settings > Privacy & Security > Accessibility

Screenshots Not Capturing

Ensure Kindle Previewer window is visible and not minimized.

EPUB Not Found

Build the EPUB first:

bash
./scripts/build-asciidoc.sh --epub