Skip to content
AI Agent Skills

React PDF Kit publishes a list of AI Agent Skills at react-pdf-kit/agent-skills. These are small, focused SKILL.md files that teach AI coding assistants (Claude Code, Cursor, OpenCode, Codex, and any tool that follows the agentskills.io specification) how to integrate @react-pdf-kit/viewer correctly the first time.

Skills are installed into your project with the open-source vercel-labs/skills CLI, typically via a single npx skills add command. Your AI assistant then produces the right component nesting, the right peer-dependency setup, the right bundler-specific worker config, and the right Next.js 14 override without further prompting.

SkillWhat it covers
react-pdf-kit-setupInstall, peer deps, the canonical RPConfig, RPProvider, RPLayout, RPPages chain, worker config for a generic React app
react-pdf-kit-nextjs-app-routerNext.js 13+ App Router: 'use client' boundary, dynamic import, worker URL via new URL(..., import.meta.url)
react-pdf-kit-nextjs-pages-routerNext.js Pages Router: SSR-safe next/dynamic import with ssr: false, _app.tsx notes
react-pdf-kit-viteVite 5 + worker integration, ESM import order, optimizeDeps tweak
react-pdf-kit-worker-configPDF.js worker URL across every supported bundler (Vite, Turbopack, webpack), CDN-hosted and self-hosted recipes, CSP worker-src notes
react-pdf-kit-toolbar-customizationAdd, remove, or replace individual toolbar tools while preserving Radix-based accessibility
react-pdf-kit-custom-layoutHeadless usage: replace RPLayout entirely while keeping RPProvider and RPPages, using only the documented hooks
react-pdf-kit-nextjs14-pdfjs-overrideOverride pdfjs-dist to v4 to work around the Next.js 14 webpack ESM bug

Each skill is a self-contained markdown file with YAML frontmatter (name, description, supported react_pdf_kit_version / pdfjs_dist_version semver ranges) and concise procedure. The format follows the agentskills.io specification, so any AI assistant can read them.

  1. Discover the available skills from the project that uses @react-pdf-kit/viewer:

    Terminal window
    bunx skills find "react pdf kit"

    You’ll get a ranked list of skills with their name, description, and supported library version range.

  2. Install one skill (recommended, since this only pulls what you need):

    Terminal window
    bunx skills add react-pdf-kit/agent-skills#react-pdf-kit-nextjs-app-router

    Or install every skill in the list:

    Terminal window
    bunx skills add react-pdf-kit/agent-skills
  3. Ask your assistant. With the skill installed, your AI activates it automatically when you ask about React PDF Kit. Try a prompt like:

    Add a PDF viewer for report.pdf to my Next.js project.

    The generated code should compile and render the first PDF page on the first attempt.

The CLI handles per-agent routing. You don’t need to know these paths to use the skills list. They’re listed here for reference if you want to inspect what was installed.

AgentProject install pathGlobal install path
Claude Code.claude/skills/~/.claude/skills/
Cursor.agents/skills/~/.cursor/skills/
OpenCode.agents/skills/~/.config/opencode/skills/
Codex.agents/skills/~/.codex/skills/

Cross-agent compatibility is achieved because every skill is authored to the shared agentskills.io specification. There are no per-agent forks.

Once installed, your assistant loads the skill whose description matches your intent. Examples:

  • “Add a PDF viewer to my Next.js 14 app” → react-pdf-kit-nextjs14-pdfjs-override runs first, then react-pdf-kit-nextjs-app-router (or react-pdf-kit-nextjs-pages-router if you’re on the Pages Router).
  • “Build a custom toolbar with only zoom and print” → react-pdf-kit-toolbar-customization loads.
  • “I want to replace the default layout entirely” → react-pdf-kit-custom-layout loads.
  • “Where does my PDF.js worker need to live for Vite?” → react-pdf-kit-worker-config loads.

You don’t have to memorize skill names. The descriptions are written to match natural phrasing.

Ask your assistant to set up @react-pdf-kit/viewer in your project. The generated code should:

  1. Use the canonical provider chain RPConfig, RPProvider, RPLayout, RPPages in that order. RPTheme is optional and slots in between RPProvider and RPLayout when explicit theming control is needed.
  2. Install both @react-pdf-kit/viewer and the pdfjs-dist peer dependency at the right major version.
  3. Configure the PDF.js worker via new URL('pdfjs-dist/build/pdf.worker.min.mjs', import.meta.url).toString() (or the framework-specific equivalent for Next.js).
  4. Wrap the viewer in a container with an explicit height (otherwise virtualization can’t measure).
  5. Not invent APIs, hooks, props, or CSS variables that don’t exist in the library at the declared version range.

If any of those are wrong, run npx skills list to confirm the skill actually installed.

To pull the latest version of any installed skill:

Terminal window
npx skills update

The skills list is versioned with git tags (vMAJOR.MINOR.PATCH); update resolves to the latest tagged release.

To uninstall a skill from your project:

Terminal window
npx skills remove react-pdf-kit-nextjs-app-router

This operates on your local install.