pdf-official
できること
このスキルは、文字の抽出から新しいレポートの作成、フォームの穴埋めまで、さまざまな種類のPDFを扱います。契約書、フォーム、請求書、スキャンしたページを扱う人向けです。
使う場面
- ✓既存のPDFから、文字や表を取り出す必要があるとき。
- ✓PDFのページを結合、分割、回転、透かし加工したいとき。
- ✓PDFのフォームを埋めたり、スキャンを検索可能なコピーにしたりしたいとき。
スキルのリンク
https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/pdf-official/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このPDFの申込書のフォーム項目に、私の名前と住所を入力してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まずPDFを確認します。ページ数、暗号化、フォーム項目の有無などです。そして、作業を抽出、変換、作成、穴埋めのいずれかに振り分け、結果を確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
PDF skill
An Apache-2.0 toolkit for reading, composing, transforming, and filling PDF files. Written from scratch on top of permissively-licensed open-source libraries (pypdf, pdfplumber, pypdfium2, reportlab, pdf-lib, qpdf) so this can be embedded in commercial projects without special agreement.
Route the task
Pick the sub-guide by the verb of the request.
| Task | Path | Read |
|---|---|---|
| Pull text / tables / metadata / images out of an existing PDF | Extract | extract.md |
| Combine, carve, rotate, crop, watermark, encrypt, or shrink | Transform | transform.md |
| Build a PDF that doesn't exist yet (report, invoice, certificate) | Compose | compose.md |
| Fill a form (AcroForm or scanned) | Interactive | interactive.md |
| Scanned / image-only PDF (no selectable text) | Extract → OCR | extract.md §5 |
If a task mixes several of these, follow the order: probe → plan → extract or compose → validate.
Every path starts with a probe. scripts/survey.py returns page count,
whether the file is encrypted, whether it has an AcroForm, and whether
page 1 looks like a scan.
First install
Bundled runtime: when the
MIMO_PYTHONenvironment variable is set, skip the installs below — run every command withpython3/uv runreplaced by"$MIMO_PYTHON"(pypdf/pypdfium2/reportlab/Pillow preinstalled; pip console scripts unavailable, use"$MIMO_PYTHON" -m <module>). A bundled qpdf is exposed asMIMO_QPDF(picked up automatically by the scripts here); invoke it directly as"$MIMO_QPDF" --check file.pdf.
Python-only path (all BSD / MIT / Apache) — covers 95% of tasks:
python3 -m pip install --upgrade pypdf pdfplumber pypdfium2 reportlab Pillow
Add these external binaries only when you actually need them:
# qpdf — merge/split/encrypt/repair, Apache-2.0
brew install qpdf # macOS
apt-get install -y qpdf # Debian / Ubuntu
# Tesseract — OCR for scanned PDFs, Apache-2.0
brew install tesseract
python3 -m pip install pytesseract pdf2image
apt-get install -y tesseract-ocr
# Poppler — pdftotext / pdftoppm / pdfimages, GPL-2.0
# Optional. Only install if you accept a GPL dependency at CLI level.
brew install poppler
apt-get install -y poppler-utils
Every script under scripts/ uses argparse. Exit codes:
0 OK · 1 runtime failure · 2 bad arguments · 3 validation failure
(apply_values.py / overlay_text.py; sanity_check.py reports findings
with exit 1).
Any single script can be lifted into another project — none imports from a
shared framework.
One-command triage
scripts/survey.py path/to/file.pdf --pretty
Sample output:
{
"path": "/abs/path/file.pdf",
"page_count": 12,
"is_locked": false,
"form_field_count": 34,
"looks_scanned": false,
"metadata": {"Title": "...", "Author": "...", "Producer": "..."}
}
Route by the flags:
is_locked: true→ unlock first (qpdf --password=… --decrypt). Almost every reader library refuses locked files.form_field_count > 0→ widgets path ininteractive.md§1.form_field_count == 0AND you need to fill it → overlay path ininteractive.md§2.looks_scanned: true→ skip pypdf text extraction, go straight to OCR (extract.md§5).
Which library for which task
| Task | Preferred | Reason | Fallback |
|---|---|---|---|
| Plain text | pdftotext -layout |
fastest, keeps columns | pypdf |
| Positioned text | pdfplumber |
char-level bboxes | pypdfium2.get_text |
| Tables | pdfplumber |
tunable table_settings |
pandas over manual CSV |
| Page → image | pypdfium2 |
Apache/BSD, no GPL | pdftoppm (GPL) |
| Merge / carve / rotate | pypdf |
pure Python | qpdf --pages (faster on huge files) |
| Encrypt / repair / linearise | qpdf |
handles broken input | pypdf (basic encrypt only) |
| Compose from scratch | reportlab |
mature, BSD | pdf-lib in Node |
| Fill AcroForm | pypdf.update_page_form_field_values |
preserves widget appearances | pdf-lib in Node |
| Overlay on non-fillable | reportlab + pypdf.merge_page |
two-layer merge, see interactive.md | — |
Common gotchas
- PDF origin is bottom-left, image origin is top-left. Every "off by a few points" bug is one of these two systems misapplied. Coordinate conversion is in one place: [`
よくある質問
スキャンしたPDFも読めますか?
はい。スキャンにOCRをかけて、文字を検索できるようにできます。
暗号化されたPDFも扱えますか?
はい。PDFの暗号化と、暗号の解除を扱います。
特別なソフトウェアが必要ですか?
このスキルは、pypdfなどのPythonのライブラリを使い、コマンドを実行する前にセットアップの手順が必要です。
詳細
作者による元の説明
Use this skill whenever a PDF file is being produced, opened, transformed, filled, or read. That includes: extracting text or tables from an existing PDF; combining, carving, rotating, cropping, or watermarking pages; composing a fresh PDF (report, invoice, certificate); filling AcroForm fields or overlaying text onto a non-fillable scanned form; encrypting or unlocking a PDF; running OCR over a scanned document; rendering pages to PNG/JPEG for visual analysis. Trigger on mentions of 'PDF', a filename ending in .pdf, requests like 'turn this into a PDF report', or references to AcroForm / form
repo: XiaomiMiMo/MiMo-Code
人気
- GitHubのスター
- 14k
- ランキング
- #11335
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
effect
14kエージェントが、Effect TypeScriptフレームワークに関する質問に、記憶に頼らず、ソースコードとドキュメントを確認して答えられるよう支援します。
arxiv
14kエージェントが、arXivの学術論文を検索、閲覧、引用、追跡できるよう支援します。要約、BibTeXの引用、PDFのダウンロード、引用リンクを扱います。
claude-code
14kエージェントが、Claude Codeのコマンドラインツールにコーディング作業を任せられるよう支援します。一回だけの実行、対話セッション、バックグラウンドのジョブのいずれにも対応します。
codex
14kエージェントが、チャット画面なしでOpenAI Codexのコマンドラインツールを実行できるよう支援します。コーディングの作業、スクリプト、自動化されたパイプラインに使えます。
似ているスキル
feishu-doc
394kテキスト、画像、表を含むFeishuのクラウドドキュメントを、ドキュメントツールを使って読み、作成し、編集するようエージェントを支援します。
feishu-drive
394kボットと共有されたFeishuのクラウドフォルダ内のファイルを閲覧、整理、コメントできるようエージェントを支援します。
feishu-perm
394kFeishuのファイルにアクセスできる人を確認し、変更するようエージェントを支援します。依頼を満たす最小の権限を選びます。