pdf-diff-screenshots

Generate before and after PDF screenshot pairs from git branch changes.

1|3|Updated Jan 22, 2025
One-click install
npx skills add https://github.com/aousd/doc_build --skill pdf-diff-screenshots
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pdf-diff-screenshots
Source: https://github.com/aousd/doc_build/tree/main/.claude/skills/pdf-diff-screenshots
Command: npx skills add https://github.com/aousd/doc_build --skill pdf-diff-screenshots

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pillow, and includes scripts (resource) components.

What problem does it solve?

Reviewing visual changes to documentation built from Markdown sources is tedious and error-prone when done manually. This Skill eliminates the need to build before and after PDFs yourself, hunt for the right pages, and manually crop screenshots by automating the entire workflow from git analysis to side-by-side comparison images.

Core Features & Use Cases

  • Parallel Worktree Builds: Spins up isolated git worktrees to build before and after diff PDFs simultaneously, ensuring clean state and fast turnaround.
  • Semantic Page Targeting: Reads PDF text to locate the exact pages affected by the branch, avoiding wasteful pixel-diffing of unchanged pages.
  • Intelligent Region Cropping: Crops screenshots to pertinent sections using semantic understanding of diff substitution units and content reflow, not just raw pixel differences.
  • Use Case: A technical writer modifies a specification section and needs to show the reviewer exactly how the rendered PDF changed, including figure captions and surrounding context.

Quick Start

Use the pdf-diff-screenshots skill to generate focused before and after screenshot pairs for the changes introduced by the current git branch.

Frequently Asked Questions about pdf-diff-screenshots

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compare visual changes in PDF documentation across git branches?

Comparing PDF documentation changes across git branches is done by generating focused before and after screenshot pairs. The skill automates building isolated worktree PDFs, locating affected pages, and cropping pertinent sections to produce side-by-side composites.

Do I need pdftoppm and pixi to generate PDF diff screenshots from markdown builds?

Yes, you need pdftoppm, pixi, and uv to generate PDF diff screenshots. These dependencies are required to build isolated worktree PDFs, render targeted pages, and process the visual output for markdown-to-PDF builds.

What is the best way to show reviewers how a rendered PDF changed after modifying a specification?

The best way to show reviewers rendered PDF changes is to use semantic page targeting and intelligent region cropping. This approach reads PDF text to locate exact affected pages and crops screenshots to pertinent sections, avoiding wasteful pixel-diffing of unchanged pages.

How does semantic page targeting work when diffing PDFs from a git worktree?

Semantic page targeting works by reading PDF text to locate the exact pages affected by a git branch. It avoids pixel-diffing unchanged pages and uses semantic understanding of diff substitution units and content reflow to crop only pertinent regions.

Can I automate cropping screenshots to pertinent sections for documentation layout shifts?

Yes, you can automate cropping screenshots to pertinent sections for layout shifts. The skill applies intelligent region cropping using semantic understanding of diff substitution units and content reflow, rather than relying on raw pixel differences.

Why does pixel-diffing unchanged PDF pages waste time during documentation reviews?

Pixel-diffing unchanged PDF pages wastes time because it processes irrelevant content. Semantic page targeting solves this by reading the PDF text to locate only the exact pages affected by the branch, ensuring focused before and after screenshot pairs.