Skip to main content
Version: Current

Template System

This page documents Scribe Animator's current template v1 data contract for validated imports and supported template workflows. Use this reference together with the current validator output; do not invent unsupported fields because a JSON example looks similar.

Templates package reusable animation data at three scopes:

TypeScopeTypical use
sceneOne complete sceneTitle cards, explainers, lesson scenes, and conclusions
blockA reusable object group, optionally with local timeline dataCallouts, icon-label groups, diagrams, and repeated content
projectMultiple ordered scenes plus project settingsCourses, campaigns, or complete video starting points

Current visual orientation

Scribe Animator template library with search, filters, real preview cards, and the Scene Manager
Metadata makes a template discoverable; payload data determines what is applied. Validate both in the real editor.
Screenshot callouts
  1. Search
    A clear name, description, and tags make a template discoverable.
  2. Type filter
    The card category must agree with meta.type and the payload shape.
  3. Aspect-ratio filter
    meta.aspectRatio controls where a compatible template appears.
  4. Preview cards
    Inspect preview quality, type, source, metadata, and intended scope before applying.
  5. Applied project state
    After apply, confirm scene count, duration, object count, active scene, timeline, and playback.
Current constants

Template v1 uses schemaVersion: 1 and meta.timingSemantics: "scene-local-v1". For the end-to-end authoring workflow, see Author reusable templates. For generated input, see Create and import AI JSON.

Envelope

Every template has metadata, a payload whose shape agrees with meta.type, optional asset requirements, and optional authoring metadata.

interface TemplateEnvelopeV1 {
schemaVersion: 1;
meta: TemplateMetaV1;
payload: SceneDTO | BlockDTO | ProjectDTO;
requiredAssets?: AssetRef[];
authoring?: TemplateAuthoringV1;
}
FieldRequiredMeaning
schemaVersionYesMust equal the current value 1
metaYesSearchable identity, type, timing semantics, tags, preview, and catalog fields
payloadYesA SceneDTO, BlockDTO, or ProjectDTO matching meta.type
requiredAssetsNoAssets the host must resolve before or during apply
authoringNoValidated editable-slot and role metadata used by authoring-aware flows

Metadata

FieldTypeRequiredNotes
idstringYesMust be non-empty; a stable lowercase identifier or UUID is recommended
typeproject, scene, or blockYesSelects the expected payload validator and apply behavior
namestringYesHuman-readable catalog name; current validation limits it to 100 characters
descriptionstringNoExplain content, audience, and intended use
timingSemanticsscene-local-v1Operationally requiredCurrent migration and builtin validation require this exact value
tagsstring arrayYesGeneral search keywords
createdAtISO 8601 stringYesCreation timestamp
updatedAtISO 8601 stringNoLast update timestamp
previewobjectNoOne of path, blobKey, or a small dataUrl, as supported by the store
aspectRatiostringNoCommon values are 16:9, 9:16, and 1:1; the type permits explicit custom strings
durationMsnumberNoSearch/display duration in milliseconds
authorstringNoCreator attribution
packIdstringNoGroups builtin templates into a pack
useCaseTagscontrolled string arrayNoAudience or workflow categories
formatTagscontrolled string arrayNoLayout or communication pattern
styleTagscontrolled string arrayNoVisual style categories

Controlled tag values

CategoryCurrent values
Use caseeducation, coaching, business, marketing, storytelling, social, shorts
Formattitle, agenda, definition, steps, comparison, timeline, flowchart, stats, quote, outro, cta, intro, bullet-list, callout
Styleclean-sketch, chalk, blueprint, minimal, colorful, professional

General tags can add search terms, but controlled categories should use their declared values so filters remain predictable.

Payload types

Scene payload

A SceneDTO describes one self-contained scene.

FieldRequiredPurpose
width, heightYesCanvas dimensions
durationMsYesScene duration in milliseconds
objectsYesPortable scene objects
name, tags, goal, notesNoAuthor-facing scene metadata
thumbnailLabel, thumbnailColorNoLegacy/metadata hints; do not assume every current UI exposes direct editing
transitionNoTransition into or out of the scene as defined by the timeline domain
cameraTransitionNoScene camera-transition settings
drawOverridesNoScene-level hand-draw overrides
backgroundNoSolid, gradient, image, or preset background
timelineNoTracks, keys, draw steps, camera, and audio

Use a scene template when its object positions should be interpreted against the scene's own dimensions and background.

Block payload

A BlockDTO contains objects, an optional placement anchor, and an optional timeline snippet. The anchor gives the host a reference point when inserting the group into an existing scene. All object, track, key, and target IDs must remain internally consistent; apply remaps them to avoid collisions.

Use a block for content that should be inserted into an existing scene. Preview it at multiple insertion positions and with existing nearby objects.

Project payload

A ProjectDTO contains:

FieldRequiredPurpose
nameYesNew project name
width, heightYesProject canvas dimensions
fpsYesProject frame rate
scenesYesOrdered ProjectSceneDTO entries
stylePresetsNoOptional typography, hand, background, and stroke-material preset IDs

Each project scene extends SceneDTO with a template-local sceneId and numeric order. Validate unique IDs, deterministic ordering, per-scene duration, transitions, and audio across the entire project.

Object DTO

interface ObjectDTO {
id: string;
type: ObjectDTOType;
x: number;
y: number;
width?: number;
height?: number;
rotation?: number;
props: Record<string, unknown>;
connector?: SmartConnectorMetadata;
locked?: boolean;
visible?: boolean;
zIndex?: number;
styleRefs?: {
typographyId?: string;
handPresetId?: string;
};
animationStart?: number;
animationDuration?: number;
timing?: SceneObjectVisibleRangeTiming;
animationType?:
| 'fadeIn'
| 'slideIn'
| 'scaleIn'
| 'drawIn'
| 'pathFollow'
| 'typewriter'
| 'none';
animationEasing?: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
}

id, x, y, and all timing values must be finite and valid for the target scene. Animation start and duration use milliseconds in template v1; the runtime converts where its internal representation differs.

Object types

TypeIntended contentCommon props or companion data
textEditable texttext, fontSize, fontFamily, fill, fontWeight
svgSVG assetsrc, fill, stroke, strokeWidth
imageRaster imagesrc, opacity, borderRadius
shapeBasic shapeshapeType, fill, stroke, cornerRadius
groupNested object groupchildren or the current group representation
drawingHand drawingpoints, stroke, strokeWidth
videoEmbedEmbedded videovideoUrl, autoplay, muted
svgPathPath geometryd, stroke, strokeWidth, fill
smartLineEditable connector without an arrowheadconnector metadata and style props
smartArrowEditable directional connectorconnector metadata and style props

For relationship diagrams, prefer smartLine and smartArrow rather than an inline SVG imitation. They remain editable and preserve connector behavior.

See AI JSON: Smart Lines, Smart Arrows & Connectors for the exact relationship between props.smartLine, top-level connector, drawable props.paths, anchors, and reveal-only drawIn behavior. Portable ObjectDTO uses props; the .scribe runtime field properties is not a drop-in replacement.

Simple animation settings

ValueMeaningLimitation
fadeInOpacity revealVerify overlap and final opacity
slideInPositional entranceVerify direction in the actual host
scaleInScale entranceVerify the transform origin
drawInPath/drawing revealRequires compatible vector geometry
pathFollowMovement along a pathRequires valid path and target references
typewriterProgressive text revealRequires compatible text behavior
noneNo simple entranceTimeline tracks may still animate the object

For richer animation, store first-class timeline tracks and keys rather than trying to encode unrelated behavior in props.

Drawable object props may optionally include strokeMaterial with one of solid, marker, chalk, pencil, crayon, dry-marker, ink-brush, or highlighter. Omitting it preserves the compatibility Solid renderer. Keep this separate from hand/tool preset IDs.

Scene background.type: "preset" supports canonical presetId values whiteboard, blackboard-dark, blackboard-green, glassboard, paper, kraft-paper, blueprint, and custom. Legacy blackboard, greenboard, chalkboard-dark, and chalkboard-green values are accepted on import and normalized by the runtime.

Timeline snippet

interface TimelineSnippetDTO {
tracks?: TemplateTimelineTrackDTO[];
keys?: TemplateTimelineKeyDTO[];
drawSteps?: DrawStepDTO[];
cameraMode?: 'static' | 'track' | 'follow-hand' | 'follow-object';
cameraFollowTargetId?: string | null;
camera?: CameraKeyframeDTO[];
audio?: AudioClipDTO[];
}

Tracks and keys

StructureRequired identifiersImportant fields
TemplateTimelineTrackDTOid, ownerIdbinding, type, label/category/order, lock/visibility, bounds, defaults, easing, and metadata
TemplateTimelineKeyDTOid, trackIdtime, numeric value, interpolation, easing, tangent mode, tangents, group, and metadata

Apply must remap track IDs, key IDs, object owners, and any target references as one graph. A key that points to a missing track or a track that points to a missing object is invalid.

TemplateTimelineKeyDTO.time, track start/duration fields, and scene timing are milliseconds. Validate that keys fall within the intended scene duration.

Draw steps

FieldPurpose
objectIdTemplate-local target object
startMs, durationMsDraw timing
from, toOptional reveal range
targetPathIdOptional path within a multi-path object
strokeColorOptional draw color override
strokeMaterialOptional Solid, Marker, Chalk, Pencil, Crayon, Dry Marker, Ink Brush, or Highlighter override
overridesHand-draw overrides
cameraDraw-step camera behavior
easingLegacy v1 field; current runtime DrawStep apply ignores it

Only target supported drawable objects and paths. Validate duration, range, camera references, and object existence before apply.

Camera

Camera mode can be static, track, follow-hand, or follow-object. cameraFollowTargetId is a template-local object ID and must be remapped. Each camera keyframe contains timeMs, x, y, zoom, and optional easing. Reject invalid zoom, non-finite positions, out-of-range time, and missing follow targets.

Audio

Each AudioClipDTO provides an assetRef, startMs, durationMs, and optional volume. Resolve the asset before playback, constrain volume to the runtime's supported range, and verify that scene-local clips do not unexpectedly overlap project audio after apply.

Asset references

type AssetRefType = 'builtin' | 'imported' | 'url';

interface AssetRef {
type: AssetRefType;
assetId?: string;
packId?: string;
filename?: string;
url?: string;
mime?: string;
}
TypeRequired identityResolution behaviorPortability concern
builtinpackId and assetIdResolve through an installed builtin packThe destination must have the compatible pack
importedfilename or host-managed referenceMatch or re-import the original project assetA filename alone does not embed the binary
urlurlFetch through the host's approved resolverCORS, availability, privacy, licensing, and URL expiry can break reuse

Missing assets must produce visible warnings or placeholders; they must not silently become unrelated content. Do not place credentials, signed secrets, private URLs, or personal data in a template. Prefer packaged or approved builtin assets for deterministic offline behavior.

Template stores

The store contract keeps catalog access separate from template application:

interface TemplateStore {
list(query?: TemplateQuery): Promise<TemplateMetaV1[]>;
get(id: string): Promise<TemplateEnvelopeV1 | null>;
save(template: TemplateEnvelopeV1): Promise<void>;
remove(id: string): Promise<void>;
}
interface TemplateQuery {
type?: TemplateType;
tags?: string[];
useCaseTags?: TemplateUseCaseTag[];
formatTags?: TemplateFormatTag[];
styleTags?: TemplateStyleTag[];
aspectRatio?: TemplateAspectRatio;
search?: string;
packId?: string;
limit?: number;
offset?: number;
}
StoreTypical sourcePersistenceNotes
User storeBrowser-managed user templatesIndexedDB or host adapterSubject to quota and browser-profile isolation
Builtin storeStatic manifest, JSON, and preview filesApplication assetsVersioned with the application
Cloud storeHost integrationRemote serviceFuture or build-dependent; never required by the schema itself
Composite storeDelegates to available storesDepends on child storesPresents one catalog while preserving source identity

Store implementations must validate before saving or returning apply-ready data. Multiple stores can contain the same human-readable name, so IDs and source badges matter.

Apply pipeline

Applying a template is a state-changing operation:

  1. Fetch the envelope from the selected store or validated import.
  2. Check schema version, timing semantics, metadata, payload/type agreement, object IDs, authoring slots, assets, camera references, draw steps, scene capabilities, and target-specific restrictions.
  3. Generate fresh IDs for scenes, objects, tracks, keys, and other entities.
  4. Rewrite every internal reference using the same ID map.
  5. Resolve builtin, imported, URL, and host-provided assets. Record warnings and placeholders for anything unavailable.
  6. Convert the payload into current runtime project and scene state.
  7. Apply it through the host's supported scene, block, or project command.
  8. Update selection, active scene, timeline, duration, and preview state.
  9. Verify undo/redo, save/reload, playback, export, and Mobile Lite behavior where the template claims support.

Apply modes

Template typeSupported intentState effect
SceneReplace the current scene or use an explicitly supported import actionUses scene dimensions, background, objects, and scene-local timing
Scene mergeHost-dependentCurrent paths can warn or fall back; it is not a blanket v1 compatibility guarantee
BlockInsert at a host-provided point or anchorAdds remapped objects and compatible local timing to the current scene
ProjectCreate or replace project state through an explicit project workflowApplies dimensions, fps, ordered scenes, and optional style presets
Save before apply

Project and scene apply can replace current state. Save the existing project and keep an undo or package recovery path before applying untrusted or experimental templates.

Save-as-template availability

A general Save as Template dialog is not currently exposed in the active main editor UI. Therefore:

  • There is no current end-user screenshot or supported menu path to document.
  • Do not tell users to find a Save as Template dialog.
  • Do not fabricate dialog controls, preview upload, or project-save behavior.
  • Do not depend on undocumented dialog controls or project-save behavior.

Built-in templates shipped with Scribe are maintained internally. External authors should create a valid envelope, validate it, and use a supported import or template-distribution workflow rather than depending on Scribe's repository layout.

The authentic gallery capture at the top of this page shows the current catalog experience.

ControlData it usesWhat to verify
SearchName, description, and tagsExpected keywords find the card without exposing internal IDs
Type filtermeta.typeCard, payload, and apply action agree
Aspect filtermeta.aspectRatioThe template fits the intended canvas
Tag filtersControlled and general tagsCategories are accurate rather than merely popular
Source badge/filterStore identityUsers can distinguish builtin and user content
Previewmeta.previewImage is legible, representative, and not misleading
ApplyEnvelope and host apply commandResult matches preview and remains editable

Do not use a placeholder preview for a published builtin template. A preview must show the actual final template, not a fabricated dialog or unrelated canvas.

Validation rules

Envelope and metadata

RuleFailure
schemaVersion === 1Reject unsupported versions; do not guess a migration
meta.timingSemantics === "scene-local-v1"Reject or migrate through the explicit supported path
Non-empty meta.id and meta.nameReject anonymous entries
meta.type is scene, block, or projectReject unknown payload types
meta.name is within the current length limitReport a field-level error
meta.tags is an array of stringsReject malformed catalog data
meta.createdAt is valid ISO 8601Reject invalid timestamp metadata
Payload shape agrees with meta.typeReject before any project mutation

Objects and references

RuleWhy
Object IDs are non-empty and unique within their scopePrevent ambiguous remapping
x, y, dimensions, rotation, and timing are finitePrevent corrupt layout or playback
Optional width and height, when supplied, are positive where requiredPrevent invalid bounds
Object type is supported and props is an objectPreserve renderer contracts
Track owners, keys, draw steps, camera targets, connectors, and authoring slots resolvePrevent dangling references
Asset references match their declared typeGive the resolver enough information
Target-specific checks passPrevent Desktop-only content from silently breaking Mobile Lite

Type guards

isSceneDTO(payload);
isBlockDTO(payload);
isProjectDTO(payload);

isSceneTemplate(envelope);
isBlockTemplate(envelope);
isProjectTemplate(envelope);

Type guards narrow a value after basic checks; they do not replace the full draft validator, asset resolution, capability checks, or visual review.

Authoring checklist

  1. Choose the smallest correct scope: block, scene, or project.
  2. Create stable template-local IDs and keep all references internal.
  3. Use scene-local-v1 timing in milliseconds.
  4. Prefer builtin assets; list every required asset explicitly.
  5. Add concise metadata and controlled tags that match the content.
  6. Use relative block positioning and a meaningful anchor.
  7. Provide a real preview generated from the finished template.
  8. Validate before adding the manifest entry or importing.
  9. Apply to a disposable saved project and inspect warnings.
  10. Test selection, editing, timeline, camera, audio, playback, undo/redo, persistence, reload, export, and claimed platform targets.
  11. Confirm that source JSON and previews contain no secrets, private URLs, unlicensed media, or personal data.

Troubleshooting

SymptomCheckRecovery
Template does not appearID, manifest entry, store source, filters, tags, and preview pathRefresh the catalog after fixing source data
Type filter is wrongmeta.type and payload guardCorrect both; do not change only the card metadata
Apply is rejectedSchema version, timing semantics, validator report, and target profileFix reported fields and revalidate
Missing assetsrequiredAssets, pack installation, filename match, URL/CORS, and resolver warningsPackage, re-import, or replace the asset through an approved resolver
Timeline is missingExported snippet, track/key graph, owner remapping, and scene durationRepair references and reapply to a clean scene
Draw step is missingDrawable target, objectId, targetPathId, and timingCorrect the target and validate again
Camera follow failsMode and remapped follow targetUse an existing compatible object or a static/track camera
Block is misplacedAnchor, local coordinates, target canvas, and insertion pointNormalize relative positioning and retest
Scene is croppedTemplate dimensions and target aspect ratioUse a matching scene or intentionally adapt layout
Save to user store failsBrowser storage permission and quotaExport source JSON safely, free space, and retry
Preview is blank or stalePreview path/blob/data URL and cacheRegenerate from the final template and update metadata
Mobile Lite warns or rejectsUnsupported audio slots, scene capabilities, object types, or layoutSimplify the template or declare Desktop-only support

For source-level diagnosis:

const templates = await templateStore.list();
console.log('Available templates:', templates.length);

console.log('Schema version:', envelope.schemaVersion);
console.log('Template type:', envelope.meta.type);
console.log('Required assets:', envelope.requiredAssets?.length);

Avoid logging full payloads in production because object text, URLs, and metadata can contain sensitive project information.

Compatibility and non-goals

  • Template v1 is internal and experimental; public compatibility guarantees are not finalized.
  • Unknown schema versions must not be accepted silently.
  • Cloud storage, marketplace publishing, collaborative editing, and unrestricted external script or plugin execution are not provided by this schema.
  • A valid template is data, not executable code.
  • URL assets remain subject to host permissions, CORS, availability, and security policy.
  • SaveTemplateDialog is currently disabled/unwired and is not an end-user workflow.

The complete success criterion is not “JSON parsed.” A template is ready only when it is discoverable, accurately previewed, safely applied, editable, playable, recoverable, persistable, and exportable in every environment it claims to support.