diagnose-pdf

diagnose-pdf is a skill for Claude Code from dieter-medium/bidi2pdf. It costs 83 tokens per session (929 once invoked), scanned A, original, MIT.

A troubleshooting checklist for PDFs made with bidi2pdf, including blank pages, missing styles or images, incorrect page counts, and broken text.

In plain words
What is it for?
Investigating why a generated PDF differs from the expected page and collecting a screenshot, PDF, and diagnostic data.
Why use it?
It helps identify whether the problem comes from failed network requests, browser errors, redirects, fonts, or rendering settings before you change the page itself.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the bidi2pdf plugin — 6 skills shipped together

Good fit Investigating why a generated PDF differs from the expected page and collecting a screenshot, PDF, and diagnostic data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dieter-medium/bidi2pdf/diagnose-pdf
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dieter-medium/bidi2pdf --skill diagnose-pdf
Clone the repo
git clone --depth 1 https://github.com/dieter-medium/bidi2pdf

Made for: Claude Code.

Or install bidi2pdf, the plugin that ships this one along with the rest of its 6 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for diagnose-pdf

README.md
[![agentmods](https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/diagnose-pdf/github.svg)](https://agentmods.dev/skills/dieter-medium/bidi2pdf/diagnose-pdf)
Your own site
<a href="https://agentmods.dev/skills/dieter-medium/bidi2pdf/diagnose-pdf"><img src="https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/diagnose-pdf/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for diagnose-pdf

Your own site · 80×15
<a href="https://agentmods.dev/skills/dieter-medium/bidi2pdf/diagnose-pdf"><img src="https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/diagnose-pdf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 929 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00083 $0.00929
Opus 5.5 $0.00033 $0.00372
Sonnet 5.5 $0.00017 $0.00186
Haiku 4.5 $0.00008 $0.00093

Measured yesterday against content hash 243b14e84104, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

diagnose-pdf scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-plugin/skills/diagnose-pdf/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Find out why a PDF looks wrong

Start with what Chrome reports, not with the page's code. Each check below names what to look at and the usual cause.

Does not: fix the page's design or CSS for you - it finds why the PDF differs from what was expected, then the fix belongs in the page or the render call.

1. Ask Chrome

bidi2pdf diagnose --url https://example.com/report --json --screenshot seen.png --pdf try.pdf

Use the same --remote-browser-url, cookies, headers and waits as the real render: a diagnosis of a different request explains nothing. Read the JSON in this order.

2. The checklist

  1. network_failures - every stylesheet, font, image or script the browser could not load. The most common cause of a blank or unstyled PDF: the address works from your machine but not from the browser's. A browser in a container resolves names in its own network; localhost there is the container itself. Use an address the browser can reach (for a Rails app, the asset host the browser sees - bidi2pdf-rails' asset-host setting), then diagnose again.
  2. console - a script error can stop the page before it renders its content.
  3. page.url / navigation.final_url - a redirect to a login page answers 200 and prints perfectly; the right cookies or headers are missing. (A 4xx/5xx answer fails the render with NAVIGATION_NOT_FOUND or NAVIGATION_FAILED instead.)
  4. fonts.status - loading or entries in fonts.failed: the PDF falls back to another font or shows boxes. Add a wait (--wait-network-idle), or fix the font URL (see 1).
  5. print_media - the page's @media print rules and @page rules. A print stylesheet that hides content, fixed_or_sticky_elements repeated on every page, or a @page size that fights --page-width. To print what the screen shows instead: --media screen.
  6. paged_js - detected: true but ready: false: Paged.js had not finished. Render with --wait-window-loaded and let the page set window.loaded = true when Paged.js is done; without that flag the wait runs into --default-timeout.
  7. Late content (charts, lazy images): --wait-network-idle, or a recipe with wait_for (selector: of the last thing that appears).
  8. Page count or cut-off content - page size and margins are in cm; Chrome's own default margin is 1 cm a side. A layout breakpoint follows the width between the side margins, not the paper's (96 / 2.54 CSS px per cm).
  9. Dates and number formats in form fields come from the browser's locale, not the page: set LANG/LANGUAGE on the browser's container (e.g. de_DE.UTF-8).
  10. Hyphenation (hyphens: auto does nothing, or breaks anywhere): the browser needs Chrome's hyphenation dictionaries installed for the page's lang. bidi2pdf's chromedriver image ships them; a self-built image may not. The page needs a correct lang attribute.

Read the full file on GitHub · 58 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 58 lines · 83 tokens per session scan A 243b14e84104

Subscribe to this mod's changes

diagnose-pdf is a skill published in the GitHub repository dieter-medium/bidi2pdf (58 stars, last pushed 9d ago), licensed MIT. It adds 83 tokens to every session and 929 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-26.