figure-remap

figure-remap is a skill for Claude Code, Codex from drpwchen/textbook-to-note. It costs 126 tokens per session (6,449 once invoked), scanned A, original, MIT.

A document-grounding workflow that extracts individual figures from PDF textbooks and checks that each extracted image is the intended figure.

In plain words
What is it for?
Use it when adding anatomy, classification, algorithm, or imaging figures to notes, including cases where a fast existing crop must be checked or recreated.
Why use it?
It reduces the risk of embedding a wrong, blank, or irrelevant page crop in study notes by using validation and controlled retry steps.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding anatomy, classification, algorithm, or imaging figures to notes, including cases where a fast existing crop must be checked or recreated.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/drpwchen/textbook-to-note/figure-remap
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 drpwchen/textbook-to-note --skill figure-remap
Clone the repo
git clone --depth 1 https://github.com/drpwchen/textbook-to-note

Made for: Claude Code, Codex.

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 figure-remap

README.md
[![agentmods](https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/figure-remap/github.svg)](https://agentmods.dev/skills/drpwchen/textbook-to-note/figure-remap)
Your own site
<a href="https://agentmods.dev/skills/drpwchen/textbook-to-note/figure-remap"><img src="https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/figure-remap/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 figure-remap

Your own site · 80×15
<a href="https://agentmods.dev/skills/drpwchen/textbook-to-note/figure-remap"><img src="https://agentmods.dev/badge/skills/drpwchen/textbook-to-note/figure-remap.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 126 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,449 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
  • 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 Prompt Injection · line 207
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
  • high Prompt Injection · line 381
    Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.
    Fix: Audit all comments and invisible characters. Remove any instructions that direct the agent to perform unauthorized actions. Use plain, reviewable content.
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.00126 $0.06449
Opus 5 $0.00063 $0.03224
Sonnet 5 $0.00025 $0.01290
Haiku 4.5 $0.00013 $0.00645

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

Security

Grade A, and why

figure-remap 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 9d ago.

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/figure-remap/SKILL.md · 515 lines

How it starts

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

figure-remap — deterministic document-grounding system

This skill calls scripts in your clone of the textbook-to-note repo. At install time, replace {REPO} below with the absolute path of the clone.

Architecture (read this before implementation details)

figure-remap is a multi-backend deterministic document-grounding system, not a "crop utility." The system has six explicit layers:

┌─ Contract ──────────────────────────────────────────┐
│  figure_remap.extract() → {status, match_quality,   │
│  hard_fail, file, fig_id, reason}                   │
├─ Policy ─────────────────────────────────────────────┤
│  strict = deterministic + ambiguity-intolerant      │
│  L1 / L2 / L3 hard-fail hierarchy                   │
├─ Junk pre-gate ─────────────────────────────────────┤
│  pregate.verdict() on a QC-passed crop:             │
│  chapter-banner geometry / blank → kill, no retry   │
├─ Backend selection ─────────────────────────────────┤
│  Capability-based: _select_backend()                │
│    "geometric"  | "caption_anchor" | [future]       │
├─ Backends ──────────────────────────────────────────┤
│  geometric_match_bbox()  — born-digital rasters     │
│  caption_anchor_bbox()   — scanned / hybrid scans   │
│  [future] layout-aware / table-aware                │
├─ Analysis & cache ──────────────────────────────────┤
│  PageDerived (per-page, sha1-keyed, policy-versioned)│
│  _render_cache/<sha1>_pg<N>_<dpi>dpi.png            │
├─ Debug artifacts ───────────────────────────────────┤
│  <out>.fail.json on every scanned-mode hard_fail    │
└─────────────────────────────────────────────────────┘

Future backends plug in at the Backend layer with their own capability check and a function returning bbox + ambiguity flags — nothing above changes.

==Architectural freeze rule==: do not add per-book heuristics or if scanned/elif born-digital branches into the gate function. New behavior goes into a new backend plus a new capability check in _select_backend.

Read the full file on GitHub · 515 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. 9d ago First seen · 515 lines · 0 tokens per session scan A 0536e22a2e7d

Subscribe to this mod's changes

figure-remap is a skill published in the GitHub repository drpwchen/textbook-to-note (100 stars, last pushed 13d ago), licensed MIT. It adds 126 tokens to every session and 6,449 once invoked, about $0.0006 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-30.

Related

Other skills, from other repositories

lecture-to-notes

A workflow that turns lecture or conference recordings into organised notes using local transcription and slide extraction. It accepts video and audio files, including MOV, MP4, M4A, MP3, and WAV.

drpwchen/lecture-to-notes · 87 tokens

paddleocr-doc-parsing

A document-parsing tool configuration for extracting structured Markdown or JSON from complex PDFs and document images, including tables, formulas, charts, and multi-column pages.

PaddlePaddle/PaddleOCR · 140 tokens

paddleocr-text-recognition

An optical character recognition tool configuration for extracting text from images, photos, scans, screenshots, and scanned PDFs. OCR means converting text visible in an image into machine-readable text.

PaddlePaddle/PaddleOCR · 125 tokens

patent-reader

A plain-language reader for Chinese patents that turns a publication number or PDF into notes, diagrams, and an Obsidian entry. Obsidian is a note-taking app that stores linked Markdown files.

handsomestWei/patent-disclosure-skill · 31 tokens

document-query

Use when reading, extracting, summarizing, comparing, or answering questions over local or remote documents, code files, PDFs, Office files, HTML/text files, large text-heavy files, and fallback OCR for document images or scans when vision tools are unavailable or insufficient.

agent0ai/agent-zero · 56 tokens

document-processing

Use when the deliverable is a document's bytes or its literal content — text/tables out of PDFs, AcroForm fill and flatten, page merge/split, PDF/DOCX from templates, OCR of image-only scans. NOT schema-typed fields pulled from text (that is structured-extraction), NOT signature routing (e-signature) or spreadsheet…

ericrisco/rsc-harness · 84 tokens