본문으로 건너뛰기
cccskills
무료GitHub에 공개

pdf-ingestion

Get a PDF into the model without blowing the context window or losing structure. Native PDF beats OCR-then-text for most cases; extract-then-summarize beats native for very long docs.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md3.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

PDF Ingestion

Three ways to feed a PDF to the model, in increasing order of preprocessing:

  1. Native PDF input — pass the file directly. Model sees pages as images + extracted text. Best for docs under ~100 pages with meaningful layout (tables, figures, forms). Preserves structure.

  2. Text extraction then send — pdftotext / pypdf / equivalent, then send the text. Loses layout but cheap. Fine for prose-heavy docs where tables don't matter.

  3. Extract → chunk → summarize → send — for docs >100 pages or when you'll query the same doc many times. Preprocess once, cache the summary.

Deciding which path

Doc shapePath
<20 pages, layout matters (report, form, invoice)Native
<20 pages, pure prose (article, memo)Text extraction
20-100 pages, mixedNative, but chunk if context tight
>100 pagesExtract → chunk → summarize
Scanned PDF (no text layer)OCR first (Tesseract or vision model), then treat as extracted text
Tables are the pointNative — text extractors mangle tables
Figures/diagrams are the pointNative + explicit "describe the figure on page N" prompt

Native PDF — the good defaults

  • Cache the PDF at a prompt-caching breakpoint (see prompt-caching). Native PDFs are large — every uncached turn costs full input price on the whole doc.
  • Ask about specific pages ("summarize section 3.2 on page 14") rather than the whole doc. The model handles targeted queries better than "summarize this 80-page report".
  • Follow up with page-cited claims — "on which page does the doc say X?" — as a sanity check the model isn't hallucinating.

Extract-then-send — the traps

  • pdftotext reading order. Multi-column PDFs come out as interleaved lines. Use pdftotext -layout for column preservation, or pdftotext -raw for straight reading order — pick per doc, don't guess.
  • Tables become word soup. If tables are load-bearing, native or per-table image extraction. Not text.
  • Headers/footers repeat on every page. Strip them before sending, or the model will treat them as content.
  • Footnotes drift to random positions in the extracted stream. Filter or accept the noise.

Extract → chunk → summarize (long docs)

  • Chunk by section, not by token count. A section-aware split respects the doc's logic; a naive 4K-token split cuts sentences and tables.
  • Summarize per section into a "map" — 1-2 paragraphs each. Keep the map short enough to fit in context whole (~2-4K tokens for a 200-page doc).
  • Store the full section text alongside the map (paths in a manifest). Fetch on demand when a question needs detail beyond the summary.
  • Cache the map at a prompt-caching breakpoint so multi-turn Q&A over the doc doesn't reprocess.

Red flags

  • Sending a 200-page PDF native to answer one question. Extract the relevant page range first.
  • Trusting the text extractor on a form or invoice. Layout carries meaning. Use native.
  • OCR'ing a PDF that already has a text layer. Check pdftotext -q file.pdf - first — if text comes out, no OCR needed.
  • No page citations in output. Model can hallucinate confidently across long PDFs. Force page numbers into the response format.
  • Re-uploading the same PDF every turn without caching. Cost climbs linearly; a 5-minute cache fixes it.

Loopkit-adjacent

If the PDF is a spec, extract it into PROMPT.md via spec-first — the agent should re-read prose, not re-scan the PDF, on every turn.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

a11y-pass

무료

Catch the accessibility failures that ship in almost every AI-built UI. Use after building any interactive component.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Before compaction Loopkit extracts decisions into claude-decisions.json (machine-readable). Read it alongside claude-progress.txt at session start — prose is for humans, JSON is for the loop.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Review a diff against the goal spec assuming the code is BROKEN. The reviewer that lives in the maker's head always agrees with itself — this pulls review into a hostile, separate pass. Invoke after every code change before marking work done.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Verify that an endpoint checks ownership, not just authentication. Use on any handler that reads or mutates user data.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Find the exact commit that introduced a bug. Use when something worked before and broke, and you don't know which change did it.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Before picking new work, smoke-test the last "completed" feature. If it's broken, revert and re-open it before touching anything else. Kills the "looks shipped, isn't shipped" bug across sessions.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Archive228/loopkit7552026년 7월 15일 업데이트

Archive228의 스킬 모두 보기

이 스킬의 문제 신고