pdf-specs

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

Testing instructions for RSpec, a Ruby testing framework, when tests create or inspect PDFs with bidi2pdf. It includes checks for page counts, text, and images.

In plain words
What is it for?
Writing RSpec tests for generated PDFs and browser pages, including tests for PDF text, pages, images, and rendering failures.
Why use it?
It helps make PDF tests repeatable and avoids flaky browser setup, especially when tests need Chrome running in Docker.

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 Writing RSpec tests for generated PDFs and browser pages, including tests for PDF text, pages, images, and rendering failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dieter-medium/bidi2pdf/pdf-specs
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 pdf-specs
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 pdf-specs

README.md
[![agentmods](https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/pdf-specs/github.svg)](https://agentmods.dev/skills/dieter-medium/bidi2pdf/pdf-specs)
Your own site
<a href="https://agentmods.dev/skills/dieter-medium/bidi2pdf/pdf-specs"><img src="https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/pdf-specs/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 pdf-specs

Your own site · 80×15
<a href="https://agentmods.dev/skills/dieter-medium/bidi2pdf/pdf-specs"><img src="https://agentmods.dev/badge/skills/dieter-medium/bidi2pdf/pdf-specs.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 998 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.00063 $0.00998
Opus 5.5 $0.00025 $0.00399
Sonnet 5.5 $0.00013 $0.00200
Haiku 4.5 $0.00006 $0.00100

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

Security

Grade A, and why

pdf-specs 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 today.

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/pdf-specs/SKILL.md · 77 lines

How it starts

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

RSpec specs with bidi2pdf's test helpers

bidi2pdf ships RSpec matchers for PDFs and helpers that start a chromedriver container for the suite. This skill is how to use them, and the mistakes that made such specs flaky before.

Does not: replace a project's own spec conventions - follow those for naming and layout. And it does not cover bidi2pdf-rails' own test helpers (see that gem).

Ground rules

  • bidi2pdf is the renderer. If it fails, report its error.code, error.hint and exit code; never make the PDF or screenshot another way (Chrome's own print-to-PDF, another PDF engine).
  • Install nothing unasked. Name what is missing and suggest a way (the render-pdf skill's preflight); run nothing that changes the system without the user's yes.
  • bidi2pdf's results first. Read its --json result instead of inspecting the PDF with other tools.

1. Set up

# spec/spec_helper.rb
require "bidi2pdf/test_helpers"             # matchers and file helpers; needs pdf-reader, diff-lcs, unicode_utils
require "bidi2pdf/test_helpers/images"      # only for contains_pdf_image (ruby-vips, dhash-vips)
require "bidi2pdf/test_helpers/testcontainers" # only to start Chrome in Docker for the suite

Add the gems the comments name to the test group of the Gemfile; each helper warns when one is missing instead of failing the suite.

2. Assert on the PDF

pdf = tab.print                                   # base64; a path or raw bytes work too
expect(pdf).to have_pdf_page_count(2)
expect(pdf).to contains_pdf_text("Invoice #123")
expect(pdf).to contains_pdf_text(/Total: \d+/).at_page(2)
expect(pdf).to match_pdf_text(expected_pdf)       # the whole text equal, after cleaning both texts
expect(pdf).to contains_pdf_image("spec/fixtures/logo.png").at_page(1) # perceptually similar, tolerance: 10
  • PDF text extraction lays words out by position: a sidebar and a main column can interleave on one line. Assert on words that occur once, not on whole lines.
  • One render, several fields of it, is one example; do not render the same PDF again per field.

Read the full file on GitHub · 77 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. today Changed · +9 lines 8bc56c108a7b
  2. yesterday First seen · 68 lines · 63 tokens per session scan A d2391f6c9dee

Subscribe to this mod's changes

pdf-specs is a skill published in the GitHub repository dieter-medium/bidi2pdf (58 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 998 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.

Related

Other skills, from other repositories

foundry-hosted-agent-validation

Step-by-step process for validating a Python Foundry hosted agent sample (under python/samples/04-hosting/foundry-hosted-agents/) end to end — running it locally (native runtime and azd ai agent run) and after deploying it to an Azure AI Foundry project with azd. Use this when asked to validate a hosted agent sample.

microsoft/agent-framework · 82 tokens

android-do-not-mock

How to write (or fix) Chromium Java unit tests (Robolectric / JUnit) without mocking or spying android.view.View, android.app.Activity, or their subclasses. Use when removing @SuppressWarnings("DoNotMock"), fixing a "DoNotMock" Error Prone error, replacing Mockito.mock(View.class) / @Mock Activity / spy(view), or when…

chromium/chromium · 96 tokens

sync-new-data-type

Adds scaffolding for a new Sync data type in Chromium across protocol buffers, DataType definitions, feature flags, controller builders, unit tests, and metrics.

chromium/chromium · 36 tokens

android-unit-test

Guide for writing and converting Chromium Android unit tests across host Robolectric (chromejunittests) and on-device (chromepublicunittestapk) suites.

chromium/chromium · 36 tokens

policy-creation

Guide for adding new enterprise policies to Chromium. Complete guide for policy definitions, pref mapping, and writing tests.

chromium/chromium · 26 tokens

test-conversion-researcher

Researcher for converting unit tests to browser tests for Project Bedrock. Invoke this when the user needs to understand the current codebase behavior while removing complex Browser dependencies from tests.

chromium/chromium · 42 tokens