typst
Skill2 starsChanged 9 months agoMITView on GitHub
Syntax guide and ecosystem reference for writing Typst (.typ) files. Use this skill when writing, editing, or debugging Typst documents. Covers core syntax, common errors, packages, and best practices.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- RKelln/hermes_skillstheir own version, first seen Nov 7, 2026
- sghng/abstracttheir own version, first seen Oct 15, 2026
- lucifer1004/claude-skill-typsttheir own version, first seen Sep 3, 2026
- zavu1on/typst-poly-templatestheir own version, first seen Jul 29, 2026
- Hemalv02/claude-skillstheir own version, first seen Jul 16, 2026
- PedroEvangelis/curr-mvptheir own version, first seen Jun 2, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- lucifer1004/claude-skill-typst★ 136same name
- statzhero/typst-skill★ 12same name
- akilrammohan/typst-skill★ 7same name
- tcztzy/skills★ 2same name
- Hemalv02/claude-skills★ 1same name
- PedroEvangelis/curr-mvp★ 1same name
- zavu1on/typst-poly-templates★ 1same name
- Mineru98/typst-skills★ 0same name
- mj-deving/pai-skills★ 0same name
- RKelln/hermes_skills★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- compileSkill
- context-statusSkill
- create-documentSkill
- deploySkill
- devils-advocateSkill
- diagramSkill
- doc-reviewSkill
- excellenceSkill
- extract-diagramsSkill
- finishSkill
- google-tasksSkill
- image-searchSkill
- learnSkill
- mindmapSkill
- pedagogy-reviewSkill
- proofreadSkill
- qaSkill
- sec-edgarSkill
- translateSkill
- validate-bibSkill
- verifySkill
- visual-auditSkill
- waybackSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 1 is distinctive, and 8 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Use the qk-doc or qk-report preset
- Very specific: line 17
Use touying for presentations (not raw page dimensions) — see references/touying-guide.md
- Very specific: line 19
Add alt: to images — image("path.png", alt: "description")
- Very specific: line 47
Import @local/qk:2.2.0 at top
- Very specific: line 48
Use qk-doc or qk-report preset when applicable
- Very specific: line 121
When writing content, automatically convert matching patterns to @local/qk:2.2.0 components:
- Very specific: line 139
Add <label> + @ref for recurring concepts across sections.
- Distinctive: line 177
Look up the exact signature before writing an unfamiliar function or parameter.
- Very specific: line 225
--rootflag: When a .typ file uses #import or #image() with paths outside its directory, set --root to the project root.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Typst Skill
Current version: Typst 0.15.x
Smart Defaults
Defaults, unless the user or the project's existing files say otherwise:
- Import
@local/qk:2.2.0—#import "@local/qk:2.2.0": * - Use the
qk-docorqk-reportpreset - Use touying for presentations (not raw page dimensions) — see
references/touying-guide.md #set figure(placement: auto)— prevents blank half-pages- Add
alt:to images —image("path.png", alt: "description") - Escape
$in content — scan for bare$before compiling - Default fonts: Libertinus Serif (body), Inter (headings), New Computer Modern Math (math), Fira Code (code)
- Default compile:
typst compile --root .. Source/<file>.typ - Template when the request doesn't settle it: Study Guide
- Visual tool when the content doesn't settle it: diagrams → fletcher; charts → see decision tree (default → lilaq; extremely simple → cetz-plot (rare); statistical kde/pair → matplotlib+seaborn; grammar → plotnine; complex with Python data → matplotlib)
- Scan the project for existing
.typfiles and match their style (fonts, colors, qk preset)
New Document Decision Tree
User request → scan for keywords:
"resume/CV/job" → CV / Résumé template
"slides/presentation" → Presentation (touying — metropolis default)
"lecture/class/academic" → Academic Lecture (touying — university theme)
"essay/thesis/paper" → Essay
"report/brief/client" → Business Report
"research/analysis" → Research Report
"study guide/revision" → Study Guide
"reference/glossary" → Annotated Reference
"cheatsheet/reference card/formula sheet" → Cheatsheet template
"exam/problem set/homework" → Exam template
"flashcard/Q&A/quiz" → Flashcard template
ambiguous? → ask purpose + audience → pick templateSteps:
- Auto-detect template from keywords above
- Import
@local/qk:2.2.0at top - Use
qk-docorqk-reportpreset when applicable - Auto-select template. State choice in Phase 3 summary. User can re-invoke with explicit type override if wrong.
- Build from
references/templates.md - Custom styles are fine — templates are starting points, not constraints
Visual Tool Routing (compact)
Diagrams (always native Typst — NEVER Python):
| Need | Tool |
| Flowcharts, trees, ER, state diagrams | fletcher |
| Sequence diagrams | chronos |
| Gantt charts | timeliney |
| Linear timelines | herodot |
Charts (generate SVG, embed with #figure(image(...))):
| Need | Tool |
| Extremely simple charts where lilaq is overkill (rare) | cetz-plot (Typst native, qk-cycle colors) |
| Most charts (line, bar, scatter, violin, heatmap, contour, subplots) | lilaq (Typst native, font-matched, as lq) |
| Statistical plots (kde, pair plots) | matplotlib + seaborn (use(), SVG) |
| Grammar-of-graphics / faceted plots | plotnine (theme_qk(), SVG) |
| Complex charts with Python data pipeline | matplotlib (full API, SVG) |
Images & layout:
| Need | Tool |
| Tables, boxes, grids | Typst native |
| Mind maps | /mindmap (auto-invoke) |
| Conceptual illustrations | gemini-generate-image MCP (auto-invoke) |
| Real photos, logos | /image-search (auto-invoke) |
Detail and examples in references/tool-routing.md.
Proactive Behaviors
Visual Auto-detection
When writing Typst documents, add a visual wherever it makes the content clearer, without waiting to be asked. Route by content type: diagrams → native Typst (fletcher/chronos/timeliney/herodot); charts → follow the Charts table above (cetz-plot for very simple, lilaq for most, matplotlib/seaborn/plotnine for statistical or grammar-of-graphics) — generate SVG, embed; images → /image-search / /mindmap / gemini-generate-image MCP.
| Content pattern | Visual to add | Tool |
| Comparison grids, attribute tables | Styled table | Typst native |
| Callout boxes, styled layouts | rect() / block() | Typst native |
| Sequential steps, decision logic | Flowchart / decision tree | fletcher |
| Process with inputs/outputs | Workflow diagram | fletcher |
| System architecture, ER diagrams | Block / entity diagram | fletcher |
| Hierarchy or taxonomy | Tree diagram | fletcher or /mindmap |
| Topic overview, concept map | Mind map | /mindmap |
| Request-response, API flows | Sequence diagram | chronos |
| Project schedule, phases | Gantt chart | timeliney |
| Historical events, evolution | Timeline | herodot or timeliney |
| Extremely simple chart where lilaq is overkill (rare) | Line/bar/scatter chart | cetz-plot (Typst native) |
| Most charts (multi-series, subplots, violin, heatmap, contour) | Data visualization | lilaq (Typst native, font-matched) |
| Statistical chart (kde, pair plots) | Statistical plot | matplotlib+seaborn (SVG) |
| Faceted / grammar chart | Layered plot | plotnine (SVG) |
| Company logo, brand mark | Logo image | /image-search --logo |
| Real-world photograph | Photo | /image-search |
| Concept with analogy, metaphor | AI illustration | gemini-generate-image MCP |
See references/tool-routing.md for full examples, fallback chains, and auto-invoke rules.
Content Structure
- Suggest TOC (
#outline()) at 4+ sections - Suggest file split at 40+ pages — see
references/common-patterns.md"Large Documents" - Convert prose lists to tables when 3+ items with attributes
Component Library Auto-use
When writing content, automatically convert matching patterns to @local/qk:2.2.0 components:
| Content pattern | Use instead |
| Warning paragraph | warning[...] |
| Key point / takeaway | keypoint[...] |
| Tip or best practice | tip[...] |
| Common mistake / trap | trap[...] |
| Step-by-step procedure | step-box("Title", [...]) |
| Key equation / formula | formula-box("Title", [...]) |
| KPI or metric highlight | stat-card("value", "label") |
| Frequency indicator | freq-badge("HIGH") / freq-badge("MEDIUM") / freq-badge("LOW") |
| MCQ answer explanation | answerbox("A", "why", "trap", "concept") |
| Analogy / intuition | analogy[...] |
| "Why this matters" | whycare[...] |
Cross-referencing
Add <label> + @ref for recurring concepts across sections.
Accessibility (Typst 0.14+)
alt:on all figures —image("path.png", alt: "description")- Semantic heading hierarchy — don't skip levels
table.header()for repeating headers — improves PDF/UA accessibility
Fallback Chains
| If this fails... | Try... |
gemini-generate-image MCP | Placeholder #rect(width: 100%, height: 4cm, fill: luma(240))[Image placeholder] |
/image-search | gemini-generate-image MCP with descriptive prompt |
/mindmap | fletcher tree diagram |
| matplotlib | Check .venv → uv venv .venv.nosync && ln -s .venv.nosync .venv |
typst compile | Isolate with /* ... */, compile incrementally |
Reference File Index
| When you need... | Read... |
| Syntax, errors, special chars | references/quick-ref.md |
@local/qk:2.2.0 API | references/component-library.md |
| Visual tool details, examples, fallbacks | references/tool-routing.md |
| Document preambles | references/templates.md |
| Table patterns, show rules, large docs | references/common-patterns.md |
| Page layout, spacing, figures, curves | references/layout-patterns.md |
| Math mode traps | references/math-pitfalls.md |
| Package imports | references/packages.md |
| Touying presentations (themes, slides, speaker notes) | references/touying-guide.md |
| Visual verification (PNG rendering, spot-checks) | references/visual-verification.md |
| Quality gates, rubrics, dispatch table | references/quality-gates.md |
| Data-driven generation (JSON, CSV, batch, variants) | references/data-driven.md |
sym.* symbols | references/symbols.md |
Offline API and Package Search
Look up the exact signature before writing an unfamiliar function or parameter; don't guess from memory. Index covers Typst 0.15.1 (the installed version).
python3 -I ${CLAUDE_SKILL_DIR}/scripts/search-api.py --name text # exact: text, str.position, table.cell
python3 -I ${CLAUDE_SKILL_DIR}/scripts/search-api.py "rotate content angle" --top 5
python3 -I ${CLAUDE_SKILL_DIR}/scripts/search-packages.py "gantt chart" -n 5 # Typst Universe, filtered to installed compiler
python3 -I ${CLAUDE_SKILL_DIR}/scripts/search-packages.py --category cv -n 5Scripts and data/ come from lucifer1004/claude-skill-typst (MIT). After a Typst upgrade, or to refresh the package index, copy skills/typst/data/{api,api-bm25,packages,packages-bm25}.json from that repo into ${CLAUDE_SKILL_DIR}/data/.
Text-level check without rendering: typst compile doc.typ /dev/stdout -f html --features html 2>/dev/null dumps headings, paragraphs and tables as HTML — cheaper than PNG when only content or structure needs checking.
Version Notes (0.13–0.15)
| Feature | Ver | Description |
| Variable fonts | 0.15 | Supported at last — axis selection via text(variations: (...)); Apple variable fonts (New York, SF NS) now load |
within selector | 0.15 | Match elements inside a container — simplifies introspection |
divider element | 0.15 | Thematic break (templates can customize) |
| Multiple bibliographies | 0.15 | Independent bibliographies via bibliography(target:, group:) |
| MathML HTML export | 0.15 | Equations export to web (was a hard limitation before) |
typst eval | 0.15 | General CLI introspection — supersedes typst query |
| Tagged PDFs, PDF/UA-1 | 0.14 | Accessible PDFs by default |
figure.alt / image(alt:) | 0.14 | Alt text for screen readers |
pdf.attach | 0.14 | Attach files (replaces pdf.embed) |
| PDF as image format | 0.14 | image("file.pdf") |
| Multiple table headers | 0.14 | Hierarchical headers repeat across pages |
curve function | 0.13 | Bezier drawing (replaces path) |
Removed in 0.15 (were deprecated, now gone): path element → use curve · pdf.embed → pdf.attach · image.decode / scoped decode fns → pass bytes directly · pattern type → tiling
Other migrations: polylux:0.3.1 → polylux:0.4.0 or touying
Breaking (0.15): file paths must use forward slashes only (no backslashes)
| touying 0.8.0 | 0.6+ | Presentation framework — #show: theme.with(...) API (not the old register() pattern) |
CLI Commands
typst compile document.typ # Compile to PDF
typst compile document.typ --root .. # Set project root
typst compile document.typ out.pdf --pages 1-5 # Specific pages
typst watch document.typ # Watch and recompile
typst fonts # List available fonts
typst eval doc.typ "heading.where(level: 1)" # Introspect structure (supersedes `typst query`)
typst query doc.typ "heading.where(level: 1)" # Older form — still works--root flag: When a .typ file uses #import or #image() with paths outside its directory, set --root to the project root.
Batch compile: for f in *.typ; do typst compile "$f"; done
Conventions
- Source files in
Source/, compiled PDFs inPDFs/ - Compile with
--root ..when.typreferences parent directory assets - For multi-file projects:
main.typ+#includesections + sharedlib.typ - File naming: lowercase-kebab-case (e.g.,
portfolio-theory-guide.typ)
Fonts
| Font | Style | Notes |
| New Computer Modern | Academic serif | Default; bundled with Typst |
| Georgia | Readable serif | Safe on macOS |
| Helvetica Neue | Clean sans-serif | macOS only |
Variable fonts (supported since 0.15): Apple variable fonts and others now load directly — no need to install static .otf/.ttf versions. Select an axis with #set text(font: "New York", variations: (wght: 600)). The "Variable"/"Var"/"VF" suffix in a font's name is trimmed automatically, so reference the base family name. Note Apple's exposed family names differ from marketing names: San Francisco is SF NS (not "SF Pro"), and the serif is New York — run typst fonts to confirm. (On Typst ≤ 0.14 these failed with "variable fonts are not currently supported" — only relevant if pinned to an old binary.)
CJK fallback: #set text(font: ("New Computer Modern", "Songti SC"))
Documentation
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

