Template pack format

A template pack is a JSON file: data only, no script, so teaching Keebo one never asks for trust. Every limit here is read from the schema the app checks packs against. A part marked Needed must be there, and a part the format doesn’t name is refused.

A pack

The file’s top level.

schemaVersionNeeded
Which version of this format the pack is in.
Always 2
idNeeded
Lowercase letters and digits, in at least two parts joined by . or -, such as yourname.support.
Up to 100 characters
nameNeeded
What the Library calls the pack.
One line; 1–80 characters
versionNeeded
Three numbers, such as 1.2.0. Raise it on every change.
authorNeeded
Who made it.
One line; up to 100 characters
descriptionNeeded
What’s in it, in a line.
One line; up to 160 characters
tags
Words to find it by.
Up to 8 tags; each 1–24 characters
categories
The order its categories are listed in, each named once.
Up to 40 categories; each 1–40 characters
role
Who the pack is for, such as Recruiting & People.
One line; 1–40 characters
phrasebook
The id of the phrasebook for the same field, such as community.recruiting. Little Keebo offers it beside the pack, to switch on while you write in that field.
Up to 100 characters
language
The language its templates’ text is in. A template’s versions in other languages are its locales.
A language tag, such as en-GB
remember
false keeps what is typed into its blanks from being offered again, unless a template or a blank says otherwise. Packs for clinical, legal or therapy work set it.
true or false
templatesNeeded
Its templates.
Up to 300 templates; at least 1, except in the writer’s own pack, local.mine

A template

Each of the pack’s templates.

idNeeded
A lowercase UUID that never changes: usage, remembered values and updates go by it. Never reuse one.
triggerNeeded
What the writer types after the semicolon: 1 to 40 lowercase letters, digits and hyphens. No two templates in a pack share one.
title
What lists call it. Without one, they show its text’s first line.
One line; 1–60 characters
textNeeded
The template, with its blanks and fields.
Line breaks and tabs are the only control characters; 1–4,000 characters
category
The category it’s filed under.
One line; 1–40 characters
kind
What sort of template it is. Without one, a single line with nothing to fill in is a fact, and anything else a reply.
fact, reply, document, prompt or comment
when
When to use it. Search and the offer while typing match it, so say what the writer is doing, not what the template says.
One line; 1–160 characters
blanks
Details of its blanks, keyed by the blank’s number. Each must be a blank its text has.
variants
Other wordings of a comment, used in turn. Each follows the rules for text.
1–8 wordings; each 1–4,000 characters
locales
Its text in other languages, keyed by language tag, none of them the pack’s own language.
1–12 languages
remember
false keeps what is typed into its blanks from being offered again.
true or false
adapt
false keeps the model from rewording it to fit the conversation.
true or false
suggest
false keeps it from being offered while the writer types.
true or false
updated
When it last changed. The app sets it, and between two Macs the newer copy wins.
A date and time, in ISO 8601

Kinds of template

fact
An address, a link, a signature: typed at once, with no card.
reply
A message. The card opens, and Keebo fills the blanks from what the writer is answering.
document
A note, a pull request, a bug report: sections, and formatting that suits the app it lands in.
prompt
Words for an AI chat. ${selection}, ${clipboard} and ${screen} go in without asking.
comment
Feedback written again and again. Its wordings are used in turn.

A blank

The details of a blank, under its number in a template’s blanks. What each type holds is in Fields and blanks.

type
What it holds.
text, paragraph, choice, many, date, number or optional
hint
What goes in it, such as the customer’s order number. The card shows it, and the model reads it instead of the blank’s words.
One line; 1–80 characters
format
A date’s look: a Unicode date pattern such as EEEE d MMMM, or short, medium, long, full or iso.
One line; 1–40 characters; only on a date blank
remember
false keeps what is typed into it from being offered again.
true or false
on
false starts an optional section switched off. Keebo fills nothing in a section that starts off.
true or false; only on an optional blank

What the schema can’t say

Some rules need the text read. The app checks these when it reads a pack, and so does the admin page:

  • Every key of blanks is the number of a blank the text has.
  • A choice or many blank lists its choices in the text (${2|a,b|}), or words follow its choices (${2=a:…|b:…}). An optional section has words (${3:…}). Any other blank does not list choices.
  • Words that follow a choice ([TEMPLATES.md](../TEMPLATES.md#words-that-follow-a-choice)) end with a brace, give each part a colon, and name in each part a choice the blank has, once. With no ${2|…|}, the first words that follow blank 2 name two choices at least. They don't follow a blank of words or $0, aren't inside the words that follow another choice, and don't hold the choice they follow. The app checks these in a pack from anywhere but the writer's own templates.
  • No two templates in a pack share an id or a trigger.
  • No template has a version in locales whose tag is the pack's language, whatever its case: the text is that version.
  • updated is ISO 8601, with or without fractional seconds.

A pack with every part

The schema’s own test pack, which the app must read.

Show the file
{
  "schemaVersion": 2,
  "id": "example.pack",
  "name": "Example",
  "version": "1.0.0",
  "author": "Little Keebo",
  "description": "A pack for the schema tests.",
  "tags": [
    "support"
  ],
  "categories": [
    "Replies",
    "Notes"
  ],
  "role": "Support & Success",
  "phrasebook": "community.support",
  "language": "en-GB",
  "remember": true,
  "templates": [
    {
      "id": "1b0d7c2e-5a4f-4c3b-9e8d-7f6a5b4c3d2e",
      "trigger": "addr",
      "title": "My address",
      "kind": "fact",
      "text": "${me.address}",
      "when": "Someone asks where to send something",
      "suggest": false,
      "updated": "2026-10-12T09:30:00Z"
    },
    {
      "id": "2c1e8d3f-6b5a-4d4c-8f9e-8a7b6c5d4e3f",
      "trigger": "need-info",
      "title": "Ask for details",
      "kind": "reply",
      "category": "Replies",
      "when": "A customer reports a problem without enough detail",
      "text": "Hi ${1:there},\n\nThanks for getting in touch. ${2:Could you tell me your order number?}${3: I can see it was placed on ${4:date}.}\n\nWhich ${5|steps,screens,errors|} did you see?\n\n${me.name}",
      "blanks": {
        "1": {
          "hint": "the customer's first name"
        },
        "2": {
          "type": "paragraph"
        },
        "3": {
          "type": "optional",
          "on": false
        },
        "4": {
          "type": "date",
          "format": "EEEE d MMMM",
          "remember": false
        },
        "5": {
          "type": "many"
        }
      },
      "remember": false,
      "adapt": true,
      "locales": {
        "de": "Hallo ${1:zusammen},\n\ndanke für Ihre Nachricht.\n\n${me.name}",
        "en-US": "Hi ${1:there},\n\nThanks for reaching out."
      }
    },
    {
      "id": "3d2f9e4a-7c6b-4e5d-9a0f-9b8c7d6e5f4a",
      "trigger": "summarise",
      "title": "Summarise",
      "kind": "prompt",
      "text": "Summarise this in ${1|three,five|} bullet points for ${2:a busy reader}:\n\n${selection}${clipboard}"
    },
    {
      "id": "4e3a0f5b-8d7c-4f6e-8b1a-0c9d8e7f6a5b",
      "trigger": "great-work",
      "title": "Great work",
      "kind": "comment",
      "category": "Notes",
      "text": "Great work on ${1:this}.",
      "variants": [
        "Really strong work on ${1:this}.",
        "${1:This} was excellent."
      ]
    },
    {
      "id": "5f4b1a6c-9e8d-4a7f-9c2b-1d0e9f8a7b6c",
      "trigger": "count",
      "kind": "document",
      "text": "Items: ${1:3}\nScreen: ${screen}",
      "blanks": {
        "1": {
          "type": "number"
        }
      }
    }
  ]
}

The schema

The format as JSON Schema is at /schema/template-pack.schema.json, the address its $id names, for your editor and your checks. The packs the app must read and the ones it must refuse are in template-pack.fixtures.json.