User GuideTemplates

Templates

Templates are the foundation of StudioBrain’s type system. Every entity, document, and map is created from a template that defines its fields, structure, and behavior. Templates are markdown files with YAML frontmatter — no code changes required to create new types.

Three Template Categories

StudioBrain templates fall into three categories, each with a different editing experience.

Entity Templates

Entity templates define structured data types: characters, locations, items, creatures, plants, recipes, or any other object your project needs.

AspectDetails
Categoryentity
EditorField-by-field form based on frontmatter fields
StorageMarkdown file with YAML frontmatter
ExamplesCHARACTER_TEMPLATE.md, LOCATION_TEMPLATE.md, PLANT_TEMPLATE.md

Entity templates are the most common type. Each field in the YAML frontmatter becomes an editable field in the UI.

Document Templates

Document templates define structured long-form content: game design documents, story bibles, style guides, lore compendiums.

AspectDetails
Categorydocument
EditorRich text editor (TipTap) with section outline
StorageMarkdown file with YAML frontmatter + rich text body
ExamplesGDD_TEMPLATE.md, STORY_BIBLE_TEMPLATE.md, STYLE_GUIDE_TEMPLATE.md

Document templates use the markdown body as the primary content area. The frontmatter holds metadata (author, status, version) shown in the sidebar.

Map Templates

Map templates define spatial visualizations: world maps, floor plans, pinboards, garden layouts.

AspectDetails
Categorymap
EditorMap canvas with pins, lines, layers, and pan/zoom
StorageMarkdown file with YAML frontmatter (pins/layers in frontmatter)
ExamplesWORLD_MAP_TEMPLATE.md, FLOOR_PLAN_TEMPLATE.md

Map templates define pin types, default layers, and the rendering engine used by the map editor.

Creating Custom Templates

Step 1: Choose a Category

Decide whether your new type is an entity, document, or map based on its primary editing experience:

  • Users fill in structured fields —> Entity
  • Users write long-form text with sections —> Document
  • Users place items on a visual canvas —> Map

Step 2: Create the Template File

Templates live in _Templates/Standard/ (entities and documents) or _Templates/Maps/ (maps).

Entity template (_Templates/Standard/RECIPE_TEMPLATE.md):

---
template_version: "2.0"
id: "[snake_case_name]"
entity_type: "recipe"
template_category: "entity"
name: "[Recipe Name]"
description: "[Brief description]"
 
cuisine: "[Italian/Mexican/Japanese/etc.]"
difficulty: "medium"
prep_time_minutes: 30
cook_time_minutes: 45
servings: 4
 
ingredients:
  - name: "[Ingredient]"
    amount: "[Amount]"
    unit: "[cups/tbsp/oz]"
 
steps:
  - "[Step 1 instructions]"
  - "[Step 2 instructions]"
 
tags: []
primary_image: ""
---
 
# [Recipe Name]
 
## Description
 
[Describe the dish, its origin, and what makes it special.]
 
## Chef's Notes
 
[Tips, variations, and serving suggestions.]

Document template (_Templates/Standard/BRAND_GUIDE_TEMPLATE.md):

---
template_version: "2.0"
id: "brand_guide"
entity_type: "brand_guide"
template_category: "document"
name: "Brand Guide"
description: "Brand identity and usage guidelines"
icon: "Palette"
capabilities:
  - outline_view
  - export_pdf
  - rich_text
status: "draft"
---
 
# Brand Guide
 
## Brand Identity
[Describe the brand's core identity.]
 
## Logo Usage
[Logo files, clear space rules, acceptable backgrounds.]
 
## Color Palette
[Primary and secondary colors with hex codes.]

Map template (_Templates/Maps/GARDEN_MAP_TEMPLATE.md):

---
template_version: "2.0"
id: "garden_map"
entity_type: "map"
template_category: "map"
name: "Garden Map"
renderer: "canvas2d"
coordinate_system: "pixel"
 
pin_types:
  - id: "plant_bed"
    label: "Plant Bed"
    icon: "Sprout"
    color: "#22c55e"
    entity_types: ["plant"]
 
default_layers:
  - id: "beds"
    name: "Plant Beds"
    color: "#22c55e"
 
export_formats: ["png", "json"]
---
 
# Garden Map
[Plan your garden layout.]

Widget Configuration

Templates can specify which UI widget renders each field using the field_config section. For example, a character template can define specific color palettes for hair and eye color, or constrain a year field to a valid range.

For details on field_config syntax, see Template Authoring — field_config.

Step 3: Use the Template

After saving the template file, it appears in the + New dialog under the appropriate category tab. Create a new instance by selecting the template and entering a name.

Template Frontmatter Reference

Required Fields (All Categories)

FieldTypeDescription
template_versionstringSchema version, must be "2.0"
idstringUnique identifier (snake_case)
entity_typestringType name (lowercase, used in URLs and API)
template_categorystring"entity", "document", or "map"
namestringDisplay name

Optional Fields (All Categories)

FieldTypeDescription
descriptionstringBrief description shown in template picker
iconstringLucide icon name
primary_imagestringDefault image field
statusstringDefault status value
tagsarrayDefault tags

Document-Specific Fields

FieldTypeDescription
capabilitiesarrayEnabled features: outline_view, export_pdf, rich_text

Map-Specific Fields

FieldTypeDescription
rendererstringRenderer ID: canvas2d, svg, or a plugin renderer
coordinate_systemstringpixel (image-based) or geo (lat/lng)
pin_typesarrayAvailable pin types with icons and linked entity types
default_layersarrayLayers created when a new map is made from this template
export_formatsarrayAvailable export formats: png, svg, json

Field Types

Entity template frontmatter fields are automatically rendered as form inputs based on their YAML type:

YAML TypeRendered As
string (quoted)Text input
number (integer)Number input
boolean (true/false)Toggle switch
array (list - items)Multi-value input (add/remove items)
object (nested keys)Grouped fields
nullOptional field (empty by default)
Color object { name, hex }Color picker

Template Marketplace

Share your templates with the community through the StudioBrain Template Marketplace.

Publishing Requirements

RequirementDetails
template_versionMust be "2.0" or higher
descriptionNon-empty description
FieldsAt least 5 fields defined
No private referencesNo references to project-specific entity types
Valid categoryMust be entity, document, or map

How to Publish

  1. Go to Settings > Templates
  2. Select a template and click Publish to Marketplace
  3. Add a screenshot and detailed description
  4. Submit for review

Published templates appear in the Marketplace for other users to install.

Installing from Marketplace

  1. Go to Settings > Templates > Marketplace
  2. Browse or search for templates
  3. Click Install to add a template to your project
  4. New instances can be created from the installed template immediately

See Also