skills/typst/SKILL.md
Typst document creation and package development. Use when: (1) Working with .typ files, (2) User mentions typst, typst.toml, or typst-cli, (3) Creating or using Typst packages, (4) Developing document templates, (5) Converting Markdown/LaTeX to Typst
npx skillsauth add lucifer1004/claude-skill-typst typstInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
typst compile document.typ # compile once → PDF
typst compile document.typ output.pdf # explicit output path
typst compile document.typ -f png # export as PNG image
typst compile src/main.typ --root . # set project root for /path imports
typst watch document.typ # recompile on change
typst query document.typ "<label>" # extract metadata as JSON (see query.md)
For command options beyond this quick reference, see cli.md.
Agent verification — choose by what you need to check (see debug.md for details):
| Method | Command | Best for |
| ----------- | ----------------------------------------------------------------------- | ----------------------------------------- |
| HTML export | typst compile doc.typ /dev/stdout -f html --features html 2>/dev/null | Text content, structure, headings, tables |
| PNG export | typst compile doc.typ page-{p}.png -f png | Visual layout, alignment, spacing, fonts |
| pdftotext | typst compile doc.typ && pdftotext doc.pdf - | Fallback for page-specific content |
#set page(paper: "a4", margin: 2cm)
#set text(size: 11pt)
= Title
Content goes here.
Starting a new document? Copy the closest recipe from Examples below — it's faster than starting blank and each row names the docs to read next.
| When you need to... | Read | | -------------------------------------------------- | ------------------------------ | | Learn syntax, imports, functions, control flow | basics.md | | Learn data types, operators, string/array methods | types.md | | Style pages, headings, figures, layout | styling.md | | Tables, grids, cell spans, borders, data tables | tables.md | | Academic papers, bibliography, theorems, equations | academic.md | | Convert from Markdown or LaTeX | conversion.md | | Use Typst CLI commands and build options | cli.md | | Extract data from documents, multi-pass builds | query.md |
| When you need to... | Read |
| ------------------------------------------- | -------------------------- |
| State, counters, in-document query(), XML | advanced.md |
| CLI query, metadata export, multi-pass | query.md |
| Create a reusable template function | template.md |
| Create or publish a package | package.md |
| Verify output (HTML/PNG/pdftotext, repr) | debug.md |
| Profile performance (--timings, hotspots) | perf.md |
basics.md and types.md are also the foundation for developers.
Search the embedded index of Typst Universe packages (updated weekly):
python3 scripts/search-packages.py "what you need"
python3 scripts/search-packages.py "chart" --category visualization
python3 scripts/search-packages.py --category cv --top 5
python3 scripts/search-packages.py --list-categories
| Error | Cause | Fix |
| ------------------------------------------------ | ---------------------------- | ---------------------------------------------------- |
| "unknown variable" | Undefined identifier | Check spelling, ensure #let before use |
| "expected X, found Y" | Type mismatch | Check function signature in docs |
| "file not found" | Bad import path | Paths resolve relative to current file |
| "unknown font" | Font not installed | Use system fonts or web-safe alternatives |
| "maximum function call depth exceeded" | Deep recursion | Use iteration instead |
| "can only be used when context is known" | Missing context wrapper | Wrap in context { ... } |
| "unexpected argument" | = instead of : for args | Named args use : syntax: func(name: value) |
| "variables from outside are read-only" | Mutating captured variable | Use loop accumulation or state() — see advanced.md |
| "expected content, found string" (or vice versa) | Content/string type mismatch | Use [#str-var] to embed string in content |
| set/show rule has no effect | Rule placed after content | Place set/show rules before the content they target |
Copy the closest starter, adjust, compile. For CVs, letters, or slides, search packages: python3 scripts/search-packages.py --category cv (or letter, presentation).
| Example | Start here when you want... | Next read | | --------------------------------------------------- | ---------------------------------------- | ------------------------------------------------ | | basic-document.typ | A short note or memo | basics.md, styling.md | | styled-document.typ | A multi-section report with page styling | styling.md, tables.md | | template-report.typ | A reusable template for a series | template.md | | tables-showcase.typ | A data-heavy doc (tables, CSV/JSON) | tables.md, types.md | | academic-paper.typ | A paper with citations, theorems, math | academic.md | | query-export.typ | Metadata export or multi-pass builds | query.md | | package-example/ | A publishable package | package.md |
brew install typstcargo install typst-cliwinget install typsttypst query in shell scriptsSearch the embedded index of Typst API functions, methods, and constructors:
python3 scripts/search-api.py "image width fit"
python3 scripts/search-api.py "color lighten" --kind method
python3 scripts/search-api.py --name str.position -v
python3 scripts/search-api.py "rightarrow" --kind symbol # LaTeX names work
python3 scripts/search-api.py --list-categories
Ecosystem tools: tinymist (LSP/editor), typstyle (formatter), typst-package-check (package validator), tytanic (visual test runner). For package tooling details, see package.md.
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.