ocring-pdfs

使用 ocrmypdf 为扫描版 PDF 添加可搜索文本层。运行时安装工具链,耗时约 18 秒。适用于 PDF 页面为图像且需保留文件、进行 grep 或传递给其他工具的场景,支持通过 tesseract 语言包处理非英文扫描件。不适用于图表、图示、手写内容或幻灯片布局,应转至 transcribing-images 处理。

仓库最近推送
GitHub Stars
420
Forks
19
Issues / PRs
20

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "ocring-pdfs":https://skillpi.com/zh/skills/deepskill-99e7fe56c184600ba2b75294b2d6b4823952452f512d10aedd1d538aafb1d994。安装前核对上游来源和版本:https://github.com/oaustegard/claude-skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

使用 ocrmypdf 为扫描版 PDF 添加可搜索文本层。运行时安装工具链,耗时约 18 秒。适用于 PDF 页面为图像且需保留文件、进行 grep 或传递给其他工具的场景,支持通过 tesseract 语言包处理非英文扫描件。不适用于图表、图示、手写内容或幻灯片布局,应转至 transcribing-images 处理。

0 下载

介绍来源: third_party · oaustegard · 0.1.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
适合谁
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: ocring-pdfs
description: "Adds a searchable text layer to a scanned PDF with ocrmypdf. Installs the toolchain at runtime in ~18s. Use when a PDF's pages are images and the deliverable is a file to keep, grep, or hand to another tool: 'make this PDF searchable', 'OCR this scan', 'I can't select the text in this PDF', 'search across these scanned pages', 'the pdf skill returned nothing'. Handles non-English scans via tesseract language packs. NOT for charts, diagrams, handwriting, or slide layouts. Route those to transcribing-images."
metadata:
  version: 0.1.0

OCRing PDFs

ocrmypdf writes an invisible text layer over the original page images, so the output file is both the scan you can look at and a document pdftotext, grep, and pdfplumber can read. Rasterize-then-tesseract gives you a .txt divorced from the pages; page numbers and coordinates are gone.

The toolchain is not in the base container. It installs in 18 seconds (measured 2026-09-12: apt 3s, pip 15s), so install it when a scan shows up rather than carrying it in a container layer.

Probe before installing

pdftotext in.pdf - | tr -d '\f \n' | wc -c

Nonzero means the PDF already has a text layer and is not a scan. Extract with pdftotext or pdfplumber and stop. Running OCR on it wastes a minute, and with --force-ocr it replaces exact embedded text with a lossy reading of a raster of itself.

A small nonzero count (tens of characters across many pages) is the mixed case: a born-digital cover page in front of scanned body pages, or a scan whose producer stamped a header. --skip-text handles it.

Install

sh scripts/ensure_ocr.sh              # English
sh scripts/ensure_ocr.sh nor deu      # plus Norwegian and German

Idempotent: 0.8s when everything is already present, 2.6s to add one more language pack. Installs ghostscript, pngquant, poppler-utils, tesseract and its language packs via apt, then ocrmypdf via pip.

Run

ocrmypdf --skip-text --deskew --rotate-pages --output-type pdf in.pdf out.pdf
pdftotext out.pdf - | wc -w        # verify: zero words means it failed quietly

About 2s per page for a single dense page at 200 DPI on one core. A 300-page scan is therefore a background job, not a single bash call — launch it detached with a sentinel file per the external-call pattern in bash-tool-timeout.

Which text-layer mode

flag use it when
--skip-text Default. Pages that already carry text are passed through untouched; image-only pages get OCR. The safe choice for anything mixed.
--force-ocr Every page is rasterized and re-OCRed, discarding any existing text. Correct for a scan carrying a junk text layer, and for pages with text-over-image that --skip-text would skip. Destroys real embedded text, so probe first.
--redo-ocr Replaces a previous OCR layer while leaving born-digital text alone. Narrower than --force-ocr and slower to fail on odd inputs.

--output-type pdf skips PDF/A conversion. Drop it when the output is going into an archive that requires PDF/A; ghostscript does the conversion either way.

Languages

-l eng+nor for a mixed-language document, -l nor for a monolingual one. Order does not matter. Every code needs its tesseract-ocr-<code> pack installed. Pass the codes to ensure_ocr.sh and it handles them. Accuracy drops noticeably when the language is wrong, and tesseract will not tell you; it returns confident garbage instead.

Container facts (measured 2026-09-12)

  • apt-get update exits 100 here. A preconfigured nodesource repo is off the egress allowlist and returns 403, and the nonzero exit aborts any && chain behind it. The Ubuntu mirrors are reachable without an update. Run apt-get install directly.
  • unpaper is absent, so --clean and --clean-final fail. Don't pass them.
  • One core, so --jobs buys nothing on claude.ai. CCotw has four.
  • ocrmypdf --version prints to stderr. Capture with 2>&1 or a version check reads as empty.
  • jbig2 is absent; output uses CCITT/JPEG instead, which costs some file size and nothing else.

When to use transcribing-images instead

This skill produces glyphs. It does not read a chart, describe a diagram, or recover handwriting. Tesseract on those pages returns nothing useful and gives no sign that it lost anything.

Route to transcribing-images when the meaningful content is a picture, or when the deliverable is a reading rather than a file. Both is a normal answer: OCR the document so it is greppable, then send the pages that carry figures to a vision model.

In an interactive session, native vision beats both for a handful of pages: rasterize with pdftoppm -r 200 -png and view the images. Reach for OCR when the document is longer than context will hold, or when the text has to outlive the conversation as a file.

版本历史

  1. declauding-v0.16.0 GitHub ↗
    原版更新说明

    # declauding declauding is a skill that rewrites prose that reads as model-written into the plain technical prose that a person would have written. Before handing the text back, it checks the rewrite against the draft for any number, name, quotation, hedge or ranking that the edit dropped or added. Install it like any skill in [oaustegard/claude-skills](https://github.com/oaustegard/claude-skills), by copying this directory into the agent's skills folder. The agent then runs it on a draft of prose that someone else will read, and when asked to "declaude", "de-slop" or "humanize" a text. It returns the rewritten text, or, if you ask for the annotated version, an HTML file that marks each edit with the original and the reason for it. ## The register "Register" means the style a piece of prose is written in. [`references/register.md`](references/register.md) catalogues 56 tics that mark prose as model-written. Each entry gives the tell (the surface pattern to look for), why it marks model prose, the fix, and a before-and-after from real text. They fall into five families: | Entries | Family | Example | |---|---|---| | 1–23, 37–42 | **Staging:** the sentence is built so the reader feels a finding arrive instead of being told it | *It is not a wrong answer. It is a non-answer.* | | 24–36 | **Encyclopedic and chatbot:** stock phrasing with nothing staged: inflated verbs, participle tails, forced triads, chatbot sign-offs | *Gallery 825 serves as the exhibition space and boasts 3,000 square feet.* | | 43–47 | **Flat certainty:** an adverb or absolute negative stands in for evidence | *The retry is provably safe.* | | 48–52 | **Confiding essayist:** staging aimed at the reader's trust | *Let's be honest: I won't pretend the first run was clean.* | | 53–56 | **Compressed syntax:** a claim packed into fewer words than a reader can parse | *the others check behaviour the old code never reached* | The staging entries that come up most often: | # | Tic | Example | |---|---|---| | 2 | Negation-first reveal | *It is not a wrong answer. It is a non-answer.* | | 3 | Significance designation | *It is the leg that answers the actual question.* | | 4 | Abstraction agency | *Median hides it.* / *The table shows it.* | | 5 | Deferred noun | *Five of those six rows are one cluster. The sixth is not.* | | 7 | Coy or thesis-shaped header | *What "exhausted" means* / *The one gap that does clear the bar* | | 11 | Straw-man knockdown | *"It thinks twice as long" is the obvious reading, and it is wrong.* | | 12 | Aphoristic closer | *It is the kind of number that looks like evidence and is not.* | | 15 | Fragment cadence | *Six legs. One GPU, one server build, one sampler, one question set.* | | 37 | Dressed metaphor | *That is information loss wearing the costume of a style fix.* | ## Workflow [`SKILL.md`](SKILL.md) has the full procedure. In short: 1. Read the whole draft first, and note where it contradicts itself. 2. State the draft's point in one sentence. If it has none, get one from the author and rebuild around it. 3. Run the linter, then the structural review in a subagent or fresh session that did not write the draft. 4. Ask of each sentence whether it states a finding or stages one, then check headers, paragraph breaks and closers. 5. If the draft describes something that just changed, hand it to a subagent that has not seen the old version, and fix whatever it trips over. 6. Run the preservation diff, and report contradictions to the author instead of fixing them. ## Scripts Run these from the skill's directory. ```sh python3 scripts/declaude_lint.py DRAFT.md --skip-quoted # tells, line by line python3 scripts/declaude_review.py DRAFT.md # headers, openers, closers python3 scripts/declaude_rank.py DRAFT.md --top 15 # most staged sentences first python3 scripts/declaude_diff.py SOURCE.md REWRITE.md # what the edit lost or added python3 scripts/fresh_eyes.py packet README.md # prompt for a newcomer read ``` The linter reads Markdown, plain text and HTML, and needs only the standard library and Python 3.9 or later. It exits 1 when it finds candidates, so it can run as a pre-commit hook. Each hit still needs a reader's judgment, and no regex reaches a staged paragraph or closer, so a clean report does not mean the draft is clean. `--skip-quoted` ignores blockquotes, table rows, code and italic spans, where a document like this one quotes bad prose as examples. The structural review sends only the headers, the opening and closing sentences and any isolated one-line paragraphs to a model: Gemini with `GEMINI_API_KEY`, Claude with `ANTHROPIC_API_KEY`, and with neither it prints the prompt for an agent to answer. The ranker needs torch and transformers. The diff counts constructions rather than words: rewriting "the format that most invites staged reveals" as "more than most formats do" keeps the word *most* and loses the ranking. When adding a lint rule, check that it reports zero on `tests/sample-clean.md`, which is human-written prose. [`references/corpus.md`](references/corpus.md) and [`references/preservation.md`](references/preservation.md) have the measurements behind the diff, the ranker, and the linter's `corpus-register` line, which measures how much of a draft uses the vocabulary of the flat-certainty family. Above about 1.0 per 100 words, read entries 43 to 47. A high score locates the register and does not mean a model wrote the draft. ## Overcorrection Prose stripped of confidence, rhythm and opinion is worse than the tics. The skill keeps certainty that has evidence behind it, first-person judgment, varied sentence length, digression and the author's own habits. It does not compress what remains: a rewrite that is shorter and harder to parse fails entries 53 to 56. A flagged shape sometimes carries a claim, and [`references/exceptions.md`](references/exceptions.md) lists when each one is earned. The rewrite never adds a name, number, date, quote or citation that the source or the author did not supply. When the author provides a sample of their writing, the sample overrides the rules. ## Model profiles [`references/models/`](references/models/) says what drafts from Opus 4.6 to 5.5, Sonnet 4.6 and 5, Haiku 4.5 and Fable 5.1 tend to carry, and how each model goes wrong when it runs the pass itself. ## Sources Entries 1 to 23 come from a register pass on a published benchmark post, and 37 to 42 from passes on drafts and a reference page in this repository. Other families draw on [blader/humanizer](https://github.com/blader/humanizer) and the Wikipedia AI Cleanup project's [Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) (24–36), Louis Abraham's [load-bearing](https://github.com/louisabraham/load-bearing) clusters of pull request descriptions (43–47), Simon Willison's [llm-cliche-highlighter](https://github.com/simonw/tools/blob/main/llm-cliche-highlighter.html) (48–52), and Clark, Martin and Mahowald, [arXiv 2610.29162](https://arxiv.org/abs/2610.29162) (53–56). [`CHANGELOG.md`](CHANGELOG.md) has the history of each addition. Related skills: [challenging](../challenging) runs an adversarial review of a draft's voice and returns findings rather than text; [crafting-instructions](../crafting-instructions) covers prompts, which have a different target register. **Skill folder:** [declauding](https://github.com/oaustegard/claude-skills/tree/main/declauding) --- Release of **declauding** version 0.16.0 ## 📥 Download & Install **[⬇️ Download declauding.zip](https://github.com/oaustegard/claude-skills/releases/download/declauding-v0.16.0/declauding.zip)** To install: 1. Click the download link above (ignore the "Source code" archives below - they're auto-generated by GitHub) 2. Go to [Claude.ai Customize › Skills](https://claude.ai/customize/skills) 3. Upload the downloaded ZIP file 4. Requires paid Claude Pro or Team account See [official documentation](https://support.claude.com/en/articles/12512198-how-to-create-custom-skills) for more details. ## Recent Changes ``` ddc0856 declauding 0.16.0: flag announcing the expected default and abandoned approaches as changelog 8cfff30 docs: Update CHANGELOG.md for released skills ```

  2. transcribing-images-v0.3.1 GitHub ↗
    原版更新说明

    No README found for this skill. **Skill folder:** [transcribing-images](https://github.com/oaustegard/claude-skills/tree/main/transcribing-images) --- Release of **transcribing-images** version 0.3.1 ## 📥 Download & Install **[⬇️ Download transcribing-images.zip](https://github.com/oaustegard/claude-skills/releases/download/transcribing-images-v0.3.1/transcribing-images.zip)** To install: 1. Click the download link above (ignore the "Source code" archives below - they're auto-generated by GitHub) 2. Go to [Claude.ai Customize › Skills](https://claude.ai/customize/skills) 3. Upload the downloaded ZIP file 4. Requires paid Claude Pro or Team account See [official documentation](https://support.claude.com/en/articles/12512198-how-to-create-custom-skills) for more details. ## Recent Changes ``` 2ffc844 transcribing-images 0.3.1: describe the test set, clarify the gemini-3.5-flash name and when to escalate 8cfff30 docs: Update CHANGELOG.md for released skills ```

  3. orchestrating-chat-agents-v1.1.1 GitHub ↗
    原版更新说明

    # orchestrating-chat-agents Orchestrates parallel API instances, delegated sub-tasks, and multi-agent workflows with streaming and tool-enabled delegation patterns. Routes by surface — native subagents in Cowork and Claude Code, httpx fan-out on claude.ai — and covers Gemini delegation via the Cloudflare AI Gateway on every surface. Use for parallel analysis, multi-perspective reviews, or complex task decomposition. In Claude Code, where native subagents exist, which mechanism to launch them with is `dispatching-subagents`; its README maps the neighbouring skills. **Skill folder:** [orchestrating-chat-agents](https://github.com/oaustegard/claude-skills/tree/main/orchestrating-chat-agents) --- Release of **orchestrating-chat-agents** version 1.1.1 ## 📥 Download & Install **[⬇️ Download orchestrating-chat-agents.zip](https://github.com/oaustegard/claude-skills/releases/download/orchestrating-chat-agents-v1.1.1/orchestrating-chat-agents.zip)** To install: 1. Click the download link above (ignore the "Source code" archives below - they're auto-generated by GitHub) 2. Go to [Claude.ai Customize › Skills](https://claude.ai/customize/skills) 3. Upload the downloaded ZIP file 4. Requires paid Claude Pro or Team account See [official documentation](https://support.claude.com/en/articles/12512198-how-to-create-custom-skills) for more details. ## Recent Changes ``` eb1e387 orchestrating-chat-agents 1.1.1: say what minimal and xhigh do on each Gemini model 8cfff30 docs: Update CHANGELOG.md for released skills ```

  4. drawing-video-v1.1.1 GitHub ↗
    原版更新说明

    No README found for this skill. **Skill folder:** [drawing-video](https://github.com/oaustegard/claude-skills/tree/main/drawing-video) --- Release of **drawing-video** version 1.1.1 ## 📥 Download & Install **[⬇️ Download drawing-video.zip](https://github.com/oaustegard/claude-skills/releases/download/drawing-video-v1.1.1/drawing-video.zip)** To install: 1. Click the download link above (ignore the "Source code" archives below - they're auto-generated by GitHub) 2. Go to [Claude.ai Customize › Skills](https://claude.ai/customize/skills) 3. Upload the downloaded ZIP file 4. Requires paid Claude Pro or Team account See [official documentation](https://support.claude.com/en/articles/12512198-how-to-create-custom-skills) for more details. ## Recent Changes ``` 67f47c0 drawing-video 1.1.1: explain why _cf_request needs thinkingLevel low, attribute the 22s clip to the model that ran it 8cfff30 docs: Update CHANGELOG.md for released skills ```

  5. browsing-bluesky-v0.8.1 GitHub ↗
    原版更新说明

    # browsing-bluesky Comprehensive Bluesky browsing via public APIs and real-time firehose. ## Features - **Search posts** - Advanced search with filters (query syntax matching bsky.app) - **User monitoring** - Fetch profiles and recent posts - **Feed/list reading** - Read from custom feeds and curated lists - **Firehose sampling** - Real-time trending topic detection ## Network Requirements This skill requires the following URLs to be whitelisted in your environment: ### API Access - `https://api.bsky.app` - Bluesky public API (search, profiles, feeds) - Used by: `search_posts()`, `get_user_posts()`, `get_profile()`, `get_feed_posts()` ### Firehose Access - `wss://jetstream1.us-east.bsky.network` - Bluesky Jetstream firehose WebSocket - Used by: `sample_firehose()` ### Important Notes - **Do NOT use** `public.api.bsky.app` - This subdomain returns 403 errors from some environments - **Always use** `api.bsky.app` instead - No authentication required for public read operations ## Dependencies ### Python - `requests` - For HTTP API calls ### Node.js (for firehose sampling only) - `ws` - WebSocket client - `https-proxy-agent` - Proxy support Install Node.js dependencies once per session: ```bash cd /home/claude && npm install ws https-proxy-agent ``` ## Installation Add the skill directory to your Python path: ```python import sys sys.path.insert(0, '/path/to/browsing-bluesky') from browsing_bluesky import search_posts, get_user_posts, get_profile, get_feed_posts, sample_firehose ``` ## Usage Examples ### Search Posts ```python # Basic search posts = search_posts("event sourcing", limit=10) # With filters posts = search_posts("MCP", author="austegard.com", since="2025-01-01", limit=20) # Query syntax (like bsky.app advanced search) posts = search_posts('from:acairns.co.uk "event sourcing" lang:en') ``` ### Monitor a User ```python # Get profile profile = get_profile("austegard.com") print(f"{profile['display_name']}: {profile['followers']} followers") # Get recent posts posts = get_user_posts("austegard.com", limit=20) ``` ### Read Feeds and Lists ```python # From URL posts = get_feed_posts("https://bsky.app/profile/austegard.com/lists/3lankcdrlip2f") # From AT-URI posts = get_feed_posts("at://did:plc:xxx/app.bsky.graph.list/xyz") ``` ### Sample Trending Topics ```python # Sample for 30 seconds data = sample_firehose(duration=30) print(f"Top words: {data['topWords'][:10]}") print(f"Trending phrases: {data['topPhrases'][:5]}") print(f"Entities: {data['entities'][:5]}") # Filter for specific term data = sample_firehose(duration=20, filter="python") print(f"Found {data['stats']['totalPosts']} posts about 'python'") ``` ## Return Data Format All API functions return structured dictionaries: **Post objects:** ```python { "uri": "at://...", "text": "Post content", "created_at": "2025-01-01T00:00:00.000Z", "author_handle": "user.bsky.social", "author_name": "Display Name", "likes": 42, "reposts": 10, "replies": 5, "url": "https://bsky.app/profile/user.bsky.social/post/..." } ``` **Profile objects:** ```python { "handle": "user.bsky.social", "display_name": "Display Name", "description": "Bio text", "followers": 100, "following": 50, "posts": 200, "did": "did:plc:..." } ``` **Firehose sample data:** ```python { "window": {"startTime": "...", "endTime": "...", "durationSeconds": 30}, "stats": {"totalReceived": 1000, "totalPosts": 500, "postsPerSecond": 16.7}, "topWords": [["word", count], ...], "topPhrases": [["phrase", count], ...], "entities": [["Named Entity", count], ...], "samplePosts": [{"text": "...", "altTexts": [...], "hasImages": true}, ...] } ``` ## Troubleshooting ### 403 Errors from API - Ensure you're using `api.bsky.app` not `public.api.bsky.app` - Verify `api.bsky.app` is whitelisted in your environment ### Firehose Sampling Fails - Check Node.js dependencies are installed: `npm list ws https-proxy-agent` - Verify `jetstream1.us-east.bsky.network` WebSocket access is allowed - If behind a proxy, ensure `https_proxy` environment variable is set ### Module Import Errors - Directory name has hyphens (`browsing-bluesky`) but module uses underscores (`browsing_bluesky`) - Use `importlib.util.spec_from_file_location()` if standard import fails ## Related Skills This skill consolidates and replaces: - `sampling-bluesky-zeitgeist` (deprecated) - Firehose sampling now built-in ## Version 0.5.0 **Skill folder:** [browsing-bluesky](https://github.com/oaustegard/claude-skills/tree/main/browsing-bluesky) --- Release of **browsing-bluesky** version 0.8.1 ## 📥 Download & Install **[⬇️ Download browsing-bluesky.zip](https://github.com/oaustegard/claude-skills/releases/download/browsing-bluesky-v0.8.1/browsing-bluesky.zip)** To install: 1. Click the download link above (ignore the "Source code" archives below - they're auto-generated by GitHub) 2. Go to [Claude.ai Customize › Skills](https://claude.ai/customize/skills) 3. Upload the downloaded ZIP file 4. Requires paid Claude Pro or Team account See [official documentation](https://support.claude.com/en/articles/12512198-how-to-create-custom-skills) for more details. ## Recent Changes ``` afce24d browsing-bluesky 0.8.1: split transcription empirics by test set, define token recall, say what gemini-3.5-flash runs 8cfff30 docs: Update CHANGELOG.md for released skills ```

此处仅展示最近 5 个版本。 在原站查看完整版本历史 ↗

当前收录版本

0.1.0

核对来源版本 ↗

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值85/100

亮点

  • 解决扫描版 PDF 添加可搜索文本层的实际需求,适用于文档处理、信息检索等高频场景
  • 支持多语言 OCR,通过 tesseract 语言包处理非英文扫描件
触发精准90/100

亮点

  • 触发词覆盖多种变体,边界清晰,用户表达方式匹配度高
结构规范95/100

亮点

  • 文档结构清晰,包含完整步骤、出口条件和端到端示例
  • frontmatter 完整,单文件长度合理
执行可靠90/100

亮点

  • 工具来源明确,参数正确,覆盖主要异常情况
  • 对已含文本层的 PDF 提供探测机制,避免无效 OCR
证据可验 (前四项均值)90/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 80 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。