The folio format
A Kalmatu folio is one folder of plain UTF-8 text files. This guide is everything needed to write one, by hand or with an AI agent. The official folios (German, Japanese, Russian, Spanish and Ham Radio) are complete examples: download one from its page at kalmatu.com/library, or copy one in the Mac app's Build page.
spanish/
folio.txt settings (required)
tutor.md the sheet tutor's prompt, for discussing a sheet
quiz.md what the folio's quizzes are made of
exams.txt practice exams put together like the real ones (optional)
conversation.md the conversation partner's prompt
card-style.md how cards are written
cards.txt the folio's cards
sheets/
01-the-alphabet.md
02-greetings.md
media/ images and sounds that sheets and cards use (optional)
mouth-shapes.png
The sheets can also be grouped in folders, each shown as a section of the sheet list (see "Folders of sheets" below).
Only folio.txt is required. Any other file (such as this README) is ignored.
folio.txt
One setting per line, Key: value. Leave a value empty rather than leaving the line out.
Name: Spanish
Description: Spanish from the first word to A1: a sheet for each grammar topic, and the A1 word list.
Language: Spanish
Voice: es-ES
Fields: Spanish | English | Example | Notes
Both ways: yes
Familiar: 85%
Multiple choice: no
- Name: what the folio is called (at most 80 characters).
- Description: one or two sentences.
- Language: for a language folio, the language's English name. It turns on the vocabulary band estimate and lets the AI suggest cards from conversations in that language. Leave it empty for other subjects.
- Voice: a language tag such as
de-DE,ru-RU,ja-JPores-ES. The device reads each card's first field aloud in that voice. Leave it empty for no speech. - Fields: the names of a card's four fields, separated by
|: the front, the back, and two extras shown with the answer. The defaults areFront | Back | Example | Notes. - Both ways:
yesto study each card front-to-back and back-to-front, scheduled separately;nofor front-to-back only. - Familiar: how well a sheet's cards must be remembered for the sheet to count as
familiar, from
50%to99%(85%if left out). Kalmatu estimates each card's recall from its review schedule (about 90% when it falls due, less the longer it is overdue). A sheet whose cards are all learned is familiar while their average is at least this, and fading below it, when Kalmatu suggests reviewing it. Ask for more for exam preparation, such as90%. - Multiple choice: for exam questions. A card's fourth field holds its
choices, lettered and separated by
·(A. ARRL · B. Homeland Security · C. The FCC), and review shows them under the question, as the exam does. The back is the correct choice with its letter (C. The FCC). yes: the learner answers by clicking a choice (or pressing its letter). Kalmatu marks it: right counts as Good, wrong as Again, and the right answer is shown.self-assessed: the choices are shown, the learner shows the answer and rates it Again, Hard, Good or Easy, as with any card.no(or left out): an ordinary folio.
This is the folio's default: each learner can switch between answering by choosing and rating themselves in Settings.
cards.txt
One card per line, fields separated by |:
# Lines starting with # are comments.
el pan | bread | Compro pan fresco. | m.; pl. los panes | Food
hablar | to speak | Hablo español. | regular -ar verb | Verbs, Week 1
la casa | house
- The first field (the word, or the question).
- The second field (the meaning, or the answer).
- An example (optional).
- Notes (optional).
- Decks (optional): deck names separated by commas. A deck is a group of cards to study or cram on their own.
The first two fields are required and can be at most 255 characters. Trailing empty
fields can be left out. Each first field may appear only once. Cards are introduced
to the learner in file order, so put the most useful first. Russian stress can be
typed as an apostrophe after the stressed vowel (кни'га); it becomes an accent.
sheets/NN-slug.md
Sheets are the folio's pages, read in order: lessons, grammar topics, chapters. The number sets the order and the rest of the file name (lowercase letters, digits and hyphens) is its address. Changing a sheet's slug starts its tutor practice afresh. Every sheet's slug must be different, even in different folders.
Each sheet starts with two header lines and a blank line, then Markdown:
Title: Greetings
Summary: Say hello and goodbye, and ask how someone is.
## Introduction
How to greet people politely and informally.
## Examples
| Spanish | English |
| --- | --- |
| ¡Hola! ¿Qué tal? | Hi! How are you? |
```cards
¡Hola! ¿Qué tal? | Hi! How are you?
buenos días | good morning | Buenos días, señora. |
```
- Markdown tables, lists, headings, bold and italics all work. Wrap hidden answers in
<details markdown="1">with a<summary>. - A
```cardsblock at the very end of the sheet holds the sheet's cards, in the same format ascards.txt. They come with the folio: adding it adds them to the learner's cards (aftercards.txt's, in sheet order), and the sheet shows them. Each card goes into the decks named in its fifth field, so a sheet's cards arrive sorted: the Ham Radio folio's questions go into a Technician, General or Amateur Extra deck. - A folio's cards can live only in its sheets, with no
cards.txt, as the Ham Radio folio's do. - Keep a sheet self-contained. The whole sheet is given to the tutor as the scope of its practice.
The official language sheets follow this outline: Introduction, explanation sections with tables, and Examples (a two-column table). They only explain the grammar, clearly and briefly: no common mistakes or exercises, which are what the tutor is for. Their cards are the folio's words that their Examples use.
Folders of sheets
A long folio can group its sheets in folders, such as one for each level. Each folder is a section of the sheet list that opens and closes: on the Sheets page, the section holding the next sheet starts open.
sheets/
01-a1-beginner/
section.txt Title: A1 · Beginner
01-the-alphabet.md
02-greetings.md
02-a2-elementary/
section.txt
01-the-preterite.md
- A folder is named like a sheet without
.md: a number, then lowercase letters, digits and hyphens. The number sets its place among the other folders and any sheets outside them. Inside, its sheets are numbered from 01 again. section.txtis optional and holds one line,Title:, the section's name. Without it, the folder's name is used:02-a2-elementarybecomes "A2 elementary".- Folders go one level deep: no folders inside folders.
- Sheets are numbered straight through the whole folio, so the first sheet of the second section follows on from the last of the first.
tutor.md, quiz.md and conversation.md
Prompts for Claude. Without tutor.md sheets have no discussion; without quiz.md
the folio has no quizzes; without conversation.md the Tutor page has no conversation.
tutor.mdsays how the tutor discusses every sheet with the learner: their questions about it, more examples, anything unclear. Kalmatu adds the sheet itself, and the cards the learner has learned, after it, so the prompt needn't describe them.quiz.mdsays what the folio's quizzes are made of: how many questions, of which kinds and in what mix, how they're worded, and how written answers are marked (what counts as right: accents, synonyms, rounding). A quiz is written from the cards the learner knows on one sheet (from its page) or on the sheets they choose (from the Tutor page). Kalmatu adds those sheets and cards after the prompt, and fixes the quiz's form: each question is either multiple choice (2 to 6 choices, one right, lettered by Kalmatu) or written (the learner types an answer, which Claude marks).conversation.mdsays how the conversation partner behaves. Kalmatu adds the learner's learned cards after it.
Write them as plain instructions, in the second person ("You are a terse Spanish tutor..."). The official folios' prompts are good models: brief replies, corrections with the rule, no praise or filler.
exams.txt: practice exams
For a folio of exam questions: each real exam, so Kalmatu can put practice ones
together the same way, from the whole question pool and word for word. One block per
exam, separated by a blank line; lines starting with # are comments.
Exam: Technician (Element 2)
Deck: Technician
Questions: one from each group
Group: Reference 3
Pass: 26
Exam:its name.Deck:the decks its questions come from, separated by commas. Leave it out to use all the folio's cards.Questions:a number, drawn at random, orone from each group.Group:withone from each group: a field and how many of its first characters make a group.Reference 3makes T1A of T1A01, so the exam has one question from each of T1A, T1B and so on, as the real one does.Pass:how many must be right, or a percentage (70%).Minutes:a time limit, if the exam has one; the page counts down and hands the exam in when time is up.
A multiple-choice folio's questions show their choices in the pool's order, and are marked by Kalmatu. Other cards are written questions: the learner types an answer, which the AI tutor marks against the card's back, following quiz.md's marking rules. Each question's part of the exam is the sheet that lists its card, for the score by part.
card-style.md
How this folio's cards are written: articles on nouns, stress marks, kana with kanji in brackets, and what goes in the notes. Learners see it when adding cards, and the AI follows it when suggesting cards from a conversation.
media/: images and sounds
Images and sounds go in media/, and sheets and cards use them by name. An image is
written as Markdown writes one, with a description of it for people who can't see it;
a sound as Anki writes one:

[sound:media/rr-trilled.mp3]
- A sheet can use them anywhere in its Markdown. A sound is shown as a player.
- A card can use them in any field, such as a figure on a question's front, or a native speaker's recording beside the example. On the review screen, a card's recording plays in place of the device's voice, and a field that is only an image or a sound isn't read aloud.
- Images can be PNG, JPEG, GIF or WebP; sounds MP3, M4A, OGG or WAV. Not SVG.
- Name files with letters, digits, dots,
-and_; folders insidemedia/are fine (media/figures/t1.png). Each file can be at most 5 MB, and a folio's media 20 MB in all. - Checking the folio finds a file a sheet or card uses that isn't in
media/, with the file and line. - Use only images and sounds you may share: a folio carries them wherever it goes.
Checking a folio
In the Mac app, open Build (6): every folder in ~/Documents/Kalmatu is listed,
checked and previewed, and the preview updates as files change. Problems are shown
with the file and line. From a terminal:
/Applications/Kalmatu.app/Contents/MacOS/Kalmatu check ~/Documents/Kalmatu/spanish
python3 folio_files.py check folios/german (from the Kalmatu source)
Either prints a summary, or what's wrong and where, and exits non-zero on a problem.
For AI agents
To make a folio: create a folder in ~/Documents/Kalmatu (or wherever you are asked),
write folio.txt, the prompts, cards.txt and the sheets as described above, then run
the check command and fix whatever it reports. Write real content in the folio's
language and keep each sheet's ```cards block to cards a learner should study. The
learner adds the folder to Kalmatu from Build mode; nothing else needs to change.
A folio downloaded from Kalmatu is a .zip of one such folder, and a .zip of a folder like this can be imported on kalmatu.com or in the app.