ebook-writer: Skill for Claude Code

.claude/skills/web-viewer-builder/SKILL.md

web-viewer-builder is a skill for Claude Code from lowtidebuild/ebook-writer. It costs 0 tokens per session (877 once invoked), scanned A, original, Apache-2.0.

A tool that turns finished PDF books into a browser-based ebook viewer using PDF.js, a library for displaying PDFs on web pages.

In plain words
What is it for?
Use it to build a deployable viewer with book spreads, page-turn animation, chapter navigation, and one- or two-language support.
Why use it?
It provides web navigation and page display for PDFs without requiring readers to download them.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is lowtidebuild/ebook-writer's own configuration. It tells Claude Code how to work on ebook-writer itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ebook-writer configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lowtidebuild/ebook-writer. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/lowtidebuild/ebook-writer/main/.claude/skills/web-viewer-builder/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/lowtidebuild/ebook-writer

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 web-viewer-builder

README.md
[![agentmods](https://agentmods.dev/badge/skills/lowtidebuild/ebook-writer/web-viewer-builder.svg)](https://agentmods.dev/skills/lowtidebuild/ebook-writer/web-viewer-builder)
Your own site
<a href="https://agentmods.dev/skills/lowtidebuild/ebook-writer/web-viewer-builder"><img src="https://agentmods.dev/badge/skills/lowtidebuild/ebook-writer/web-viewer-builder.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 877 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.00000 $0.00877
Opus 5 $0.00000 $0.00439
Sonnet 5 $0.00000 $0.00175
Haiku 4.5 $0.00000 $0.00088

Measured 8d ago against content hash c00cb2d728f1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

web-viewer-builder 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 8d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/build_viewer.py), 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.

.claude/skills/web-viewer-builder/SKILL.md · 82 lines

How it starts

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

Web Viewer Builder Skill

Purpose

Generate a PDF.js-based web ebook viewer from the typeset PDFs. The viewer renders the actual PDF pages with a two-page book spread layout, page-turn animation, chapter navigation sidebar, and bilingual language toggle. Deployable to GitHub Pages.

When to Use

Step 8 of the ebook pipeline — after PDFs have been generated in Step 7. This skill takes the finalized PDF files and produces a deployable web viewer.

Script

scripts/build_viewer.py

Usage

.venv/bin/python3 .claude/skills/web-viewer-builder/scripts/build_viewer.py \
  --pdf-primary output/final/book_ko.pdf \
  --pdf-secondary output/final/book_en.pdf \
  --output output/web-viewer/ \
  --template .claude/skills/web-viewer-builder/references/viewer_template.html \
  --title "Book Title" \
  --title-secondary "Book Title (EN)" \
  --primary-lang ko \
  --secondary-lang en

Arguments

Argument Required Description
--pdf-primary Yes Path to primary language PDF
--pdf-secondary No Path to secondary language PDF; omit for a single-language viewer
--output Yes Output directory for the web viewer
--template Yes Path to viewer_template.html
--title Yes Book title (primary language)
--title-secondary No Book title (secondary language)
--primary-lang No Primary language code, default ko
--secondary-lang No Secondary language code, default en

How It Works

  1. Build time: PyMuPDF scans both PDFs for chapter headings (font size >= 14pt in top 40% of page)
  2. Build time: Chapter-to-page mapping is extracted and embedded as JSON in the HTML
  3. Runtime: PDF.js loads and renders the PDF pages on canvas elements
  4. Runtime: Sidebar is populated instantly from the embedded JSON (no client-side scanning)
  5. Single-language mode: When --pdf-secondary is omitted or missing, the language toggle is hidden instead of pointing both buttons at the primary PDF

Read the full file on GitHub · 82 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 82 lines · 0 tokens per session scan A c00cb2d728f1

Subscribe to this mod's changes

web-viewer-builder is a skill published in the GitHub repository lowtidebuild/ebook-writer (5 stars, last pushed 2mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 877 tokens. 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.