$npx -y skills add apcamargo/typst-skills --skill typst-authorGenerate idiomatic Typst (.typ) code, edit and troubleshoot Typst documents and projects, and answer Typst syntax/reference questions. Use when working with .typ files or when the user explicitly asks for Typst document creation, editing, debugging, compilation, formatting, templ
| 1 | # typst-author skill |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | This skill helps agents generate, edit, and reason about Typst documents. It provides quick‑start examples, detailed workflows, and links to the Typst documentation (overview, guides, tutorials, reference). |
| 6 | |
| 7 | ## Minimal document example |
| 8 | |
| 9 | ```typst |
| 10 | #set document(title: "My Document", author: "Author Name") |
| 11 | #set page(numbering: "1") |
| 12 | #set text(lang: "en") |
| 13 | |
| 14 | // Enable paragraph justification and character-level justification |
| 15 | #set par( |
| 16 | justify: true, |
| 17 | justification-limits: ( |
| 18 | tracking: (min: -0.012em, max: 0.012em), |
| 19 | spacing: (min: 75%, max: 120%), |
| 20 | ) |
| 21 | ) |
| 22 | |
| 23 | #title[My Document] |
| 24 | |
| 25 | = Heading 1 |
| 26 | |
| 27 | This is a paragraph in Typst. |
| 28 | |
| 29 | == Heading 2 |
| 30 | |
| 31 | #lorem(50) |
| 32 | ``` |
| 33 | |
| 34 | ## Workflows |
| 35 | |
| 36 | - **Creating a new Typst project**: Use the "Minimal document example" above as a starting point. Skim the tutorial for the basics ([docs/tutorial/1-writing.md](docs/tutorial/1-writing.md)), then create the `.typ` file(s). After each `.typ` edit, follow the post-edit formatting checks below when `typstyle` is available. |
| 37 | - **Editing existing content**: Locate the target text and apply changes; confirm syntax against the reference when needed ([docs/reference/index.md](docs/reference/index.md)). After each modified `.typ` file, follow the post-edit formatting checks below. |
| 38 | - **Formatting & Styling**: Consult the styling guide ([docs/reference/language/styling.md](docs/reference/language/styling.md)) for `set rule`, `show rule`, selectors, and transformations. |
| 39 | |
| 40 | ## Documentation |
| 41 | |
| 42 | - **Orientation**: `docs/overview.md` for a high-level introduction, `docs/reference/index.md` for the reference structure, and `docs/tutorial/index.md` for the tutorial sequence. |
| 43 | - **Tutorial**: `docs/tutorial/1-writing.md` for basic markup, functions, labels, citations, and math; `docs/tutorial/2-formatting.md` for set rules, page setup, headings, and text formatting; `docs/tutorial/3-advanced.md` for templates, show rules, and more complex styling; `docs/tutorial/4-template.md` for reusable templates and packages. |
| 44 | - **Language syntax**: `docs/reference/language/syntax.md` for markup/math/code modes, comments, escapes, and identifiers. |
| 45 | - **Language scripting**: `docs/reference/language/scripting.md` for expressions, code/content blocks, bindings, conditionals, loops, fields, methods, modules, packages, and operators. |
| 46 | - **Language styling**: `docs/reference/language/styling.md` for set rules, show rules, selectors, and transformations. |
| 47 | - **Language context**: `docs/reference/language/context.md` for style context, location context, nested contexts, and compiler iterations. |
| 48 | - **Foundations**: `docs/reference/library/foundations.md` for basic types/functions, `std`, `sys.version`, and `sys.inputs`. |
| 49 | - **Document model**: `docs/reference/library/model.md` for headings, figures, bibliography, citations, references, numbering, outlines, lists, tables, and document structure. |
| 50 | - **Layout**: `docs/reference/library/layout.md` for arranging elements on the page: page, block, box, grid, columns, alignment, spacing, transforms, and measurement. |
| 51 | - **Text**: `docs/reference/library/text.md` for text styling and the `text` function. |
| 52 | - **Math**: `docs/reference/library/math.md` for math syntax, symbols, equations, alignment, fonts, accessibility, and math functions. |
| 53 | - **Drawing and media**: `docs/reference/library/visualize.md` for shapes, image/graphics primitives, color, gradients, strokes, and visual accessibility. |
| 54 | - **Introspection**: `docs/reference/library/introspection.md` for counters, state, locations, `query`, and document-aware generated content. |
| 55 | - **Data loading**: `docs/reference/library/data-loading.md` for loading and encoding external data such as CSV, JSON, TOML, YAML, XML, CBOR, and raw files. |
| 56 | - **Symbols and emoji**: `docs/reference/library/sym.md` for named symbols and shorthands; `docs/reference/library/emoji.md` for emoji. |
| 57 | - **Export formats**: `docs/reference/export/pdf.md` for PDF standards and PDF-specific features; `docs/reference/export/html.md` for HTML export and typed HTML; `docs/reference/export/bundle.md` for multi-output bundles and assets; `docs/reference/export/svg.md` and `docs/reference/export/png.md` for image exports. |
| 58 | - **Guides**: `docs/guides/page-setup.md` for pages, margins, headers, footers, numbering, and columns; `docs/guides/tables.md` for semantic tables and table styling; `docs/guides/accessibility.md` for semantic structure, alt text, language, PDF accessibility, and export considerations; `docs/guides/for-latex-users.md` for LaTeX-to-Typst translation. |
| 59 | |
| 60 | ## Detailed instructions |
| 61 | |
| 62 | 1. **PRIORITY: Trust local documentation**. Your internal training data regarding Typst |