Create pdf

From theexperiencecompany/gaia · View interactive version

Create pdf is an AI agent skill from the GitHub repository theexperiencecompany/gaia. Generate a polished, printable PDF: reports, letters, invoices, resumes, one-pagers. Use when the user wants a PDF document. Typst is the primary engine; LaTeX (tectonic) is the fallback for niche packages or specific academic/journal templates." # When NOT to use: editing a Google Doc (use the goog

How to use this skill

Skill file

Create PDF

When to use

The deliverable is a PDF. For Word use create-docx, for slides create-pptx, for spreadsheets create-spreadsheet.

Engine decision

Skill directory: /workspace/integrations/docgen/agent/skills/create-pdf. The templates, reference.md, and scripts/ referenced below live here. Read them by absolute path (the read tool serves them instantly from memory); your own work goes in ./scratch/ (relative to the session).

Workflow (every job)

  1. Work in a job dir: mkdir -p ./scratch/pdf-<short-name> and do everything there. Never build in ./artifacts/.
  2. Adapt the closest template: do not start blank. read the best-fit file from templates/ (see the list below, e.g. report.typ, report-consulting.typ, resume.typ, resume-classic.typ, invoice.typ), then write the filled-in version to ./scratch/pdf-<name>/main.typ. Read /workspace/integrations/docgen/agent/skills/create-pdf/reference.md for syntax and the common-error → fix table.
  3. Put data in a file if there's a lot of it, and reference it from the source, rather than inlining giant blobs.
  4. Build + validate with the bundled script (absolute path):

```

bash /workspace/integrations/docgen/agent/skills/create-pdf/scripts/build.sh ./scratch/pdf-<name>/main.typ ./scratch/pdf-<name>/out.pdf

```

It compiles, validates the PDF (non-empty, real pages), and prints OK: <path> (pages=N) or a short ERROR: file:line: message.

  1. Fix loop: on ERROR, read the message, edit the source, re-run. Cap at 5 attempts. If Typst keeps failing on the same construct, switch to the LaTeX/tectonic path (write main.tex, run the same build.sh with the .tex file).
  2. Deliver: once you get OK, move the final PDF into artifacts:

```

mv ./scratch/pdf-<name>/out.pdf ./artifacts/<final-name>.pdf

```

Then report the full path (/workspace/sessions/<conv>/artifacts/<final-name>.pdf). Moving it into artifacts/ is what makes it show up for the user (web card, or sent as a file on WhatsApp/etc).

Toolchain note

The build script provisions Typst + tectonic on first use; the very first PDF may take a little longer while that happens, then it's fast.

Never

Templates

These are comprehensive, feature-rich starting points. Adapt one rather than authoring from scratch. They double as a feature reference, so read the closest fit even just to learn the syntax.

Typst (default engine, .typ):

LaTeX (tectonic fallback, .tex):

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.