integrate-file-viewer

integrate-file-viewer is a skill for Claude Code from cognitedata/builder-skills. It costs 90 tokens per session (2,539 once invoked), scanned A, original, Apache-2.0.

A set of instructions for adding CogniteFileViewer to a Flows app so users can preview CDF files such as PDFs, images, and text. CDF is Cognite Data Fusion, a platform for working with industrial data.

In plain words
What is it for?
Integrating file previews into a Flows app, including resolving CDF files and displaying PDF, image, or text content.
Why use it?
It provides the required installation, Vite setup, PDF worker configuration, and component wiring, avoiding manual setup mistakes.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

not rated 6repo today A scan Socket: passSnyk: warnSkillSpector: warn 90 tokens original Apache-2.0

Good fit Integrating file previews into a Flows app, including resolving CDF files and displaying PDF, image, or text content.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cognitedata/builder-skills/integrate-file-viewer
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 cognitedata/builder-skills --skill integrate-file-viewer
Clone the repo
git clone --depth 1 https://github.com/cognitedata/builder-skills

Made for: Claude Code.

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 integrate-file-viewer

README.md
[![agentmods](https://agentmods.dev/badge/skills/cognitedata/builder-skills/integrate-file-viewer/github.svg)](https://agentmods.dev/skills/cognitedata/builder-skills/integrate-file-viewer)
Your own site
<a href="https://agentmods.dev/skills/cognitedata/builder-skills/integrate-file-viewer"><img src="https://agentmods.dev/badge/skills/cognitedata/builder-skills/integrate-file-viewer/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 integrate-file-viewer

Your own site · 80×15
<a href="https://agentmods.dev/skills/cognitedata/builder-skills/integrate-file-viewer"><img src="https://agentmods.dev/badge/skills/cognitedata/builder-skills/integrate-file-viewer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,539 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. Third-party audits
  • Socket pass 8 May 2026
  • Snyk warn 8 May 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 67
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • high Privilege Escalation · line 283
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
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.00090 $0.02539
Opus 5 $0.00045 $0.01269
Sonnet 5 $0.00018 $0.00508
Haiku 4.5 $0.00009 $0.00254

Measured 12d ago against content hash 4024fcd62339, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

integrate-file-viewer 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 12d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (code/fileResolution.ts, code/index.ts, code/mimeTypes.ts, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/integrate-file-viewer/SKILL.md · 288 lines

How it starts

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

Integrate CogniteFileViewer

Add CogniteFileViewer to this Flows app to preview CDF files (PDF, image, text).

Dependencies

The file-viewer library files (copied in Step 2) require this npm package:

Package Version
react-pdf ^9.1.1

pdfjs-dist ships as a dependency of react-pdf at the correct version — do not install it separately. react and @cognite/sdk are assumed to already be present in Flows apps.


Your job

Complete these steps in order. Read each file before modifying it.


Step 1 — Understand the app

Read these files before touching anything:

  • package.json — detect package manager (packageManager field or lock file) and existing deps
  • vite.config.ts — understand current Vite setup
  • The component where the viewer should be added

Step 2 — Copy the file-viewer source files

The file-viewer library lives in the code/ directory next to this skill file. Read and copy all files from there into src/cognite-file-viewer/ inside the app:

  • code/types.ts
  • code/mimeTypes.ts
  • code/fileResolution.ts
  • code/useViewport.ts
  • code/useFileResolver.ts
  • code/useDocumentAnnotations.ts
  • code/DocumentAnnotationOverlay.tsx
  • code/CogniteFileViewer.tsx
  • code/index.ts

The PDF.js worker is configured inside CogniteFileViewer.tsx — no separate consumer setup is needed.


Step 3 — Install dependencies

Install react-pdf (see Dependencies above) using the app's package manager:

  • pnpm → pnpm add react-pdf@^9.1.1
  • npm → npm install react-pdf@^9.1.1
  • yarn → yarn add react-pdf@^9.1.1

pnpm users: pnpm's strict linking may prevent the browser from resolving pdfjs-dist. Either add pdfjs-dist as a direct dependency (pnpm add pdfjs-dist), or add public-hoist-pattern[]=pdfjs-dist to .npmrc.


Step 4 — Configure Vite

Add optimizeDeps.exclude: ['pdfjs-dist'] to vite.config.ts to prevent Vite from pre-bundling pdfjs-dist (which breaks the worker):

Read the full file on GitHub · 288 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. 12d ago First seen · 288 lines · 90 tokens per session scan A 4024fcd62339

Subscribe to this mod's changes

integrate-file-viewer is a skill published in the GitHub repository cognitedata/builder-skills (6 stars, last pushed today), licensed Apache-2.0. It adds 90 tokens to every session and 2,539 once invoked, about $0.0005 per session on Opus 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-08-31.

Related

Other skills, from other repositories

paper2html

Convert an academic paper PDF into a publish-ready, self-contained single-page project homepage (a self-contained index.html) — the kind of paper landing page researchers host on GitHub Pages. Triggers when the user says "turn a paper into a project page/webpage", "paper2html", "generate a paper landing page / project…

QuZhan51496/paper2anything · 153 tokens

pdf-export

Add client-side PDF export to a web app using jspdf + html2canvas-pro. Use when the user asks to download, save, or export the current page, a report, a slide deck, a chart, or any DOM element as a PDF. Covers single-element snapshots and multi-page documents with TOC bookmarks. No server, no Puppeteer at runtime …

d-padmanabhan/agent-engineering-handbook · 81 tokens

glmv-pdf-to-web

Convert a PDF (research paper, technical report, or project document) into a beautiful single-page academic/project website with a structured outline JSON. Trigger this skill when the user wants to make a paper page, project homepage, or academic website from a PDF — in Chinese or English.

zai-org/GLM-skills · 63 tokens

pdf-slide-viewer

Convert PDF files into interactive web-based slide viewers. This skill should be used when the user provides a PDF file path and requests to create a website or web viewer for it (e.g., "make this PDF into a website", "create a slide viewer for this PDF", "PDF to web", "view this PDF as slides"). Creates a project…

joonlab/joonlab-claudecode-setting-for-share · 103 tokens

pdf-vue3

Use the pdf-vue3 Vue 3 component to render PDFs (URL, base64, or Uint8Array) with built-in virtual scrolling, crisp zoom, print, download, and page navigation. Trigger when the user asks to display a PDF in a Vue 3 / Nuxt 3 app, mentions pdf-vue3 or , needs to handle large/multi-thousand-page PDFs, S3 presigned URLs…

hymhub/pdf-vue3 · 123 tokens

doc-converter

Universal document format converter - DOCX, PDF, Markdown, HTML, TXT.

chainlesschain/chainlesschain · 19 tokens