feat: add PDF export and visual review skill

This commit is contained in:
bryanpedini committed 2026-11-27 15:20:32 +01:00
1 parent 06677b29e2
commit 99b2a6fe99
2 files changed
+42

No files matched your search

+24
View File
@@ -1 +1,25 @@
# pdf
An agent skill for exporting documents to PDF and checking the final page layout.
The skill exports from the editable source when available, renders every page, and has the agent open the page images at a readable scale. It compares the export with the requested formatting and any supplied reference. After a layout fix, it repeats the visual check on the new export.
## Usage
Invoke the skill as `$pdf` in T3 Code or ask your agent to use the `pdf` skill. For example, ask it to export a document and check that the PDF matches a reference, or to review an existing PDF for layout problems.
The workflow uses the authoring application's PDF exporter and an image-capable viewing tool. Poppler's `pdftoppm` is the suggested renderer. An equivalent renderer or PDF viewer that exposes the page images to the model also works.
## Installation
Clone this repository as `pdf` inside your agent's personal skills directory. For example, on a Codex setup that uses `~/.codex/skills`:
```sh
git clone https://git.bjphoster.com/skills/pdf.git ~/.codex/skills/pdf
```
If you use [skills-autoupdate](https://git.bjphoster.com/skills/.autoupdate), add `https://git.bjphoster.com/skills/pdf` to `~/.config/skills`.
## License
[MIT](LICENSE).
+18
View File
@@ -0,0 +1,18 @@
---
name: pdf
description: Export documents to PDF and visually verify the final page layout. Use when delivering an exported PDF or checking an existing PDF against formatting requirements or a supplied reference.
---
# PDF export and visual review
## Establish the expected layout
- Identify the requested page size, orientation, typography, margins, alignment, and pagination where specified. If a template or previous document is the reference, open its relevant pages visually and compare the corresponding elements in the export. Follow the current request where it differs from the reference.
## Export and inspect
1. When an editable source is part of the deliverable, save it in the requested format, reopen it to confirm it loads correctly, and export the PDF directly from that version using the authoring application's PDF exporter. Use the supplied PDF directly for a review-only request.
2. Render every page of the actual PDF to a fresh temporary directory. With Poppler, run `pdftoppm -png -r 150 "$INPUT_PDF" "$OUTPUT_PREFIX"`. Use an equivalent renderer or a PDF viewer that exposes the page images to the model when Poppler is unavailable.
3. Open every rendered page with an image-viewing tool that shows the image to the model. Inspect the pages at a readable scale and zoom or re-render details as needed. Use page counts and extracted text only as supplementary checks.
4. Compare the result with the requested formatting and reference. Check typography, margins, alignment, spacing, headers, footers, and page numbers where applicable. Look for clipped or overlapping content, substituted fonts or missing glyphs, broken tables or lists, isolated headings or lines, and unintended blank pages.
5. Fix layout defects in the editable source when available, re-export, and render and inspect all pages of the new PDF. Before handing it off as verified, confirm that the inspected file is the final deliverable and that it matches the source and the requested layout. If rendering or image inspection is blocked, state what you could verify and what remains unchecked.