A specialized tool for generating and maintaining documents using the Typst markup language.
Install
mkdir -p .claude/skills/typst && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10109" && unzip -o skill.zip -d .claude/skills/typst && rm skill.zipInstalls to .claude/skills/typst
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Generate idiomatic Typst (.typ) code, edit existing Typst files, and answer Typst syntax questions. Use when working with Typst files (*.typ) or when the user mentions Typst markup, document creation, or formatting.Key capabilities
- →Generate Typst code
- →Edit Typst files
- →Answer syntax questions
- →Format documents
- →Structure technical content
How it works
It provides templates, syntax assistance, and formatting guidelines for creating technical documents in Typst.
Inputs & outputs
When to use typst
- →Create a new technical report template in Typst
- →Fix formatting issues in a document
- →Add a new section or styling rule to a .typ file
About this skill
typst skill
Overview
This skill helps agents generate, edit, and reason about Typst documents. It provides quick‑start examples, detailed workflows, and links to the full Typst documentation (guides, tutorials, reference).
Minimal document example
#set document(title: "My Document", author: "Author Name")
#set page(numbering: "1")
#set text(lang: "en")
// Enable paragraph justification and character-level justification
#set par(
justify: true,
justification-limits: (
tracking: (min: -0.012em, max: 0.012em),
spacing: (min: 75%, max: 120%),
)
)
#title[My Document]
= Heading 1
This is a paragraph in Typst.
== Heading 2
#lorem(50)
Workflows
- Creating a new Typst project: Use the "Minimal document example" above as a starting point. Skim the tutorial for the basics (docs/tutorial/writing-in-typst.md), then create the
.typfile(s). - Editing existing content: Locate the target text and apply changes; confirm syntax against the reference when needed (docs/reference/).
- Formatting & Styling: Consult the styling guide (docs/reference/styling.md) for
set rule,show rule, and custom themes.
Documentation
- Guides:
docs/guides/*.md - Tutorials:
docs/tutorial/*.md - Full reference tree:
docs/reference/**/*.md
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
docs/folder before generating code. - Read the relevant documentation (use
Read/Grep/Globon the paths above). - Generate or modify the
.typsource according to the user's request. - Validate the generated Typst by running
typst compile(if tool access is allowed). - Provide the final
.typcontent and optionally a rendered preview (PDF/HTML).
Quick syntax reference
Critical distinctions
- Arrays:
(item1, item2)(parentheses). See docs/reference/foundations/array.md. - Dictionaries:
(key: value, key2: value2)(parentheses with colons). See docs/reference/foundations/dictionary.md. - Content blocks:
[markup content](square brackets). See docs/reference/foundations/content.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/scripting.md, docs/tutorial/writing-in-typst.md
// Incorrect (missing # inside content block)
text(...)[(numbering(...))]
// Correct
text(...)[(#numbering(...))]
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).
// Set rule: configure optional parameters for an element type
#set heading(numbering: "I.")
#set text(font: "New Computer Modern")
// Show-set rule: apply a set rule only to selected elements
#show heading: set text(navy)
// Show transform rule: replace/reshape element output
#show heading: it => block[#emph(it.body)]
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
- Custom themes: See docs/reference/styling.md for theme creation.
- Scripting: Use Typst's scripting capabilities (docs/reference/scripting.md) for automatic generation.
- Math and visualisation: Reference docs/reference/math/ and docs/reference/visualize/ 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/foundations/module.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. - Remember: Typst uses fully qualified imports with specific versions - there's no package cache to update.
Compilation errors
Common fixes:
- "expected content, found ...": You're using code where markup is expected - wrap in
#{ }or use proper syntax. - "expected expression, found ...": Missing
#(or#(...)) in markup/content blocks. - "unknown variable": Check spelling, ensure imports are correct.
- Array/dictionary errors: Review syntax - use
()for both, dictionaries needkey: value, singleton arrays are(elem,).
When not to use it
- →LaTeX document conversion
Prerequisites
Limitations
- →Requires local documentation verification
How it compares
It focuses on idiomatic Typst markup, avoiding LaTeX-style commands and providing a more modern, scriptable document generation approach.
Compared to similar skills
typst side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| typst (this skill) | 0 | 4mo | No flags | Intermediate |
| write-docs | 6 | 3mo | No flags | Beginner |
| docs-changelog | 4 | 4mo | No flags | Beginner |
| docs-writer | 4 | 3mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
write-docs
tldraw
Writing SDK documentation for tldraw. Use when creating new documentation articles, updating existing docs, or when documentation writing guidance is needed. Applies to docs in apps/docs/content/.
docs-changelog
google-gemini
Provides a step-by-step procedure for generating Gemini CLI changelog files based on github release information.
docs-writer
google-gemini
Always use this skill when the task involves writing, reviewing, or editing files in the `/docs` directory or any `.md` files in the repository.
technical-docs
getsentry
Write and review technical documentation for Sentry SDK docs. Use when creating, editing, or reviewing documentation pages, especially MDX files in docs/platforms/.
vuepress-plume-markdown
pengzhanbo
Help users write markdown files with VuePress Plume theme extensions, charts, and embeds.
repo-website-guide-create
open-circle
Create conceptual documentation and tutorial pages for the Valibot website at website/src/routes/guides/. Use when adding guides about schemas, pipelines, async validation, migration, or other topics. Covers directory structure, MDX templates, frontmatter, and content guidelines.