Transforms phone photos of paper documents into clean scanner-quality PDFs with perspective rectification and noteshrink whitening. Also synthesizes handwriting-style signatures onto digital documents for a signed-and-scanned look.
Ships in daymade-docs. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Two related pipelines, same destination look, different starting point: phone photos of paper documents, or a digital document that needs a synthetic signature before it looks signed. The pipelines that work, and the failure modes that ship wrong PDFs if skipped.
Which one do you need?
| The input is... | Use |
|---|---|
| Existing ID/passport photos needed as printable copies | Read identity-document copies before processing; bind required sides/pages and the recipient's accepted copy form |
| Phone photos of an already-signed/stamped paper document | This file, main pipeline below |
| A digital document (docx/PDF) with no signature yet, and you need to make it look hand-signed | references/digital-signature-synthesis.md |
photos ──► rectify (photo_to_scan.py --raw)
──► ORDER BY CONTENT, detect colored paper ← agent eyes, not filenames
──► enhance: noteshrink (white batch with -g │ colored pages separately,
after white-balance pre-pass)
──► assemble_pdf.py → A4 PDF
──► make_contact_sheet.py → READ IT, verify EVERY page ← mandatory
Division of labor: scripts carry execution; you (the agent) carry the two judgment steps — content-based page ordering, and whole-document verification. Neither can be automated away: filenames lie about order, and per-page spot checks miss wrong-slot bugs. The digital-signature branch shares this same philosophy with its own two judgment calls — see the reference file.
which pdftoppm || brew install poppler # contact sheet + any PDF rendering
uvx noteshrink --help | head -3 # first run builds it (~30 s)
Scripts are uv run single-file scripts (PEP 723); OpenCV/PIL/img2pdf resolve
automatically on first run.
uv run <skill>/scripts/photo_to_scan.py --raw --out-dir work --prefix page \
photo1.jpg photo2.jpg ...
Expected: one page_NN.jpg per photo, each tagged [quad]. A
[FULLFRAME-fallback] tag means the paper outline wasn't found (busy background,
page cut off) — view that photo and decide: retake, or accept the uncropped frame.
The script handles EXIF rotation internally (cv2.imread ignores EXIF; phone
photos come rotated — this silently produces sideways pages if you rectify with
raw OpenCV).
Read every rectified image (batch of ~6 per message) and record two things:
B > R + 25 ⇒ blue-ish paper.Build the final page order as an explicit list before proceeding. If pages are supposed to match an external register (an invoice list, a session table), cross-check identity against it now — missing/duplicate pages found here cost seconds; found after delivery they cost a redo.
White-paper pages — one batch, global palette:
uvx noteshrink -w -g -K -q -b ns -c "true" page_03.jpg page_01.jpg page_07.jpg ...
# inputs IN FINAL PAGE ORDER → outputs ns0000.png, ns0001.png, ... in that order
-w white background, -g one global palette (uniform ink/stamp color across
pages), -K keep given order, -c "true" skips its internal PDF step (we
assemble ourselves).$VAR — a file list in
a variable arrives as one giant "filename", noteshrink exits without output,
and -q keeps it silent. Verify outputs exist (ls ns0*.png) rather than
trusting stdout.Colored-paper pages — separate, with white-balance pre-pass:
uv run <skill>/scripts/photo_to_scan.py --out-dir work --prefix wb colored_photo.jpg # no --raw
uvx noteshrink -w -g -K -q -b nc -c "true" work/wb_01.jpg
Two distinct failure modes force this split (both shipped as bugs before the rule existed):
-g batch poison the whole document — the paper
color enters the global palette and white pages come out with tinted
shadows/artifacts.--raw) mode of photo_to_scan.py
divides out the paper color first, so ink returns to black and stamps to red.uv run <skill>/scripts/assemble_pdf.py --out scanned.pdf \
ns0000.png ns0001.png nc0000.png ns0002.png ... # FINAL page order
Expected: OK scanned.pdf (N pages, ~0.05 MB/page). Edge crop (default
24px top / 12px sides at 200 dpi) removes the sliver of desk surface that
rectification drags in along page borders; document margins dwarf it.
uv run <skill>/scripts/make_contact_sheet.py scanned.pdf --out contact.png
Read contact.png and check every page: identity sequence complete and
correct (each date/title where it should be, no duplicates, none missing), no
off-color page, stamps/signatures present. Then spot-read 1–2 pages at full
resolution for text sharpness.
For identity documents, also reconcile the required sides/spread against the source-coverage table from the linked identity-copy procedure. A readable data page or matching PDF page count does not establish a complete required spread.
Why whole-document, every time: two shipped-bug stories from the session this skill was distilled from —
The cost asymmetry is absolute: contact sheet = one Read; a wrong page in a delivered PDF = redo + lost trust. "I verified the pages I changed" is not verification.
Keep the per-page enhanced PNGs (ns*/nc*) as the working set. To replace page
k: process the new photo through Steps 1–3, overwrite that page's PNG, re-run
Steps 4–5. When copying into numbered slots, mind the mapping — slot numbers
shift when photo order was reversed; derive the slot from the page's content
identity, never from its position in the photo batch. Then the Step 5 full
check is what actually protects you.
| Symptom | Cause / fix |
|---|---|
| Output "doesn't look scanned" — gray haze, soft text | You hand-rolled levels/curves/divide enhancement. Don't — two attempts were rejected by a real user before switching to noteshrink (background sampling + palette quantization is what produces the flat-white scan look). |
| White pages have tinted shadows | A colored-paper page was inside the -g batch. Re-run whites-only batch (Step 3). |
| Ink looks blue/purple, stamp looks maroon on a colored page | noteshrink got the colored page raw. Insert the white-balance pre-pass (photo_to_scan.py without --raw). |
| noteshrink produced no output, no error | File list passed via an unquoted shell variable under zsh (no word splitting), or paths with spaces. Pass explicit filenames; check ls ns0*.png. |
| Page sideways / upside down | EXIF ignored somewhere upstream, or the quad landed landscape. photo_to_scan.py corrects EXIF + rotates to portrait; upside-down pages it cannot know — catch at Step 2 and rotate the source photo. |
[FULLFRAME-fallback] on a photo | Paper outline not detected (low contrast vs table, page cut off). Retake against a dark background, or accept full frame + rely on edge crop. |
| Thin dark strip along page edge in the PDF | Desk surface dragged in by rectification. Raise --crop-top/--crop-side in assemble_pdf.py. |
| Pages in wrong order in the PDF | Filename-order assumption. Order comes from Step 2 content reading, passed explicitly to noteshrink (-K) and assemble_pdf.py. |
references/digital-signature-synthesis.md (opens in a new tab)references/identity-document-copies.md (opens in a new tab)scripts/assemble_pdf.py (opens in a new tab)scripts/make_contact_sheet.py (opens in a new tab)scripts/photo_to_scan.py (opens in a new tab)scripts/synthesize_signature.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/daymade-docs:photo-to-scanned-pdffrom daymade-docs
npx claudepluginhub daymade/claude-code-skills --plugin daymade-docs11 skills in this plugin
/docs-cleanerConsolidates redundant documentation while preserving all valuable content; keeps a doc set truthful after things change. Modes: (1) POST-CHANGE GOVERNANCE — when code, scripts, config, env vars, ports, paths, deployment, auth, tests, or a documented procedure changed; also "which docs are now wrong", "check docs for inconsistencies", "过时的命令/路径", "文档同步". Use it even when the user mentions only the change and never the docs — updating them is part of the change, not optional cleanup. (2) CONSOLIDATION — "clean up docs", "documentation bloat", "reduce documentation sprawl", "consolidate documentation", "too many doc files", "merge redundant docs", "merge these docs", "文档太多/太乱", multiple files covering the same topic, or documentation exceeding 500 lines across multiple files on similar topics. Finds stale copies of a fact changed in only one place, values that should never have been persisted (counts, totals, "N items", restated summaries), rival definitions that drift apart, and orphaned cross-references./docs-routerWord/PDF/PPTX/HTML→MD;MD/Word→PDF;new Word;PDF HTML/translate;Excel/xlsm/Mac;photo/signed scan;Mermaid;DOCX review;doc cleanup Reads one bundled Daymade specialist. New slide decks use deck-creator when installed; generic PDF reading/editing and spreadsheet analysis stay with their own Skills. Retired ppt-creator stays manual-only./doc-to-markdownConverts DOCX/PDF/PPTX and saved HTML/HTM to high-quality Markdown with automatic post-processing. Fixes pandoc grid tables, simple tables, image paths, CJK bold spacing, attribute noise, and code blocks; for PDFs also strips OCR garbage blocks, repeated headers/footers/watermarks, and absolute image paths from pymupdf4llm output. Trigger on "convert document", "docx to markdown", "parse word", "doc to markdown", "解析word", "转换文档", "HTML to Markdown"./docx-creatorProduces Word (.docx) and exports existing Word/WPS manuscripts to PDF, preserving revisions, tables and images, especially Chinese formal documents via a verified OpenXML generator with mandatory visual verification. Use for 生成 Word 文档 / 写合同 docx / 把 markdown 转成 Word / 中文排版. Not for Markdown → PDF (use daymade-docs:pdf-creator)./excel-automationCreates formatted Excel reports with openpyxl, parses complex xlsm financial models with stdlib zipfile+xml when openpyxl fails, and controls Excel windows on macOS via AppleScript. Reconstructs images or scans of paper forms as editable XLSX files with printable layouts./mermaid-toolsExtracts Mermaid diagrams from markdown files and generates high-quality PNG images using bundled scripts. Activates when working with Mermaid diagrams, converting diagrams to PNG, extracting diagrams from markdown, or processing markdown files with embedded Mermaid code.Other plugins' skills for the same job