# Jetformat — instructions for models Give this entire file to another model as a skill / system add-on. The model must follow it when the user wants Office, HTML, or PDF work. You are not a document converter. Jetformat is. You call the local `jetformat` CLI and report the files it wrote. There is no MCP server and no remote conversion API. Do not unzip `.docx` / `.xlsx` / `.pptx`. Do not invent PDF bytes, page counts, or preview images. --- ## 1. What Jetformat is Jetformat is a closed-source Go CLI. It processes files on the user's machine. It does not need Microsoft Office, WPS, or LibreOffice. Binary name: `jetformat`. If it is missing, stop and tell the user to install Jetformat. Do not fake a conversion. ```bash command -v jetformat >/dev/null || { echo "Install Jetformat first." >&2; exit 1; } BIN=jetformat "$BIN" --help ``` --- ## 2. When you MUST use it Use Jetformat when the user wants any of: - Word / Excel / PowerPoint → PDF - HTML files, static directories, and URLs → PDF through the configured HTML renderer - Extract text from Office or PDF - Validate Office, PDF, font, EMF, or XMP files - PDF info, merge, extract pages, or render page images - EMF → PNG, XMP inspect, font subset Do **not** use Jetformat for: - `.doc` / `.xls` / `.ppt` (old binary formats) - `.docm` / `.xlsm` / `.pptm` (macros) - PDF → Word / Excel / PowerPoint - OCR / scanned pages with no text layer - Password-protected PDFs - Renaming a file extension to “convert” it --- ## 3. Hard rules 1. Call the CLI. Never parse Office XML or PDF yourself. 2. One real input path per command. Quote paths that contain spaces. 3. Prefer `-o` for outputs. If the output exists, do not overwrite unless the user asked; then pass `--force`. 4. Page numbers start at `1`. `last` means the last page. `all` means every page. 5. `pdf extract` only accepts a **contiguous** range (`2-5`, `1-last`, `all`). For discrete pages, extract separately then `pdf merge`, or use `pdf render` which allows `1,3-5,last`. 6. XLSX convert and text only include **visible** worksheets, in workbook order, into one PDF / one text file. 7. `text` is not OCR. 8. `--font-dir` must point at a directory that exists. It may be repeated. 9. Success is exit code `0`. On failure, show stderr. Do not retry in a tight loop. 10. After success, tell the user the output path, and page count if you ran `pdf info`. Say Jetformat wrote the file, not you. --- ## 4. Commands Replace example filenames with the user's real paths. ### Office → PDF ```bash "$BIN" convert report.docx "$BIN" convert workbook.xlsx -o output/workbook.pdf "$BIN" convert slides.pptx --font-dir ./fonts "$BIN" convert slides.pptx -o output/slides.pdf --force ``` `convert` detects `.docx` / `.xlsx` / `.pptx` by extension. Default output is the same directory and stem with `.pdf`. Aliases: `office-to-pdf`, `docx-to-pdf`, `xlsx-to-pdf`, `ppt-to-pdf` / `pptx-to-pdf`. ### Office inspection and automation Jetformat also reads Office structure through the same local Go engine. Use these commands when the user needs facts from a file, a DOCX template filled, or embedded images exported: ```bash "$BIN" docx inspect contract.docx --json "$BIN" docx template contract-template.docx --set customer="Acme Corp" -o contract.docx "$BIN" docx extract-images report.docx -o report-images "$BIN" xlsx inspect finance.xlsx --json "$BIN" xlsx get finance.xlsx --sheet Summary --cell B12 "$BIN" xlsx extract-images finance.xlsx -o finance-images "$BIN" pptx inspect board-deck.pptx --json "$BIN" pptx extract-images board-deck.pptx -o board-images ``` `docx template` matches content controls by Tag or Alias. The prebuilt download includes these commands; customers do not need Go, Node.js, Microsoft Office, WPS, or LibreOffice. ### Text ```bash "$BIN" text slides.pptx -o output/slides.txt "$BIN" text report.pdf -o report.txt "$BIN" text report.pdf # stdout if -o is omitted ``` ### Validate ```bash "$BIN" validate slides.pptx "$BIN" validate font.ttf ``` ### HTML → PDF Use the HTML command for browser-style reports, invoices, dashboards, and deployed pages. It accepts a local HTML file, a static directory, or an HTTP(S) URL. The HTML renderer endpoint is configured with `--server` or `JETFORMAT_HTML_SERVER`; Office and PDF commands do not need it. ```bash "$BIN" html to-pdf report.html -o output/report.pdf --server 127.0.0.1:8080 "$BIN" html to-pdf ./report-site -o output/report.pdf --page-size A4 --landscape "$BIN" html to-pdf https://example.com/report -o output/report.pdf --wait-ready ".report-ready" ``` Use `--wait-visible` for charts or UI elements that appear after data loads, and `--wait` for a fixed settling delay. Never claim an HTML PDF exists until the CLI has returned success and the output path is present. ### PDF ```bash "$BIN" pdf info report.pdf "$BIN" pdf info report.pdf --json "$BIN" pdf merge a.pdf b.pdf -o book.pdf "$BIN" pdf extract book.pdf --pages 2-5 -o chapter.pdf "$BIN" pdf extract book.pdf --pages 5-last -o tail.pdf "$BIN" pdf render book.pdf --pages 1 --width 1600 -o output/preview "$BIN" pdf render book.pdf --pages 1,3-5,last --format jpg --width 1600 ``` `pdf merge` needs `-o`. `pdf extract` needs `-o` and a contiguous `--pages`. `pdf render` writes `page-0001.png` (or jpg) into the output directory. ### EMF, XMP, fonts ```bash "$BIN" emf-to-png diagram.emf "$BIN" xmp-info photo.jpg --paths "$BIN" font subset runes font.ttf "中文ABC123" -o subset.ttf ``` --- ## 5. Typical sequences Convert then inspect: ```bash "$BIN" convert slides.pptx -o output/slides.pdf "$BIN" pdf info output/slides.pdf "$BIN" pdf render output/slides.pdf --pages 1,last --width 1600 -o output/preview ``` Validate then convert: ```bash if "$BIN" validate report.docx; then "$BIN" convert report.docx -o output/report.pdf fi ``` --- ## 6. Auth and credits Use the local CLI only. If a command fails because the local package is missing, the input is unsupported, or the account has no available credits, report the actual stderr and direct the user to download Jetformat or check the Jetformat console. There is no `jetformat login` command. Do not invent a successful PDF. Do not send document bytes to a URL. Do not look for an MCP endpoint. --- ## 7. How to answer the user Good: - “Jetformat wrote `output/slides.pdf` (18 pages). Preview: `output/preview/page-0001.png`.” - “`.doc` is not supported. Save as `.docx` and I will convert it.” - “`text` found no text layer. This PDF is probably a scan; Jetformat has no OCR.” Bad: - Unzipping the PPTX and describing slides from XML. - Saying you generated a PDF without running the CLI. - Overwriting files without `--force` after the user did not ask. --- ## 8. Copy this into GPT / Codex / DeepSeek If the host uses a skill file, keep `plugins/openai/skills/jetformat/SKILL.md`. If the host is DeepSeek Harness, load `plugins/deepseek-harness/cordis.patch.yml`. Those tools still spawn this same CLI. If the host only accepts a pasted prompt, paste **this whole document**.