Wiki pages
Getting Started
Notes & Writing
Templates
Templates are reusable note scaffolds stored per cave. When you create a note from a template, Granit copies the template’s content into the new note so you start from a consistent structure instead of a blank page. Templates are especially useful together with Daily Notes, which can seed each new day’s note from a template.
Where templates live
Templates live in the cave’s .granit/templates/ directory, alongside the cave’s config.yml. They sit outside the normal note tree, so they never appear in the Explorer file tree or in cave note scans, and they are not valid Wiki-links targets.
Each template is a Markdown file. Templates use their own flat slug namespace — separate from note slugs and not nested into subfolders. A template’s slug is its filename stem, just like a note’s.
Note
Because templates are stored under .granit/, they are part of the cave’s configuration rather than its content. See Cave Rules for what .granit/ contains and Configuration for the per-cave config model.
Creating notes from templates
When you create a new note, you can choose a template to seed its contents. Granit copies the selected template’s body into the new note, and you continue editing from there as with any other note — see Notes & Markdown for the editing flow. The AI agent can do the same through its create_note tool — see Agent Tools and RAG.
A template is just Markdown, so it can include frontmatter fields, headings, task lists, and placeholder text that you fill in each time. The tags, icon, and presentation frontmatter fields of a template are copied to notes created from it, so a template with presentation: default-dark produces notes that are ready to present — see Presentations.
Template variables
A template body is a Tera template, rendered when the note is created:
| Variable | Available | Contents |
|---|---|---|
slug | Always | The new note’s slug |
date | Daily notes only | The note’s date as YYYY-MM-DD |
tomorrow, yesterday | Daily notes only | Neighboring dates as YYYY-MM-DD |
year, month, day | Daily notes only | The note’s date components |
weekday, weekday_short | Daily notes only | Weekday name, full and abbreviated |
The date variables are set when the new note’s slug matches the daily-note date format YYYY-MM-DD — see Daily Notes. Full Tera syntax works, including conditionals and filters, and the editor highlights template blocks and completes the variables while you edit a template.
Related pages
- Daily Notes — seed each daily note from a template.
- Presentations — presentation templates, the CSS files that live next to note templates.
- Notes & Markdown — edit notes created from a template.
- Skills and Tasks — the agent’s own Tera-templated files.
- Configuration — per-cave settings, including the default daily-note template.
- Cave Rules — the role of the
.granit/directory.