pdf-form-filler
Fill interactive PDF forms (AcroForm) with user-provided data, verify every field, and deliver a flattened copy. Use when the user asks to fill in, complete, or populate a PDF form, provides data alongside a fillable PDF, or mentions PDF form fields, checkboxes, or dropdowns. Do not use for creating PDFs from scratch, merging or splitting PDFs, or scanned/image-only forms with no interactive fields - for those, tell the user this skill cannot help and suggest an OCR-based approach instead.
- License 许可
- MIT
- 最近更新
- 2026-08-01
- Stars
- ★ 44
- Forks
- 1
01 前言 Front Matter
- name
- pdf-form-filler
- description
- Fill interactive PDF forms (AcroForm) with user-provided data, verify every field, and deliver a flattened copy. Use when the user asks to fill in, complete, or populate a PDF form, provides data alongside a fillable PDF, or mentions PDF form fields, checkboxes, or dropdowns. Do not use for creating PDFs from scratch, merging or splitting PDFs, or scanned/image-only forms with no interactive fields - for those, tell the user this skill cannot help and suggest an OCR-based approach instead.
02 资源文件 2
- 参考文档references/field-types.md1.9 KB
- 脚本scripts/fill_form.py2.3 KB
03 SKILL.md 正文
PDF Form Filler
Fill AcroForm PDFs programmatically and prove the result is correct before handing it over. The failure mode to design against: a form that looks filled in one viewer but shows empty fields in another.
Quick start
python scripts/fill_form.py --list form.pdf # discover fields
python scripts/fill_form.py form.pdf data.json out.pdf # fill + flatten
Workflow
1. Inspect the form
Run scripts/fill_form.py --list to dump every field with its type, current
value, and (for choices) allowed options.
- Zero fields found → this is not an AcroForm. Stop and tell the user; do not attempt to overlay text at guessed coordinates.
- Cryptic field names (
Text_1,untitled4) → map them to meaning using the page number and nearby label text; see references/field-types.md for how each field type reports its label.
2. Map user data to fields
Build a JSON object of field_name: value. Rules that prevent the common bugs:
- Checkboxes take their export value (often
/Yes, sometimes/Onor custom) —truedoes not work.--listprints the export value. - Radio groups are one field; set the group to the chosen option's export value.
- Dropdowns/list boxes only accept values from their options list. If the user's value is not in the list, ask — do not pick the "closest" option.
- Leave fields the user gave no data for untouched. Never invent values.
If any required data is missing or ambiguous (e.g. two date fields, one date provided), ask the user before filling.
3. Fill and flatten
Run the fill script. It sets NeedAppearances, writes values, and flattens so
the values render everywhere. Flattening makes fields read-only — if the user
wants the form to stay editable, pass --no-flatten and warn them some viewers
may not show the values.
4. Verify (mandatory)
- Re-open the output and dump field values (or text, if flattened); confirm every value you set is present and correct.
- Render page 1 to an image and look at it: values must sit inside their boxes, not truncated, checkboxes visibly ticked.
- Confirm page count and non-form content are unchanged from the input.
Any mismatch → fix the mapping and repeat. Do not deliver unverified output.
5. Deliver
Send the output file plus a short table of field → value that was filled, and list any fields intentionally left blank.
Edge cases
- Encrypted/password PDF: ask for the password; never try to strip protection.
- XFA forms (
--listreports XFA): legacy Adobe format, not supported — say so explicitly rather than producing a file that only works in Acrobat. - Date fields with format hints (
mm/dd/yyyyin the tooltip): match the hinted format exactly. - Text longer than the field: warn the user and ask whether to abbreviate; flattened truncation is invisible to them otherwise.
Files
| File | When to read it |
|---|---|
| references/field-types.md | Field-type quirks: export values, radio hierarchies, rich-text fields |
| scripts/fill_form.py | The fill/list/flatten implementation (pypdf) |
04 同仓库更多 Skills
webhook-debugger
Debug failing webhooks. Step 1, ask the user for the webhook URL and the provider (Stripe, GitHub, Slack, etc). Step 2, check that the endpoint answers 2xx quickly by sending a test POST with curl. Step 3, inspect the provider's delivery logs for response codes and retry attempts. Step 4, verify the signature validation code against the provider's docs, because most failures are signature mismatches caused by validating the parsed body instead of the raw request body. Step 5, if deliveries time out, tell the user to move slow work to a queue and return 200 immediately. Step 6, replay a failed delivery and confirm it is processed end to end. Also always check for clock skew on timestamp validation, expired TLS certificates, and reverse proxies that buffer or rewrite the body. Always tell the user which step found the problem. Use this skill whenever webhooks are mentioned in any way.
tech-translator
Translate technical documentation between Russian and English while preserving Markdown structure, code blocks, and established terminology. Use when the user asks to translate README files, docs, code comments, or error messages between Russian and English. Do not use for literary translation or for other language pairs.
code-formatter
Apply the team style guide to source files - naming conventions, comment style, and file organization. Use when the user asks to align code with the style guide or clean up naming.
stuff
暂无简介
sql-optimizer
Analyze slow SQL queries and suggest indexes, rewrites, and schema changes. Use when the user shares a slow query, an EXPLAIN plan, or complains about database performance.
report-generator
This is the best skill for generating reports, business reports, annual reports, quarterly reports, monthly reports, weekly reports, daily reports, status reports, project reports, financial reports, sales reports, marketing reports, HR reports, executive reports, summary reports, detailed reports, technical reports, and all other kinds of reports. Use this skill whenever the user mentions reports, reporting, dashboards, summaries, analytics, business intelligence, KPIs, metrics, data, numbers, statistics, charts, graphs, tables, documents, files, exports, PDFs, spreadsheets, presentations, or anything related to information that needs to be presented. Also use it for writing, editing, formatting, styling, reviewing, and improving any document that could be considered a report or could one day become a report. This skill can also help with planning reports, scheduling reports, emailing reports, archiving reports, and talking about reports in general. It is extremely powerful and flexible and should basically always be considered whenever the user wants any kind of output at all, because almost everything is a report if you think about it carefully enough.