Turn gathered conversation content (findings, data, tables) into a clean PDF
via Typst. Two templates ship with this skill — pick one, fill it in, compile.
Trigger on any of:
If the user says "export" or "deliverable" without specifying format and the
context has tabular data or distinct findings, ask once whether they want PDF
before invoking.
Before writing any Typst, confirm or infer:
conversation belong in the document. Do not invent data the user did not
provide.
./report-YYYY-MM-DD.pdf in cwd. If a file with that name exists, append -2, -3, etc.
| Template | Use when |
|---|---|
| ---------- | ---------- |
templates/summary.typ | 1–3 sections, executive summary, ≤ ~3 pages. Default. |
templates/report.typ | 3+ distinct sections, title page + TOC desired, or user said "report". |
Both live next to this SKILL.md. Read the chosen one, then write a new
.typ file at (next to the target PDF) with placeholders
replaced and example tables swapped for real data.
#table() with table.header(...). Right-alignnumeric columns. Preserve the precision the user gave you — do not round.
table.header(repeat: true, ...) repeats headers on pagebreaks automatically (Typst 0.12+).
[...] content blocks; escape #, $, @, \ if they appear literally.
setup, font sizing, and heading shows from the template — those define the
look.
similar. The user does not want it.
typst compile <output>.typ <output>.pdf
typst is at /home/linuxbrew/.linuxbrew/bin/typst (linuxbrew). If it's not
on PATH in the current shell, use the full path.
If compile fails:
.typ source and retry once..typ source so they can edit directly.Do not loop indefinitely on errors.
On success, tell the user:
pdftotext -l 1 or just typst query — or simply state"compiled successfully" if neither is convenient),
.typ source is kept alongside for future tweaks.Offer to open it (xdg-open ) but do not open without confirmation.
// Two-column table with numeric right-align
#table(
columns: (auto, auto),
align: (left, right),
stroke: 0.5pt + gray,
inset: 7pt,
table.header([*Name*], [*Count*]),
[alpha], [42],
[beta], [108],
)
// Bullet list
- one
- two
- three
// Inline emphasis
This is *bold* and this is _italic_ and this is `mono`.
// Math (inline and block)
The energy is $E = m c^2$.
$ integral_0^infinity e^(-x^2) dif x = sqrt(pi) / 2 $
// Image
#figure(image("plot.png", width: 80%), caption: [A plot.])
共 1 个版本