用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/oomol-lab/oomol-hermes-agent --skill pdf-files命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | pdf-files |
| description | Create, inspect, fill, verify, and sign PDF files. |
Use this skill when the user asks to create, inspect, fill, verify, or digitally sign PDF files.
This includes Chinese requests such as 生成 PDF, 创建 PDF 表单, 填写 PDF,
生成静态已填写 PDF, PDF 数字签名, or 给 PDF 签名.
.docx, .xlsx, or .pptx to PDF, use
the bundled office-files skill and LibreOffice soffice --headless.office-files skill.ocr-and-documents skill before attempting structured PDF editing.Use the image-provided Python environment:
/opt/hermes/.venv/bin/python
The image already installs:
reportlab for creating PDF pages and AcroForm fields.pypdf for reading, filling, and inspecting PDF forms.PyMuPDF (fitz) for rendering pages and checking visible text.pdftoppm / pdfinfo for independent render and metadata checks.qpdf for PDF structure checks.pyHanko / pyhanko-cli for digital signatures.tzdata for pyHanko behavior in slim images.Reusable helper scripts are bundled under this skill. Prefer them over writing
one-off scripts for common form inspection, static filling, delivery
verification, and test signing. See references/pdf-form-tools.md.
scripts/create_labeled_acroform.py. Let the helper own two-column geometry,
multiline note spacing, CJK labels, and safe margins.Table. Require
sum(col_widths) <= available_width; ReportLab does not shrink an oversized
table automatically. If the columns do not fit, shorten or wrap cell content,
reduce column widths/font size, split the table, or use a landscape page.For business PDFs, create the file programmatically with reportlab. For CJK
content, register an embedded TrueType-outline TTF/TTC font before drawing Chinese
text. The bundled helpers discover the image's embedded CJK font (or accept an
explicit --font-path) and reject unembedded CID fonts such as STSong-Light:
import os
import sys
bundled_root = os.environ.get(
"HERMES_BUNDLED_SKILLS", "/opt/oomol-hermes-agent/curated-skills"
)
sys.path.insert(0, f"{bundled_root}/productivity/pdf-files/scripts")
from pdf_fonts import register_embedded_cjk_font # noqa: E402
from reportlab.pdfgen import canvas as canvas_module
font_name = register_embedded_cjk_font()
pdf = canvas_module.Canvas(output_path)
pdf.setFont(font_name, 11)
Every text object must use a CJK-capable font. Setting the canvas font is not enough for Platypus paragraphs, tables, headers, or footers:
from reportlab.lib.styles import ParagraphStyle
from reportlab.platypus import TableStyle
body_style = ParagraphStyle("BodyCJK", fontName=font_name, fontSize=10, leading=14)
table.setStyle(TableStyle([
("FONTNAME", (0, 0), (-1, -1), font_name),
]))
Write generated files under the user's requested output path, not under
/opt/hermes.
For fillable PDF forms:
scripts/create_labeled_acroform.py with a JSON spec before writing custom
coordinate code. The helper handles CJK labels, one- or two-column text
fields, multiline note fields, and safe label/field spacing.supplier_contact,
first_shipment_date, or purchase_owner.scripts/inspect_pdf_widgets.py to verify widget bounds, margins, size, and
overlap before delivering it.pypdf flatten=True as the default delivery guarantee, especially for CJK content.scripts/fill_acroform_static.py for CJK values before delivery, which
writes an embedded-font overlay and removes filled widgets./AcroForm, or regenerate a true
static filled PDF. Keep only fields that are still needed later, such as a
signature field.Typical field update approach:
from pypdf import PdfReader, PdfWriter
reader = PdfReader(input_path)
writer = PdfWriter()
writer.append(reader)
writer.update_page_form_field_values(
writer.pages[0],
{"supplier_contact": "value"},
auto_regenerate=True,
)
with open(output_path, "wb") as output:
writer.write(output)
If the user asks for broadly visible final content:
scripts/fill_acroform_static.py. If you must
implement the workflow manually, follow this deterministic static-fill path:
/Rect coordinates with pypdf.reportlab overlay page and draw every filled value at
the matching field rectangle using a CJK-capable font./AcroForm. Keep only fields that are still needed later, such
as a signature field.fitz visible text extraction, fitz rendering,
qpdf --check, and Poppler rendering when available.scripts/verify_pdf_delivery.py for final render, structure, visible
text, and duplicate-nearby-text checks.Use pyHanko for PDF signatures. When the user explicitly allows a test
signature, generate a short-lived test certificate at runtime and discard it
after use.
For test signatures, prefer scripts/sign_pdf_test_cert.py instead of writing a
new certificate/signing script.
Sign only after the filled PDF has passed visual/static verification. The signing step should preserve the already verified content and add the requested signature field; it should not refill the form or add another visible text overlay.
Do not ask for, invent, or store production certificate material. Real private keys, PINs, HSM/PKCS#11 configuration, timestamp service credentials, and company certificates must come from runtime secrets, external services, or the user.
After creating or modifying a PDF:
pypdf.PdfReader.pypdf and fitz when
possible, and check key IDs, dates, and representative Chinese business text.scripts/verify_pdf_delivery.py with representative --contains
markers. It checks every extracted text span for actual rendered ink and a
minimum foreground/background contrast, and rejects unembedded CID fonts.--allow-invisible-ocr-text to permit
its standard rendering-mode-3 searchable text layer. Do not use this option
for generated business PDFs or to bypass a failed visible-text check.fitz and check that the pixmap is not
blank.qpdf --check does not establish this.qpdf --check when available.pdftoppm when available if visual delivery matters; it must render every
page without font or syntax errors. PyMuPDF and Poppler are deliberately
independent renderer checks.reader.get_fields() and verify expected field names.reader.get_fields() and confirm at least one field
has /FT equal to /Sig./opt/hermes.Create, edit, convert, and inspect Microsoft Office files.
Research and analyze fresh public data from TikTok, Douyin, WeChat Channels, WeChat Official Accounts, WeChat Search, Weibo, YouTube, Reddit, Twitter, Zhihu, Kuaishou, and Xiaohongshu through an OO-authenticated managed proxy backed by TikHub. Use when the user asks to search, retrieve, compare, monitor, or analyze current public posts, videos, comments, users, creators, trends, products, topics, audiences, or cross-platform performance. This workflow does not use or require a connected TikHub app or user-supplied TikHub credentials. Do not use for style-only writing, generic advice, or analysis that can be completed from data the user already supplied.
基于 SOC 职业分类