用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill pdf命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | |
| description | Use this skill when a task requires reading, creating, splitting, merging, or otherwise manipulating PDF files. |
| metadata | {"author":"fastxyz"} |
Use Python packages installed in /work/.venv for PDF work. Common choices:
pypdf for reading, splitting, and writing pagespdfplumber for extracting text from PDFsreportlab for creating new PDFsAlways inspect the extracted text before writing parsing regexes. Do not guess labels or field formats from the task prompt.
Example text extraction:
from pypdf import PdfReader
reader = PdfReader("input.pdf")
text = "\n".join(page.extract_text() or "" for page in reader.pages)
print(text)
Example structured extraction after inspecting text:
from pypdf import PdfReader
import json
reader = PdfReader("statement.pdf")
text = "\n".join(page.extract_text() or "" for page in reader.pages)
lines = [line.strip() for line in text.splitlines() if line.strip()]
answer = {"riskFlags": []}
for line in lines:
if line.startswith("Account:"):
answer["account"] = line.split(":", 1)[1].strip()
elif line.startswith("Quarter:"):
answer["quarter"] = line.split(":", 1)[1].strip()
elif line.startswith("Total Revenue:"):
raw = line.split(":", 1)[1].strip().replace("$", "").replace(",", "")
answer["totalRevenue"] = float(raw)
elif line.startswith("Risk Flag:"):
answer["riskFlags"].append(line.split(":", 1)[1].strip())
elif line.startswith("Approval Code:"):
answer["approvalCode"] = line.split(":", 1)[1].strip()
with open("answer.json", "w") as output:
json.dump(answer, output, indent=2)
Example page filtering:
from pypdf import PdfReader, PdfWriter
reader = PdfReader("input.pdf")
writer = PdfWriter()
writer.add_page(reader.pages[0])
with open("output.pdf", "wb") as output:
writer.write(output)
Example page filtering by extracted page text:
from pypdf import PdfReader, PdfWriter
reader = PdfReader("customer-packet.pdf")
writer = PdfWriter()
for page in reader.pages:
text = page.extract_text() or ""
if "CUSTOMER COPY" in text and "INTERNAL NOTES" not in text:
writer.add_page(page)
with open("customer-copy.pdf", "wb") as output:
writer.write(output)
Source: fastxyz/skill-optimizer — distributed by TomeVault.