Communitygithub.com

baronguyen001/ai-automation-skills

OCRバイナリを使わずにPDFからテキストと単純な表形式の行を抽出し、ダウンストリームのAIに渡します。ユーザーがPDFの読み取り、テキスト化、明細書/レポートからの表抽出、LLMパイプラインへのPDF内容の供給を求めた場合に使用します。

ai-automation-skills とは?

このスキルは、デジタルPDFから機械可読なテキストを抽出し、要約、分類、構造化抽出など後続のAIワークフローに渡すために設計されています。`pypdf` や `pdfminer.six` などの純Pythonライブラリを使用するため、OCRバイナリは不要で、スキャンされていないテキスト選択可能なPDFであればすぐに動作します。シンプルな行ベースのテーブル検出機能も備えており、タブや連続するスペースを行区切りとして検出するため、厳密なレイアウト再現が必要でなければ実用的な表抽出が可能です。このスキルは Claude Code、Cursor、Codex などのAIエージェントで使用でき、`assets/extract.py` をプロジェクトにコピーするだけで簡単に統合できます。ページ境界を保持し、テキストが見つからない場合は明確にエラーを返すため、LLMに空のプロンプトを送信することを防ぎます。

対応~Claude Code~Codex CLI~Cursor✓Gemini CLI
npx skills add https://github.com/baronguyen001/ai-automation-skills/tree/HEAD/skills/pdf-text-extract

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

PDFテキスト抽出

このスキルは、デジタルPDFから機械可読なテキストを抽出し、要約、分類、構造化抽出などの後続処理に使用します。ヘルパーは純PythonのPDFライブラリを利用可能な場合に使用し、ダウンストリームでのクリーンアップのためのシンプルな行ベースのテーブル検出機能も含まれています。

呼び出すべきタイミング

  • ユーザーが「このPDFからテキストを抽出して」「PDFをAIに渡して」「このレポートから表を抽出して」「この明細書を読んで」と発言した場合。
  • PDFがすでに選択可能なテキストを含んでおり、OCRを必要としない場合。

呼び出すべきでないタイミング

  • PDFがスキャン画像である場合(OCRワークフローを使用してください)。
  • ユーザーがセルの結合やレイアウトの忠実性を伴うピクセル完全なテーブル再構築を必要とする場合。

具体的な例

ユーザー入力:

このPDFからテキストとおおまかな表を抽出して、Geminiに要約させて。

出力:

# assets/extract.py をプロジェクトにコピーしてから使用します:
from extract import extract_pdf

doc = extract_pdf("downloads/report.pdf")
print(doc["text"][:2000])
for table in doc["tables"]:
    print(table["page"], table["rows"][:3])

対象プロジェクトに pypdf または pdfminer.six をインストールします。OCRバイナリは不要で、抽出可能なテキストがないPDFの場合は明確にエラーを返します。

適用するパターン

  1. 最初にデジタルテキスト抽出を試み、スキャン画像でない限りOCRは追加しない。
  2. ダウンストリームのプロンプトがページ番号を引用できるように、ページ境界を保持する。
  3. テーブル抽出はシンプルに保つ:行をタブまたは連続スペースで分割し、後続のスキーマパスで列を正規化する。
  4. PDFが長い場合、LLMに送信するテキストをページ/範囲ごとに制限する。
  5. テキストが見つからない場合は、空のプロンプトをダウンストリームに送信する代わりに、明確にエラーを返す。

参考:assets/extract.py

ソース

著者の自動化プロジェクトにおける本番運用からの知見をまとめたもの。v1.0.0。 関連項目:[[gemini-structured-output]]、[[csv-report-writer]]、[[s3-uploader]]

→ Trawlkit で完全な実行可能ボットを構築しましょう。

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

baronguyen001/ai-automation-skills

Schedule any script to run on a recurring schedule on Windows (Task Scheduler) or Linux (cron) - register, list, and remove jobs from one command, with logging to a file and a guard against overlapping runs. Use for schedule a script, run nightly, set up a cron job, windows task scheduler, or run on a timer.

baronguyen001/ai-automation-skills

Turn a run's list of result dicts into a schema'd CSV and a Markdown table from one column spec - declare columns once, emit both, with stable ordering and safe escaping, stdlib only, no pandas. Use when the user asks to write results to CSV, export a report, make a markdown summary table, or save a run's output as a spreadsheet.

baronguyen001/ai-automation-skills

Strip HTML to clean plain text with the standard library only (no BeautifulSoup/lxml): drops script/style, turns block tags into line breaks, and collapses whitespace. Use when the user wants readable text from an HTML page/email, to clean scraped HTML before sending it to an LLM, or to build a text index from web content.

baronguyen001/ai-automation-skills

Persist records between scheduled runs as append-only JSON Lines (one object per line) with streaming reads and optional key-based dedup, stdlib only. Use when the user wants to log run results to JSONL, append events to a file, dedup records by id across runs, or keep a simple durable history without a database.

baronguyen001/ai-automation-skills

Rotate a pool of HTTP/SOCKS proxies with round-robin selection, failure tracking, and a cooldown that benches dead proxies before retrying. BYO proxy list via env - none are shipped. Use for rotate proxies, spread requests across proxies, avoid IP bans, retry through a different proxy, or proxy health check.

baronguyen001/ai-automation-skills

Parse an RSS 2.0 or Atom feed into normalized item dicts (title, link, id, published, summary) with the standard library only - no feedparser. Use when the user asks to read an RSS/Atom feed, poll a blog/news feed, extract feed entries, or watch a site that publishes a feed.

baronguyen001/ai-automation-skills

Upload and download run artifacts from S3-compatible storage with BYO bucket and credentials from env. Use when the user asks to store scraper output, archive reports, publish artifacts to object storage, fetch a prior run file, or use MinIO/R2/Spaces/S3 without hardcoding credentials.

baronguyen001/ai-automation-skills

Draft a short-form TikTok/Reels/Shorts or long-form video script from a topic and creator persona file - hook variants, beat-structured body, CTA, b-roll cues, caption overlays, and [STORY]/[NUMBER] slots so the model never fabricates personal facts. Use for write a video script, tiktok script, youtube script, or /shortform-script.

baronguyen001/ai-automation-skills

Give scheduled scripts memory between runs with one SQLite file - a seen-set for dedup, a key/value cursor to resume where you left off, and order-preserving new-item filtering. Use for dedup across runs, don't re-alert the same item, remember the last id, resume a scraper, or persist state between cron runs.

関連スキル