Source profileQuality 92/100Review permissions

rojim666/SztuCode/src/sztu_code/core/skills/builtin/pdf/SKILL.md

pdf

Read, create, inspect, render, and verify PDF files where visual layout matters, including fillable AcroForms. Use Poppler rendering plus Python tools such as reportlab, pdfplumber, and pypdf for generation and extraction.

Source repository stars
14
Declared platforms
0
Static risk flags
1
Last source update
2026-08-06
Source checked
2026-08-06

Decision brief

What it does—and where it fits

Read, create, inspect, render, and verify PDF files where visual layout matters, including fillable AcroForms. Use Poppler rendering plus Python tools such as reportlab, pdfplumber, and pypdf for generation and extraction.

Best for

  • Read or review PDF content where layout and visuals matter.
  • Create PDFs programmatically with reliable formatting.
  • Fill and validate interactive PDF forms.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/rojim666/SztuCode --skill "src/sztu_code/core/skills/builtin/pdf"
Safe inspection promptEditorial

Inspect the Agent Skill "pdf" from https://github.com/rojim666/SztuCode/blob/8c2138893772282f06da838dddc89373009b4189/src/sztu_code/core/skills/builtin/pdf/SKILL.md at commit 8c2138893772282f06da838dddc89373009b4189. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Workflow

    1. Prefer visual review: render PDF pages to PNGs and inspect them. - Use pdftoppm from the bundled runtime or system Poppler when available. - If unavailable, install Poppler or ask the user to review the output locally. 2. Use reportlab to generate PDFs when creating new docum…

    Prefer visual review: render PDF pages to PNGs and inspect them.Use pdftoppm from the bundled runtime or system Poppler when available.If unavailable, install Poppler or ask the user to review the output locally.
  2. 02

    When To Use

    Read or review PDF content where layout and visuals matter.

    Read or review PDF content where layout and visuals matter.Create PDFs programmatically with reliable formatting.Fill and validate interactive PDF forms.
  3. 03

    Fill And Validate AcroForms

    Visual review alone is not a correctness check for a fillable PDF. A page /Widget annotation can render a value from its appearance stream while the canonical /AcroForm/Fields tree is missing or contains a stale value.

    Keep the result interactive by default; set flatten=True only when the user explicitly requests a completed, static form. Preserve the source PDF, and do not flatten a signed PDF without an explicit workflow decision.Inspect both representations before filling: enumerate fields from reader.getfields() and /Widget annotations from every page's /Annots, following /Parent and /Kids. If a widget and a canonical field have the same name…Recover genuinely orphaned widgets, fill all pages, and write the result with pypdf:
  4. 04

    Restores widgets that are missing from /AcroForm/Fields.

    writer.reattachfields() fields = writer.getfields() or {} missing = set(expectedvalues) - set(fields) if missing: raise ValueError(f"Form fields not found after repair: {sorted(missing)}")

    writer.reattachfields() fields = writer.getfields() or {} missing = set(expectedvalues) - set(fields) if missing: raise ValueError(f"Form fields not found after repair: {sorted(missing)}")valuestowrite = dict(expectedvalues) if flatten: Paint every existing value before removing every widget. valuestowrite = { name: field.get("/V", "/Off" if field.get("/FT") == "/Btn" else "") for name, field in fields.i…writer.updatepageformfieldvalues( None, valuestowrite, autoregenerate=False, flatten=flatten )
  5. 05

    Temp And Output Conventions

    Use tmp/pdfs/ for intermediate files; delete them when done.

    Use tmp/pdfs/ for intermediate files; delete them when done.Write final artifacts under output/pdf/ when working in this repo.Keep filenames stable and descriptive.

Permission review

Static risk signals and limitations

Runs scripts

medium · line 92

The documentation asks the agent to run terminal commands or scripts.

python3 -m pip install reportlab pdfplumber pypdf

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score92/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars14SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
rojim666/SztuCode
Skill path
src/sztu_code/core/skills/builtin/pdf/SKILL.md
Commit
8c2138893772282f06da838dddc89373009b4189
License
MIT
Collected
2026-08-06
Default branch
main
View the original SKILL.md

PDF Skill

When To Use

  • Read or review PDF content where layout and visuals matter.
  • Create PDFs programmatically with reliable formatting.
  • Fill and validate interactive PDF forms.
  • Validate final rendering before delivery.

Workflow

  1. Prefer visual review: render PDF pages to PNGs and inspect them.
    • Use pdftoppm from the bundled runtime or system Poppler when available.
    • If unavailable, install Poppler or ask the user to review the output locally.
  2. Use reportlab to generate PDFs when creating new documents.
  3. Use pdfplumber or pypdf for text extraction and quick checks; do not rely on text extraction for layout fidelity.
  4. After each meaningful update, re-render pages and verify alignment, spacing, and legibility.

Fill And Validate AcroForms

Visual review alone is not a correctness check for a fillable PDF. A page /Widget annotation can render a value from its appearance stream while the canonical /AcroForm/Fields tree is missing or contains a stale value.

  1. Keep the result interactive by default; set flatten=True only when the user explicitly requests a completed, static form. Preserve the source PDF, and do not flatten a signed PDF without an explicit workflow decision.
  2. Inspect both representations before filling: enumerate fields from reader.get_fields() and /Widget annotations from every page's /Annots, following /Parent and /Kids. If a widget and a canonical field have the same name but are distinct objects with no /Parent relationship, do not call reattach_fields() blindly: it can create a second top-level field with the same name. Report the ambiguity or produce a static result.
  3. Recover genuinely orphaned widgets, fill all pages, and write the result with pypdf:
from pypdf import PdfReader, PdfWriter
from pypdf.generic import NameObject

reader = PdfReader(input_pdf)
writer = PdfWriter()
writer.clone_document_from_reader(reader)

# Restores widgets that are missing from /AcroForm/Fields.
writer.reattach_fields()
fields = writer.get_fields() or {}
missing = set(expected_values) - set(fields)
if missing:
    raise ValueError(f"Form fields not found after repair: {sorted(missing)}")

values_to_write = dict(expected_values)
if flatten:
    # Paint every existing value before removing every widget.
    values_to_write = {
        name: field.get("/V", "/Off" if field.get("/FT") == "/Btn" else "")
        for name, field in fields.items()
    }
    values_to_write.update(expected_values)

writer.update_page_form_field_values(
    None, values_to_write, auto_regenerate=False, flatten=flatten
)

if flatten:
    # pypdf's flatten=True paints appearances but does not remove widgets.
    writer.remove_annotations(subtypes="/Widget")
    writer.root_object.pop(NameObject("/AcroForm"), None)

with open(output_pdf, "wb") as stream:
    writer.write(stream)
  1. Reopen the written PDF before delivery. For an interactive result, require every expected field to be present in get_fields() with the expected /V, enumerate page widgets again, and confirm their effective /V (the widget value or inherited /Parent value) agrees. Confirm each updated widget has a non-empty /AP /N appearance and render the final pages to catch stale or clipped appearances. Do not rely on /NeedAppearances or a successful PNG render as proof that logical field data was updated.
  2. For a flattened result, require zero /Widget annotations and no remaining /AcroForm field tree after reopening, then render the final pages. Keep an editable copy when the user may need to revise the form.

Temp And Output Conventions

  • Use tmp/pdfs/ for intermediate files; delete them when done.
  • Write final artifacts under output/pdf/ when working in this repo.
  • Keep filenames stable and descriptive.

Dependencies

Prefer the Codex bundled workspace/runtime dependencies when available. The primary runtime is expected to include:

  • Python packages: reportlab, pdfplumber, pypdf
  • Rendering tools: pdftoppm and pdfinfo from Poppler

If a dependency is missing, install only what is needed.

Python packages:

uv pip install reportlab pdfplumber pypdf

If uv is unavailable:

python3 -m pip install reportlab pdfplumber pypdf

System tools for rendering:

# macOS (Homebrew)
brew install poppler

# Ubuntu/Debian
sudo apt-get install -y poppler-utils

If installation is not possible in this environment, tell the user which dependency is missing and how to install it locally.

Environment

No required environment variables.

Rendering Command

pdftoppm -png "$INPUT_PDF" "$OUTPUT_PREFIX"

Quality Expectations

  • Maintain polished visual design: consistent typography, spacing, margins, and section hierarchy.
  • Avoid rendering issues: clipped text, overlapping elements, broken tables, black squares, or unreadable glyphs.
  • Charts, tables, and images must be sharp, aligned, and clearly labeled.
  • Use ASCII hyphens only. Avoid U+2011 and other Unicode dashes.
  • Citations and references must be human-readable; never leave tool tokens or placeholder strings.

Final Checks

  • Do not deliver until the latest PNG inspection shows zero visual or formatting defects.
  • Confirm headers, footers, page numbering, and section transitions look polished.
  • Keep intermediate files organized or remove them after final approval.

Final response citations

Place :codex-file-citation{...} inline in prose, not in a trailing list. Use purpose="source" for Q&A/no-op and purpose="output" for create/edit.

  • [HARD REQUIREMENT] Create/edit: cite each final PDF exactly once with a plain output citation. Summarize representative changes; do not cite every page or add a separate filename, path, or Markdown link. Example: Created :codex-file-citation{path="/abs/path/report.pdf" purpose="output"}, with the completed analysis and appendix.
  • Q&A/no-op: do not edit or re-export. Inspect the complete relevant pages, preserve material headings, table/figure labels, footnotes, sources, and sample sizes, and cite each source PDF once with a plain source citation.

PDF citations currently support only plain file citations. Do not add artifact_kind, page_number, or other locators. Never cite rendered PNGs, scratch files, builders, or QA intermediates unless asked.

Alternatives

Compare before choosing