This file provides guidance to Claude Code (claude.ai/code) when working in this repository.
This is @react-pdf-kit/agent-skills, the public catalog of agent
skills that teach AI coding agents how to integrate
@react-pdf-kit/viewer
correctly. The catalog conforms to the
agentskills.io specification and is installed
into consumer projects via the
vercel-labs/skills CLI
(npx skills add react-pdf-kit/agent-skills#<skill-name>).
It is a content/documentation repo, not a JavaScript application.
.
├── README.md # consumer-facing overview + worked examples
├── MAINTENANCE.md # release runbook, deprecation flow, security stance
├── CHANGELOG.md # one section per tagged release
├── LICENSE # MIT
├── skills/<skill-name>/SKILL.md # the catalog content (8 skills at v1)
├── samples/<sample>/ # runnable sample projects used to verify skills
├── scripts/verify-skill.sh # per-skill conformance check (R-10..R-20)
├── scripts/verify-all.sh # run verify-skill.sh across skills/
├── scripts/apply-skill-to-sample.sh # copy assets/ from a skill into a sample
├── scripts/check-changelog.sh # release.yml gate
└── .github/workflows/ # verify.yml, samples.yml, release.yml
External contributions are not currently accepted. See the
"Contributions" section in README.md. The author workflow below is
for maintainers.
# Run conformance checks against every skill (CI runs this on every PR)
scripts/verify-all.sh
# Validate one skill in isolation
scripts/verify-skill.sh skills/react-pdf-kit-setup
# Apply a skill into a sample project (used during contributor verification)
scripts/apply-skill-to-sample.sh react-pdf-kit-nextjs-app-router nextjs-app-router
# Validate the CHANGELOG section for a tag (used by release.yml)
scripts/check-changelog.sh v1.0.0-
Scaffold:
npx skills init react-pdf-kit-<topic>, then move the resultingSKILL.mdintoskills/react-pdf-kit-<topic>/. -
Fill the required YAML frontmatter:
--- name: react-pdf-kit-<topic> # MUST equal the directory name description: <one sentence, ≤200 chars> metadata: react_pdf_kit_version: ">=2.0.0 <3.0.0" pdfjs_dist_version: ">=5.0.0 <6.0.0" frameworks: [react] # optional; subset of [react, next.js, vite, webpack] ---
Allow-listed fields only.
verify-skill.shrule R-15 fails on unknown keys. Optional:metadata.tags,metadata.deprecated_in,metadata.internal. -
Author the body (≤500 lines / ~5,000 tokens) following the agentskills.io best practices. Recommended section order: Lead paragraph → Gotchas → Procedure → Verify → References. Long reference material lives under
references/, loaded conditionally ("Read X when …"). -
Add the skill to a sample project (or add a new sample), then verify locally:
scripts/verify-skill.sh skills/react-pdf-kit-<topic> scripts/apply-skill-to-sample.sh react-pdf-kit-<topic> <sample-name> (cd samples/<sample-name> && pnpm install && pnpm build)
All three must succeed.
-
Update
MAINTENANCE.md§"Sample inventory" if the Skill ↔ Sample mapping changed. UpdateREADME.md's "Skill Catalog" table with the new row. -
Add a CHANGELOG entry under
## [Unreleased]→### Addednaming the new skill.
CI (.github/workflows/verify.yml + samples.yml) re-runs the
conformance script and the sample-build matrix on every PR.
The library that this catalog teaches is governed by a project constitution that lives in the React PDF Kit workspace (not in this repo). Skills MUST NOT contradict its five principles:
- Viewer-First Experience: never advise patterns that degrade reader UX (text selection, keyboard nav, a11y).
- Integrator Respect: no globals, no peer-dep bundling, no bundler monkey-patching.
- Composable & Headless-Capable: default-layout skills use the full provider chain; customization skills use documented hooks only.
- Performance & Rendering Discipline: no instruction breaks virtualization or moves PDF.js off the worker.
- Peer Dependency & Compatibility Stewardship: every skill
declares
metadata.react_pdf_kit_versionandmetadata.pdfjs_dist_versionmatching the sample that verified it.
Maintainers reviewing a new skill MUST evaluate it against each of these five principles before merge.
pdfjs-distis an auto-installed peer dependency (default v5.4.530, ESM-only). Consumers install only@react-pdf-kit/viewer;pdfjs-distis installed separately only to override the version. Works on Vite, Turbopack, Next.js 15, webpack 5.- Next.js 14 is NOT supported by v2 (its webpack ESM interop breaks
pdfjs-dist@5, the documented bug). Thereact-pdf-kit-nextjs14-pdfjs-overrideskill documents the two paths: upgrade to Next.js 15 (Turbopack), or stay on Next.js 14 with the legacy@pdf-viewer/reactpackage.
See MAINTENANCE.md. Releases are tagged vMAJOR.MINOR.PATCH;
the release.yml workflow validates the CHANGELOG entry and
publishes a GitHub release.