claude-skill-typst
CLAUDE.md136 starsChanged 2 months agoMITView on GitHub
A skill that teaches AI agents how to work with Typst. Everything agent-facing lives under skills/typst/. The root README.md is for humans browsing GitHub, and skills/typst/ should not contain a separate human-facing README.md. The current bundled skill targets Typst 0.15+. Typst 0.14.2 support was dropped; the typst-0.14.2 repository tag freezes the last compatible snapshot. The stable API index (data/api.json) auto-follows the latest Typst release via .github/workflows/update-api.yml. Two exporter variants live in tools/: typst-api-exporter.rs tracks upstream main, while typst-api-exporter-stable.rs must compile…
In this repositoryOne other file it gives its agents.
- typstSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
17 rules. About 0 are common, 8 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 41
If it's not in the table, agents won't find it.
- Very specific: line 49
Start with a one-line cross-reference: For language basics, see basics.md.
- Very specific: line 50
Add an entry to the relevant routing table in SKILL.md
- Very specific: line 51
Keep SKILL.md as a router: add only the shortest task-oriented pointer, not a duplicate guide
- Very specific: line 52
If the doc references runnable examples, put them in examples/
- Very specific: line 56
Place under skills/typst/scripts/ (not examples/ — scripts are tools, examples are demos)
- Distinctive: line 57
Must be self-contained: stdlib-only or with clear dep instructions
- Very specific: line 58
Must have --help with usage examples
- Distinctive: line 59
Must work without network access where possible (prefer embedded data over API calls)
- Distinctive: line 66
Document the data schema in the generation script
- Distinctive: line 67
Keep file sizes reasonable — agents load these into context
- Very specific: line 68
Add a CI workflow in .github/workflows/ to refresh the data on a cron schedule
- Distinctive: line 74
Write for strong models with stale knowledge: Before adding content, ask: would a capable model already know this?
- Distinctive: line 77
Cross-reference siblings: Every doc should link to related docs in its first line.
- Distinctive: line 79
Every code example must compile: If it's a snippet that needs context, say so explicitly.
- Very specific: line 91
If it needs --root, document that in a comment at the top of the file
- Distinctive: line 92
Keep examples focused — one concept per file, not a kitchen sink
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Development Guide
What This Is
A skill that teaches AI agents how to work with Typst.
Everything agent-facing lives under skills/typst/. The root README.md is for humans browsing GitHub, and skills/typst/ should not contain a separate human-facing README.md.
The current bundled skill targets Typst 0.15+. Typst 0.14.2 support was
dropped; the typst-0.14.2 repository tag freezes the last compatible
snapshot.
The stable API index (data/api.json) auto-follows the latest Typst release
via .github/workflows/update-api.yml. Two exporter variants live in tools/:
typst-api-exporter.rs tracks upstream main, while
typst-api-exporter-stable.rs must compile against the latest release tag —
update it when a new minor release changes the upstream API.
Project Structure
repo root (NOT bundled) skills/typst/ (bundled skill)
├── tools/ # Data generation ├── SKILL.md # Entry point
├── tests/ # Test suite ├── *.md # Reference docs
├── evals/ # Harbor eval tasks (local only, see evals/README.md)
├── .github/ # CI workflows ├── agents/ # Agent definitions
├── Justfile # Task runner ├── scripts/ # Search & validation
├── pixi.toml # Dependencies ├── data/ # JSON indexes
├── CLAUDE.md # Dev guide └── examples/ # Runnable .typ files
└── README.md # Human readmeArchitecture: The Routing Rule
SKILL.md is the single entry point. It contains:
- Detection patterns and quick reference
- Two routing tables — Writing Documents (user-facing) and Developing Packages and Templates (developer-facing) — that direct agents to the right
*.mdfile by task - Package search, common errors, and examples
Every new .md file or capability MUST be registered in SKILL.md's routing table.
If it's not in the table, agents won't find it. Dead content is worse than no content.
This is enforced by tests/test_structure.py.
Adding New Content
New Reference Doc (e.g., charts.md)
- Create
skills/typst/charts.md - Start with a one-line cross-reference:
For language basics, see [basics.md](basics.md). - Add an entry to the relevant routing table in
SKILL.md - Keep
SKILL.mdas a router: add only the shortest task-oriented pointer, not a duplicate guide - If the doc references runnable examples, put them in
examples/
New Script (e.g., scripts/search-packages.py)
- Place under
skills/typst/scripts/(notexamples/— scripts are tools, examples are demos) - Must be self-contained: stdlib-only or with clear dep instructions
- Must have
--helpwith usage examples - Must work without network access where possible (prefer embedded data over API calls)
- Reference the script from the relevant
.mddoc AND fromSKILL.md
New Embedded Data (e.g., data/packages.json)
- Place under
skills/typst/data/ - Include a generation script under
tools/at the repo root (NOT in the bundle) - Document the data schema in the generation script
- Keep file sizes reasonable — agents load these into context
- Add a CI workflow in
.github/workflows/to refresh the data on a cron schedule
Writing Standards
For .md Reference Docs
- Write for strong models with stale knowledge. Before adding content, ask: would a capable model already know this? Compress well-known basics to one-liners; spend lines on deltas, traps, and post-cutoff changes instead.
- Lead with the pattern, not the explanation. Show the code first, explain after.
- No prose walls. Tables, code blocks, and bullet points. Agents parse structure, not paragraphs.
- Cross-reference siblings. Every doc should link to related docs in its first line.
- Typst code blocks use
```typstfencing. Shell commands use```bash. - Every code example must compile. If it's a snippet that needs context, say so explicitly.
For Scripts
- Python 3.10+ compatible (matches pixi.toml minimum)
argparsefor CLI, with--helpthat shows real usage- Print structured output (tables or
--json) so agents can parse results - Exit code 0 on success, non-zero on failure
For Examples
- Each
.typexample must compile standalone:typst compile examples/foo.typ - If it needs
--root, document that in a comment at the top of the file - Keep examples focused — one concept per file, not a kitchen sink
Validation
Before committing, verify:
just check # runs lint + test + validateOr individually:
just lint # pre-commit hooks (ruff, format, etc.)
just test # pytest (search, structure, API tests)
just validate # inline Typst code blocks compile
just compile-examples # all .typ examples compilePlanned Capabilities
Track new features here. Move to the relevant .md once implemented.
- Package search: BM25 index of Typst Universe packages, weekly CI refresh
- API reference search: BM25 index with LaTeX symbol aliases, weekly CI refresh
- Tables and grids guide:
tables.md - Academic writing guide:
academic.md - CLI introspection guide:
query.mdfortypst eval, metadata export, multi-pass - Content introspection:
advanced.mdsection onfunc(),fields(), show rule decomposition - Ecosystem tooling: tinymist, typstyle, typst-package-check, tytanic in
package.md - Specialized agents:
typst-verify,typst-package-qa - Chart/visualization guide:
charts.mdcovering CetZ, plotst, and raw drawing - Slide/presentation guide:
slides.mdfor Polylux and touying - i18n guide: CJK, RTL, multilingual document patterns
Commit Style
Imperative mood, lowercase, no period. Prefix with scope when touching a single area.
charts: add CetZ line chart example
scripts: package search with embedded index
skill: register charts.md in routing tableDoes 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.

