This page defines the current instructions for producing a Repertoire workspace import. Follow it when a user asks you to create or modify a Repertoire JSON file.
If these instructions conflict with an older prompt or example, follow this page. Repertoire's importer remains authoritative and may reject a structurally invalid file.
Safety and task boundary
- Work only with patient-independent, clinician-reviewed template content.
- Do not request, include, infer, or retain PHI, patient notes, identifiers, screenshots, encounter details, or patient-specific facts.
- Do not invent clinical recommendations, local policy, defaults, or patient facts.
- Preserve the user's approved wording unless the user explicitly asks for editorial suggestions.
- Keep editorial suggestions separate from import JSON until the user explicitly approves them.
- Return one complete JSON object only when asked for an import file. Do not wrap it in markdown fences or add commentary.
Repertoire is a clinical template-management workspace. It is not an EMR or clinical decision-support system.
Choose one workspace mode
Modify an existing export
Use the attached current export as the base. Preserve every unrelated object and value. Add or replace only content the user explicitly approved.
In particular, preserve unrelated entries in customTemplates, templates,
repertoire, startingNotes, notepadEntries, reusableContent,
recentReusableContentIds, and reviewRecords, along with
activeStartingNoteId and startingDocument. Keep preferences structurally
valid and unchanged. Do not create or restore an active patient note.
The import operation replaces reusable collections; it does not merge the returned file with browser storage. Omitting existing Building Blocks from the returned JSON can remove those Building Blocks after confirmation.
Start fresh
Create the complete minimal version 2 object shown below. Put every new template
in customTemplates. For a coherent fresh workspace snapshot, place the same
template objects in templates. Use empty collections for repertoire,
startingNotes, notepadEntries, reusableContent,
recentReusableContentIds, and reviewRecords unless the user explicitly
supplied approved Building Blocks or review state for them.
Import behavior by field
| Field | Required | Behavior on import |
|---|---|---|
format | Yes | Must equal repertoire-workspace. |
version | Yes | Must equal the number 2. |
exportedAt | Yes | Use a current ISO 8601 timestamp. |
templates | Yes | Validated for format compatibility but not applied to browser storage. In a normal export it is the available-template snapshot. |
customTemplates | Yes | Replaces all custom templates and built-in overrides. This is the authoritative imported template collection. |
buildingBlocks | No | Complete resolved Building Block snapshot for inspection. Current exports include it; older version 2 files may omit it. It is validated but not written to personal browser storage. |
repertoire | Yes | Replaces reusable legacy repertoire content. Preserve an attached export's value exactly; use empty collections for a fresh workspace. |
startingNotes | Yes | Replaces all named starting-note presets. |
notepadEntries | No | Replaces all saved notepad entries. If omitted, it becomes an empty array. Include it explicitly. |
reusableContent | No | Replaces personal and organization-labeled Building Blocks. If omitted, it becomes an empty array. Built-in items continue to ship with the application. Include it explicitly. |
recentReusableContentIds | No | Replaces the recent Building Blocks list. On application import, IDs are reconciled against both the selected starting library and reusableContent; unknown IDs are discarded. If omitted, it becomes an empty array. |
reviewRecords | No | Replaces Library Review decisions for templates and Building Blocks. If omitted, it becomes an empty array. Include it explicitly when preserving an export. |
activeStartingNoteId | Yes | Must equal built-in-default or the ID of an object in startingNotes. |
startingDocument | Yes | Replaces the reusable starting document after supported HTML is sanitized. |
preferences | Yes | Must be structurally valid, but its values are not applied. Current browser preferences remain unchanged. |
currentNote | No | Legacy field accepted within size limits but ignored. Omit it. |
The user's current draft and active template controls are never imported. Repertoire shows a replacement summary before confirmation and offers a same-tab undo after a confirmed import.
Minimal fresh workspace
Replace the example wording with content the user has explicitly reviewed. Do not treat the example as clinical content.
{
"format": "repertoire-workspace",
"version": 2,
"exportedAt": "2026-08-22T12:00:00.000Z",
"templates": [
{
"id": "example-imported-template",
"title": "Example Imported Template",
"category": "Other",
"triggers": {
"primary": "Example Imported Template",
"aliases": ["example imported phrase"]
},
"sections": [
{
"id": "reviewed-narrative",
"kind": "text",
"label": "Narrative",
"text": "Reviewed patient-independent wording supplied by the user."
},
{
"id": "reviewed-options",
"kind": "optionGroup",
"label": "Options",
"options": [
{"id": "reviewed-option-one", "text": "First reviewed option."},
{"id": "reviewed-option-two", "text": "Second reviewed option."}
],
"selection": {
"defaultSelected": [],
"mode": "multiSelect",
"control": "toggle",
"outputMode": "separate"
}
}
]
}
],
"customTemplates": [
{
"id": "example-imported-template",
"title": "Example Imported Template",
"category": "Other",
"triggers": {
"primary": "Example Imported Template",
"aliases": ["example imported phrase"]
},
"sections": [
{
"id": "reviewed-narrative",
"kind": "text",
"label": "Narrative",
"text": "Reviewed patient-independent wording supplied by the user."
},
{
"id": "reviewed-options",
"kind": "optionGroup",
"label": "Options",
"options": [
{"id": "reviewed-option-one", "text": "First reviewed option."},
{"id": "reviewed-option-two", "text": "Second reviewed option."}
],
"selection": {
"defaultSelected": [],
"mode": "multiSelect",
"control": "toggle",
"outputMode": "separate"
}
}
]
}
],
"repertoire": {
"moves": [],
"blocks": [],
"selections": [],
"lines": []
},
"startingNotes": [],
"notepadEntries": [],
"reusableContent": [],
"recentReusableContentIds": [],
"reviewRecords": [],
"activeStartingNoteId": "built-in-default",
"startingDocument": "<h2>Assessment / Plan</h2><p></p>",
"preferences": {
"autoCopy": false,
"includeTemplateNames": true,
"problemSpacing": 1,
"includeOneLiner": true,
"largerWorkspace": false,
"favoriteTemplateIds": [],
"showInferenceDetails": true,
"skipNewPatientConfirmation": false,
"onboardingComplete": true,
"theme": "sage"
}
}
Template object
Each template requires:
{
"id": "concise-stable-id",
"title": "Precise Template Title",
"category": "Other",
"triggers": {
"primary": "Precise Template Title",
"aliases": ["specific recognition phrase"]
},
"sections": []
}
id,title, andcategoryare strings of at most 500 characters.idandtitlemust not be empty. Use stable lowercase-hyphenated IDs even though the importer only requires nonempty strings.triggersis optional. Itsprimarystring andaliasesarray are optional.- A template may have up to 100 aliases. Each must be at most 500 characters.
- Prefer a precise title as
primary. Use aliases only for specific phrases a user would intentionally type on a line by itself. - A template may have up to 50 sections.
- An optional
remindermay containtextand animportanceofnormal,medium, orhigh. Reminders never enter generated or copied clinical text.
Within each of templates and customTemplates, template IDs must be unique. It is valid and expected for the same custom template ID to appear once in each array.
Starter section types
For ordinary imported libraries, use only text and optionGroup unless modifying an attached export that already contains other valid section kinds.
Stable text
{
"id": "stable-plan",
"kind": "text",
"label": "Plan",
"text": "Patient-independent wording approved by the user."
}
Visible option group
{
"id": "plan-options",
"kind": "optionGroup",
"label": "Plan options",
"options": [
{"id": "option-one", "text": "First approved option.", "aliases": ["first option"]},
{"id": "option-two", "text": "Second approved option."}
],
"selection": {
"defaultSelected": [],
"mode": "multiSelect",
"control": "toggle",
"outputMode": "separate"
}
}
- Every section requires a nonempty
id, akind, and a stringlabel. - Section IDs must be unique within their template.
- Each option requires string
idandtextvalues. Option IDs must be unique within their section. An option may also contain up to 100 explicit recognitionaliases, each at most 500 characters. - A section may contain up to 100 options.
- Every ID in
defaultSelectedmust refer to an option in that same section. - Use an empty
defaultSelectedarray unless the user explicitly approved a default. - A selectable section may use
"required": trueonly when the user explicitly asks for a pre-copy warning. Required fields are opt-in and should be used sparingly. They produce a warning, not a clinical decision or automatic selection. - Allowed
kindvalues aretext,statement,optionGroup, andinlineChoice. - Allowed
selection.modevalues aretoggle,multiSelect, andsingleSelect. - Allowed
selection.controlvalues aretoggle,serviceButtons, andinlineChoice. - Allowed
selection.outputModevalues areseparate,joined,natural-list, andnatural-list-or. - Preserve valid advanced fields from an attached export. Do not add
richText, inline choices, reminders, prefixes, suffixes, or advanced kinds unless the user requested them and their structure is known.
Advanced Templates may also contain a variables array. Each variable requires a stable id, a user-facing label, and an options array; it may allow custom wording or reuse another variable's options. Add "required": true only at the user's request when an empty visible value should produce a pre-copy warning. Never populate a required value by inference.
Recognition rules
Repertoire recognizes a template by its title, primary trigger, or aliases after trimming, lowercasing, collapsing whitespace, and ignoring trailing punctuation.
- Recognition phrases must not resolve to more than one template across the built-in library and imported custom templates.
- Aliases must contain at least three characters after normalization.
- Avoid broad aliases, abbreviations, single words, or phrases likely to occur unintentionally.
- Keep aliases distinct from the template's normalized title and from one another. Duplicate aliases within a template may be removed during normalization.
- If Repertoire reports a recognition conflict, change the conflicting recognition phrase without changing approved clinical wording.
- Choice aliases are scoped to a resolved Template or Building Block. Keep them precise and distinct from every other choice on the same object. Repertoire Line may also safely combine an owner name with a maintained choice; it suppresses generated combinations that collide with explicit recognition.
Starting notes and notepad entries
A starting-note preset has this shape:
{
"id": "starting-note:stable-id",
"name": "Approved preset name",
"document": "<h2>Assessment / Plan</h2><p></p>",
"createdAt": "2026-08-22T12:00:00.000Z",
"updatedAt": "2026-08-22T12:00:00.000Z"
}
A notepad entry has this shape:
{
"id": "notepad:stable-id",
"text": "Patient-independent reusable idea.",
"createdAt": "2026-08-22T12:00:00.000Z",
"updatedAt": "2026-08-22T12:00:00.000Z"
}
A contextual Library Review note adds a reviewContext; a resolved note also
adds resolvedAt:
{
"id": "notepad:review-stable-id",
"text": "Patient-independent wording to revisit.",
"createdAt": "2026-08-22T12:00:00.000Z",
"updatedAt": "2026-08-22T12:00:00.000Z",
"reviewContext": {
"itemType": "template",
"itemId": "example-imported-template",
"itemTitle": "Example Imported Template"
},
"resolvedAt": "2026-08-22T13:00:00.000Z"
}
IDs must be nonempty and unique within their collection. Dates must be valid date strings; use ISO 8601. A workspace can contain up to 100 starting notes and 500 notepad entries. Supported reusable HTML is sanitized during import.
Building Blocks and Library Review records
A Building Block contains one maintained piece of shared wording or set of choices:
{
"id": "reusable:example-follow-up",
"name": "Example follow-up",
"aliases": ["follow-up plan"],
"kind": "statement",
"scope": "personal",
"collection": "Follow-up",
"tags": ["follow-up"],
"favorite": false,
"version": 1,
"createdAt": "2026-08-22T12:00:00.000Z",
"updatedAt": "2026-08-22T12:00:00.000Z",
"text": "Patient-independent wording approved by the user.",
"richText": "<p>Patient-independent <strong>wording</strong> approved by the user.</p>"
}
Allowed kind values are statement, narrative, inlineChoice, optionSet,
and dynamic. Allowed scope values are builtIn, personal, and
organization; new imported user content should normally be personal or
organization. Inline choices may use prefix, prefixRichText, suffix,
suffixRichText, options, and defaultSelected; option sets may use those
same fields plus selectionMode (singleSelect or multiSelect) and
outputMode (separate, joined, natural-list, or natural-list-or).
Statements and narrative blocks may include optional sanitized
richText using the same supported formatting as template sections: p, br,
strong, em, s, and code. Choice objects may use the same optional
richText field and optional recognition aliases. Keep each rich field’s plain-text counterpart synchronized.
Dynamic choices may use variables, structured choice output, and
outputPlacement. Create these through the Building Block editor so fill-in
IDs, visibility rules, and generated sentences stay synchronized.
Repertoire also ships built-in Dynamic variable Building Blocks for local
date values and transparent date arithmetic. They resolve from the device’s
local date when a note is inserted and then remain a snapshot in that note.
These computed definitions are intentionally not user-authorable or editable;
users may link them into custom Templates through Browse Building Blocks.
Do not fabricate dynamicText values or computed output objects in an import.
aliases is an optional array of up to 100 recognition phrases. Normalize it
using the same specificity and collision rules as template aliases; it must not
collide with another Building Block name or alias or a template recognition
phrase.
defaultSelected has a user-visible behavioral effect: an inline choice or a
single-select option set must have exactly one valid default, and a multi-select
option set must have at least one valid default, before typing its exact name or
alias on a standalone note line can insert it automatically. Statements and
narratives are eligible without a default.
Templates retain recognition priority, and duplicate reusable recognition
phrases do not auto-insert. Repertoire Line may resolve these phrases from a Repertoire Line
inside a sentence. An explicit maintained choice makes choice content
deterministic even when it has no default, and replaces a saved default only
within its own selection group. Do not invent Building Blocks, aliases,
choices, or approved defaults.
Templates, Building Blocks, and individual choices may include an optional
recognition object. Set "exactOnly": true when spelling tolerance should
not apply to that item or its aliases. Choice-based Building Blocks may set
"generatedPermutations": false to disable automatically derived orderings
such as Spanish interpreter. Omit these fields to keep the normal conservative
resolver behavior.
The Repertoire Line also supports a deliberately small transparent shorthand
dictionary (mom/mother, dad/father, wk/week, wks/weeks, and
number words one through ten).
Semicolons separate segments, a colon connects an owner to its choices or an
open detail, and commas separate peers within the same segment. A leading
attached hyphen explicitly suppresses a maintained target, and <maintained choice> instead may update existing note content only when exactly one active
item can own the choice. # inserts exact user-authored text as a bullet on the
nearest preceding Template, or as a standalone bullet without one; ## inserts
a standalone plain line. Literal text ends at the next semicolon or line end and
is excluded from recognition and unresolved-wording learning. /p keeps the
source visible and replaces a prior preview from the edited line; /r finalizes
it. These rules never authorize inventing content or adding broad medical
synonyms.
A Building Block may optionally declare a repertoireCapture object with a
short label, a literal placeholder that already occurs in its text, prefix,
or suffix, an optional choiceFirst boolean, and an optional maxWords integer
from 1 through 10. Repertoire Line fills that one slot only when the owner,
maintained choice, and bounded adjacent value have exactly one interpretation.
For example, the built-in interpreter block accepts S: Susan, French Susan,
or Spanish interpreter: Susan 42 and emits Spanish interpreter: Susan,
French interpreter: Susan, or Spanish interpreter: Susan 42. Do not use
capture for unbounded narrative, patient identifiers, clinical findings, or any
value that should instead be a maintained choice.
A Template CanonicalVariable may optionally declare a repertoire object.
It requires type (bodySite, choice, duration, severity, or
shortText), bounded aliases, and a maintained outputPrefix; it may also
include outputSuffix, maxWords from 1 through 10,
allowUnlabeledChoice, legacy implicit, and emit.
Set emit to false only for a field whose captured value is consumed by
maintained Template wording rather than emitted as a standalone line. Implicit
capture is accepted only for backward-compatible imports and is ignored by the
resolver. allowUnlabeledChoice may be enabled only for a choice field; it
accepts an exact maintained choice without a label when ownership is unique.
Patterned and open values still require a label. Missing values emit nothing.
Captured values populate the
normal editable Template variable controls. Emitting fields are rendered only
through their declared prefix and suffix; field-only values remain silent
unless a separately selected maintained section consumes them. Never infer a
diagnosis, negative, medication action, disposition, or clinical conclusion
from these values.
A Library Review record has this shape:
{
"itemType": "template",
"itemId": "example-imported-template",
"decision": "approved",
"reviewedFingerprint": "content:example-fingerprint",
"reviewedAt": "2026-08-22T12:00:00.000Z"
}
itemType must be template or reusableContent; decision must be
approved or needsWork. The pair of itemType and itemId must be unique.
Fingerprints are generated by Repertoire from reviewable content. When creating
a fresh workspace, use an empty reviewRecords array instead of fabricating an
approval. When modifying an export, preserve existing review records unless the
user explicitly asks to remove them; do not change their fingerprints by hand.
Preferences
The following booleans are required even though imported preferences are not applied:
autoCopyincludeTemplateNamesshowInferenceDetailsskipNewPatientConfirmationonboardingComplete
Optional fields are:
problemSpacing: an integer from 0 through 20includeOneLiner: booleanrepertoireAutocomplete: boolean; autocomplete is off when this is omitted orfalselargerWorkspace: booleanfavoriteTemplateIds: an array of up to 1,000 stringstheme: one ofsage,ocean,iris,clay,ochre, ormidnight
When modifying an export, preserve its preferences. When starting fresh, use the values in the minimal example. Do not claim these values will overwrite the user's browser preferences.
Limits and validation
- The complete file must be no larger than 2 MB.
templatesmay contain up to 1,000 objects.customTemplatesmay contain up to 500 objects.reusableContentmay contain up to 1,000 objects.reviewRecordsmay contain up to 2,000 objects.recentReusableContentIdsmay contain up to 50 strings.- Short identifiers, names, labels, categories, aliases, and similar strings are limited to 500 characters.
- Template and option content fields are limited to 100,000 characters.
- Starting documents are limited to 500,000 characters.
- Repertoire validates collection shapes, unique IDs, option references, repertoire relationships, dates, allowed enum values, recognition conflicts, and risky aliases.
- Imported reusable HTML is sanitized.
For legacy repertoire content, preserve the complete attached value without modification. For a fresh workspace, use exactly:
{"moves": [], "blocks": [], "selections": [], "lines": []}
Do not synthesize legacy repertoire relationships merely to add templates.
Final preflight
Before returning the JSON:
- Confirm that the source contained no patient-specific information.
- Confirm that every clinical phrase and default was supplied or explicitly approved by the user.
- Confirm that the output is one complete object with no markdown fence or commentary.
- Confirm
format, numericversion, all required collections, the starting document, and required preference booleans are present. - Confirm all IDs are nonempty and unique in their required scope.
- Confirm every selected default refers to an option in its section.
- Confirm aliases are specific, contain at least three normalized characters, and do not create recognition conflicts.
- When modifying an export, compare collection counts and verify that unrelated templates, starting notes, notepad entries, Building Blocks, recent IDs, Library Review records, and legacy repertoire content remain present.
- Confirm the complete file is no larger than 2 MB.
If Repertoire returns a validation error, correct only the stated structural problem, preserve approved wording and unrelated base content, and return the complete JSON object again.