UsersTemplates

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.

Template Categories

The categories you author here are entity, document, and map, each with a different editing experience. Two further system categories, rule and skill, exist for AI rules and skills (see Template Categories).

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. A brand-new entity type also gets browse views (cards, list, table, gallery, board, calendar) generated automatically from its fields, so you do not need to author a layout; the field names and types decide which field is the card title, image, and badge.

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), _Templates/Standard/Documents/ (documents), and _Templates/Standard/Maps/ (maps). Your own templates can go in _Templates/Custom/.

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/Custom/Garden Map.md):

---
template_version: "2.0"
id: "garden_map"
entity_type: "map"
template_category: "map"
name: "Garden Map"
renderer: "image-overlay"
 
pin_types:
  - id: "plant_bed"
    label: "Plant Bed"
    icon: "Sprout"
    color: "#22c55e"
    entity_types: ["plant"]
 
default_layers:
  - id: "beds"
    name: "Plant Beds"
    color: "#22c55e"
 
---
 
# 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 template library (Settings > Templates) and in the + New dialog under the appropriate category. 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", "map", "rule", or "skill"
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: image-overlay, spatial-3d (core), tile-2d, geo-leaflet (cloud), or a plugin renderer. See Maps
pin_typesarrayAvailable pin types with icons and linked entity types
default_layersarrayLayers created when a new map is made from this template

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

Templates and packs are installed from the Templates tab of the StudioBrain Marketplace (/plugins/marketplace). Install writes the template into the current project and registers it as an entity type. This page does not describe a self-serve publishing flow; see Template Marketplace for how to browse, install, and how official and community templates are sourced.

See Also