Compares current Beamer PDF output against a baseline branch. Highlights visual differences to prevent regressions.

Install

mkdir -p .claude/skills/pdf-diff && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12005" && unzip -o skill.zip -d .claude/skills/pdf-diff && rm skill.zip

Installs to .claude/skills/pdf-diff

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Visual PDF regression test comparing current Beamer output against a baseline branch. Use when checking if slide changes introduced visual regressions.
151 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Compile current Beamer PDF output
  • Retrieve baseline Beamer PDF output from a specified branch
  • Compare two PDFs visually using `diff-pdf`
  • Report visual differences or confirm identity
  • Generate a diff PDF highlighting changes

How it works

The skill compiles the current and baseline versions of a Beamer PDF, then uses `diff-pdf` to compare them. It reports whether visual differences are detected and provides a diff PDF if they are.

Inputs & outputs

You give it
PaperName (e.g., SUNY, DreamZero) and an optional baseline branch (default: main)
You get back
A report indicating if visual differences were found, and a path to a diff PDF if differences exist

When to use pdf-diff

  • Validate slide deck changes
  • Ensure document formatting consistency
  • Detect visual bugs in academic papers

About this skill

Visual PDF Regression Test

Compare the current Beamer PDF output against a baseline branch to detect visual regressions.

Prerequisites

  • diff-pdf must be installed (brew install diff-pdf)
  • The paper's .tex file must compile successfully

Steps

Step 1: Parse arguments

  • First argument: PaperName (required, e.g., SUNY, DreamZero)
  • Second argument: baseline branch (optional, default: main)

Step 2: Compile current version

cd /Users/iyunseong/maangeek/paper2pr/Slides
TEXINPUTS=../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode $PAPER.tex
cp $PAPER.pdf /tmp/${PAPER}_current.pdf

Step 3: Get baseline version

cd /Users/iyunseong/maangeek/paper2pr
git stash --include-untracked
git checkout $BRANCH -- Slides/$PAPER.tex
cd Slides
TEXINPUTS=../Preambles:$TEXINPUTS xelatex -interaction=nonstopmode $PAPER.tex
cp $PAPER.pdf /tmp/${PAPER}_baseline.pdf
git checkout - -- Slides/$PAPER.tex
git stash pop

Step 4: Run diff-pdf

diff-pdf --output-diff=/tmp/${PAPER}_diff.pdf /tmp/${PAPER}_baseline.pdf /tmp/${PAPER}_current.pdf
echo "Exit code: $?"
  • Exit code 0: PDFs are visually identical
  • Exit code 1: Visual differences detected (diff PDF saved)

Step 5: Report results

  • If identical: "No visual regressions detected."
  • If different: "Visual differences found. Diff PDF saved to /tmp/${PAPER}_diff.pdf"
    • Open the diff PDF: open /tmp/${PAPER}_diff.pdf
    • Differences are highlighted in red

Step 6: Cleanup

rm -f /tmp/${PAPER}_current.pdf /tmp/${PAPER}_baseline.pdf

Keep the diff PDF for review if differences were found.

Notes

  • This compares full visual output, including fonts, spacing, and figure rendering
  • Single-pass XeLaTeX is sufficient for visual comparison (no bibtex needed)
  • For multi-page diffs, diff-pdf --skip-identical shows only changed pages

When not to use it

  • When `diff-pdf` is not installed
  • When the paper's `.tex` file does not compile successfully
  • When only text differences are needed

Prerequisites

`diff-pdf` must be installedThe paper's `.tex` file must compile successfully

Limitations

  • Requires `diff-pdf` to be installed
  • Requires the `.tex` file to compile successfully
  • Compares full visual output

How it compares

This skill automates the visual comparison of Beamer PDF outputs against a baseline, providing a clear diff, which is more efficient and accurate than manual visual inspection.

Compared to similar skills

pdf-diff side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
pdf-diff (this skill)04moReviewIntermediate
svelte-expert119moNo flagsIntermediate
home-assistant-integration-knowledge82moNo flagsAdvanced
writing-skills44moReviewAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry