apcamargo/typst-skills/typst-author
Claude Code and agent skill by apcamargo/typst-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate 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, template work, or package usage.
Install
npx vskill@latest install apcamargo/typst-skills/typst-authorSKILL.md
typst-author skill
Overview
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).
Minimal document example
Workflows
- 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), then create the
.typfile(s). - After each
.typedit, follow the post-edit formatting checks below whentypstyleis available. - Editing existing content:
- Locate the target text and apply changes; confirm syntax against the reference when needed (docs/reference/index.md).
- After each modified
.typfile, follow the post-edit formatting checks below. - Formatting & styling:
- Consult the styling guide (docs/reference/language/styling.md) for
set rule,show rule, selectors, and transformations. - Preserve visual consistency: new layouts, figures, tables, and drawings must reuse the document's existing fonts, colors, and typographic hierarchy (unless instructed otherwise). Internal consistency should be maintained (same function → same size and color).
Documentation
- Orientation:
docs/overview.mdfor a high-level introduction,docs/reference/index.mdfor the reference structure, anddocs/tutorial/index.mdfor the tutorial sequence. - Tutorial:
docs/tutorial/1-writing.mdfor basic markup, functions, labels, citations, and math;docs/tutorial/2-formatting.mdfor set rules, page setup, headings, and text formatting;docs/tutorial/3-advanced.mdfor templates, show rules, and more complex styling;docs/tutorial/4-template.mdfor reusable templates and packages. - Language syntax:
docs/reference/language/syntax.mdfor markup/math/code modes, comments, escapes, and identifiers. - Language scripting:
docs/reference/language/scripting.mdfor expressions, code/content blocks, bindings, conditionals, loops, fields, methods, modules, packages, and operators. - Language styling:
docs/reference/language/styling.mdfor set rules, show rules, selectors, and transformations. - Language context:
docs/reference/language/context.mdfor style context, location context, nested contexts, and compiler iterations. - Foundations:
docs/reference/library/foundations.mdfor basic types/functions,std,sys.version, andsys.inputs. - Document model:
docs/reference/library/model.mdfor headings, figures, bibliography, citations, references, numbering, outlines, lists, tables, and document structure. - Layout:
docs/reference/library/layout.mdfor arranging elements on the page: page, block, box, grid, columns, alignment, spacing, transforms, and measurement. - Text:
docs/reference/library/text.mdfor text styling and thetextfunction. - Math:
docs/reference/library/math.mdfor math syntax, symbols, equations, alignment, fonts, accessibility, and math functions. - Drawing and media:
docs/reference/library/visualize.mdfor shapes, image/graphics primitives, color, gradients, strokes, and visual accessibility. - Introspection:
docs/reference/library/introspection.mdfor counters, state, locations,query, and document-aware generated content. - Data loading:
docs/reference/library/data-loading.mdfor loading and encoding external data such as CSV, JSON, TOML, YAML, XML, CBOR, and raw files. - Symbols and emoji:
docs/reference/library/sym.mdfor named symbols and shorthands;docs/reference/library/emoji.mdfor emoji. - Export formats:
docs/reference/export/pdf.mdfor PDF standards and PDF-specific features;docs/reference/export/html.mdfor HTML export and typed HTML;docs/reference/export/bundle.mdfor multi-output bundles and assets;docs/reference/export/svg.mdanddocs/reference/export/png.mdfor image exports. - Guides:
docs/guides/page-setup.mdfor pages, margins, headers, footers, numbering, and columns;docs/guides/tables.mdfor semantic tables and table styling;docs/guides/accessibility.mdfor semantic structure, alt text, language, PDF accessibility, and export considerations;docs/guides/for-latex-users.mdfor LaTeX-to-Typst translation.
Detailed instructions
- PRIORITY: Trust local documentation. Your internal training data regarding Typst may be outdated or hallucinated. Always verify function names, parameters, and syntax against the local Typst 0.15.0
docs/folder before generating code. - Read the relevant documentation using local file search and open tools on the paths above.
- Use local docs for syntax and reference questions. Verify syntax, function names, parameters, and reference behavior from the bundled docs. Run a minimal Typst probe only when runtime or evaluation behavior remains unclear after checking the docs.
- Generate or modify the `.typ` source according to the user's request.
- Run the post-edit formatting checks below for every
.typfile you created or edited in that pass. - Validate with
typst compileafter the formatting decision is complete when you created or edited.typfiles, or when the user explicitly asks for verification (if tool access is allowed). - Summarize touched files and outcomes. Provide full
.typcontent only when the user requests it or when direct editing is not possible, and optionally include a rendered preview (PDF/HTML).
Probing uncertain behavior
- Use a probe when the bundled docs do not settle runtime or evaluation behavior.
- Model the case with Typst scripting as described in docs/reference/language/scripting.md.
- When a probe is necessary, prefer a fileless expression probe with
typst evalinstead of creating scratch.typfiles. See docs/reference/library/foundations.md for system values and docs/reference/library/introspection.md for contextual document queries. - Example:
typst eval '1 + 2'
Post-edit formatting checks
- Check whether `typstyle` is available with
command -v typstyle. If it is unavailable, skip the remaining formatting checks. - After each `.typ` file modification, run `typstyle --check <file>` for the file you just created or edited.
- If `typstyle --check` fails, inspect the formatter changes with `typstyle --diff <file>` before deciding what to do.
- Apply formatting with `typstyle -i <file>` only when the formatter changes are limited to a newly created file or to code you created or edited in the current task.
- Stop and ask the user when formatting would change untouched pre-existing code. If the diff reaches outside your own edits, or if you cannot confidently prove that every formatter change is limited to your edits, ask instead of formatting.
Quick syntax reference
Critical distinctions
- Arrays:
(item1, item2)(parentheses). See docs/reference/library/foundations.md. - Dictionaries:
(key: value, key2: value2)(parentheses with colons). See docs/reference/library/foundations.md. - Content blocks:
[markup content](square brackets). See docs/reference/language/scripting.md. - NO tuples: Typst only has arrays.
Hash usage (markup vs code)
- Use
#to start a code expression inside markup or content blocks; it disambiguates code from text. This is required for content-producing function calls and field access in markup:#figure[...],#image("file.png"),text(...)[#numbering(...)]. - Do not use
#inside code contexts (argument lists, code blocks, show-rule bodies). Example:#figure(image("file.png"))(no#beforeimage). - Reference: docs/reference/language/scripting.md, docs/tutorial/1-writing.md
Styling rules: set vs show
set: Set rule to configure optional parameters on element functions (style defaults scoped to the current block or file).show: Show rule to target selected elements and apply a set rule or transform/replace the element output.- Use
setfor common styling; useshowfor selective or structural changes (e.g.,heading.where(level: 1), labels, text, regex).
Common mistakes to avoid
- Calling things "tuples" (Typst only has arrays).
- Using
[]for arrays (use()instead). - Accessing array elements with
arr[0](usearr.at(0)). - Omitting
#in markup/content blocks (e.g.,text(...)[numbering(...)]should betext(...)[#numbering(...)]). - Using
#inside code contexts (e.g.,figure(#image("x.png"))in an argument list). - Mixing up content blocks
[]with code blocks{}. - Forgetting to include the namespace when accessing imported variables/functions (e.g., use
color.hslinstead of justhsl). - Using LaTeX syntax (do NOT use
\begin{...},\section, or other LaTeX commands). - Hallucinating environments (e.g.,
tabulardoes not exist; usetable).
Advanced features
- Reusable styling: See docs/reference/language/styling.md for set rules, show rules, and styling scoped by code or content blocks.
- Scripting: Use Typst's scripting capabilities (docs/reference/language/scripting.md) for automatic generation.
- Math and visualisation: Reference docs/reference/library/math.md and docs/reference/library/visualize.md for formulas and diagrams.
For large projects
When working on large projects, consider organizing the project across multiple files.
- Use
#include "file.typ"to split into multiple files - Relevant documentation: docs/reference/language/scripting.md
Troubleshooting
Missing font warnings
If you see "unknown font family" warnings, remove the font specification to use system defaults. Note: Font warnings don't prevent compilation; the document will use fallback fonts.
Template/Package not found
If import fails with "package not found":
- Verify exact package name and version on Typst Universe.
- Check for typos in
@preview/package:versionsyntax. See docs/reference/language/scripting.md for package import syntax and docs/guides/for-latex-users.md for Typst Universe examples.
Compilation errors
Common fixes:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtypst-author/SKILL.md
Popularity
- Repository stars
- 99
- Repository forks
- 8
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 29 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/apcamargo/typst-skills/typst-author)