Direct Template Invocation with AI + Skills
What This Tutorial Teaches
You'll learn to use AI to directly call Presto templates, converting Markdown to Typst without opening the Presto application. Just say a sentence in Claude Code, and AI will automatically find the template, read the file, and perform the conversion.
- Estimated time: 15-20 minutes
- Final deliverable: Complete a Markdown -> Typst conversion using AI from the command line
- Prerequisites: Presto installed (with templates), Claude Code installed
Ready? Let's begin.
Part 1: Install the Presto Skill
Claude Code's Skill mechanism enables AI to automatically recognize your intent and call the appropriate tool. We need to place the presto-convert Skill where Claude Code can read it.
Option 1: Install to Current Project (Recommended)
Best when you frequently use Presto conversion in a specific project:
mkdir -p .claude/skills/presto-convert
cp ~/Developer/Presto-io/Presto-doc/skills/presto-convert/SKILL.md \
.claude/skills/presto-convert/SKILL.mdOption 2: Install to Global Directory
Best when you want to use it from any directory:
mkdir -p ~/.claude/skills/presto-convert
cp ~/Developer/Presto-io/Presto-doc/skills/presto-convert/SKILL.md \
~/.claude/skills/presto-convert/SKILL.mdVerify Installation
Open Claude Code and mention something related to Presto templates, like "Help me see what Presto templates are available." If AI recognizes the Skill and starts scanning the ~/.presto/templates/ directory, the installation was successful.
Part 2: View Installed Templates
After installing the Skill, let's see which templates are available locally.
Conversation Replay
You: Help me see what Presto templates are installed locally?
AI: Let me scan your templates directory.
bashls ~/.presto/templates/You have the following templates installed:
Template Name Directory letter ~/.presto/templates/letter/report ~/.presto/templates/report/Let me check the detailed information for each template.
bash~/.presto/templates/letter/presto-template-letter --manifestjson{ "name": "letter", "version": "0.1.0", "description": "Chinese business letter template", "author": "Presto" }bash~/.presto/templates/report/presto-template-report --manifestjson{ "name": "report", "version": "0.1.0", "description": "Technical report template", "author": "Presto" }You have two templates:
- letter — Chinese business letter template
- report — Technical report template
Which template would you like to use for document conversion?
Verification Point
You should be able to see template names and descriptions. If the ~/.presto/templates/ directory is empty, it means no templates are installed yet. You'll need to install some through the Presto application first.
Part 3: Convert Documents with AI
Now let's do a complete conversion. Let's say you have a Markdown file you want to convert to Typst.
Conversation Replay
You: Use the letter template to convert
./notes/meeting-2026-03.mdto Typst
AI: Let me first check the contents of this file.
bashcat ./notes/meeting-2026-03.mdmarkdown--- to: Manager Zhang from: Li Ming date: 2026-03-01 subject: Q1 Project Progress Report --- Dear Manager Zhang, The project has progressed smoothly this quarter. The following work has been completed: 1. Core module development completed 2. Passed security audit 3. Positive user testing feedback Please review.Content confirmed. Now converting with the letter template.
bashcat ./notes/meeting-2026-03.md | ~/.presto/templates/letter/presto-template-letter > ./notes/meeting-2026-03.typConversion complete. The generated Typst file is saved at
./notes/meeting-2026-03.typ. Let me check the output:bashcat ./notes/meeting-2026-03.typtypst#import "@preview/letter:0.1.0": * #show: letter.with( to: "Manager Zhang", from: "Li Ming", date: "2026-03-01", subject: "Q1 Project Progress Report", ) Dear Manager Zhang, The project has progressed smoothly this quarter. The following work has been completed: + Core module development completed + Passed security audit + Positive user testing feedback Please review.Typst source code generated. If you have the
typstCLI installed locally, I can compile it further to PDF.
Verification Point
Check that the output .typ file exists and contains Typst-formatted code.
Part 4: Advanced Usage
Now that you've mastered the basics, here are some practical tips.
Batch Convert Multiple Files
You: Convert all
.mdfiles in./notes/using the report template
AI will iterate through the directory and perform conversions one by one:
for f in ./notes/*.md; do
cat "$f" | ~/.presto/templates/report/presto-template-report \
> "${f%.md}.typ"
doneSpecify Output Path
You: Convert
draft.mdusing the letter template, output to./output/draft.typ
AI will automatically create the directory and output to the specified location:
mkdir -p ./output
cat draft.md | ~/.presto/templates/letter/presto-template-letter \
> ./output/draft.typView Template's Example Document
Want to know what format a template expects? Use --example to view:
~/.presto/templates/letter/presto-template-letter --exampleThis outputs a sample Markdown demonstrating the frontmatter fields and body structure that the template supports.
Compile to PDF
If you have the typst CLI installed, you can go straight to PDF in one step:
cat input.md | ~/.presto/templates/letter/presto-template-letter \
| typst compile - output.pdfOr do it in two steps:
# First convert to Typst
cat input.md | ~/.presto/templates/letter/presto-template-letter > output.typ
# Then compile to PDF
typst compile output.typ output.pdfNext Steps
This tutorial covered the complete workflow from installing the Skill to completing a conversion. Next, you can:
- Next tutorial: Auto-Adapt Content to Template Format with AI — Learn how to have AI automatically adjust document structure to match template requirements
