Skip to main content
Loom supports two schema construction modes:
  1. LLM Auto-Generation — The CM agent creates schema fields dynamically during build() (default)
  2. From Template — Select a preset template; Loom copies it as a new schema file ({name}_{YYYYMMDD}_{HHmmss}.json) and subsequent chats dynamically update it via the CM agent

Built-in Templates

Loom ships with two built-in templates: Run loom init to export them as editable JSON files:

Template Sources & Priority

Templates are loaded from three sources, with later sources overriding earlier ones: If two templates share the same name, the higher-priority source wins.

Template File Format

Templates use the same JSON format as schema files, with an optional _meta key:
The _meta.name field determines the template identifier. The file name can be anything ending in .json.

Using Templates

When you select a template (via CLI, API, or Web UI), Loom copies the template into the schemas directory as a new schema file named {template_name}_{YYYYMMDD}_{HHmmss}.json and binds the current session to it. Subsequent conversations dynamically update this schema via the CM agent — the template simply provides the starting structure.

Creating Custom Templates

Via Web UI

  1. Open the Build Schemas modal → switch to From Template mode
  2. Click + New Template to open the template editor
  3. Fill in the template name, description, and fields
  4. Click Save Template — the file is saved to ./templates/custom/

Via File

Place any .json file in ./templates/ (shared) or ./templates/custom/ (personal):

Via API

Save a custom template through the REST API:
Delete a custom template:

Via OpenClaw Slash Command

Create templates directly from the chat using the compact text format:
Format rules:
  • First line: template_name description (name allows letters, numbers, _, -)
  • Following lines: domain_name: field1 | description, field2 | description
  • Fields separated by ,, field name and description separated by |
Or use JSON format:
Delete a custom template:
Only custom templates can be deleted via the API or slash commands. Built-in and shared (user) templates are protected.

Template Resolution

Templates are resolved by name across all three sources. The resolution order (highest priority first):
  1. Custom templates in custom_templates_dir (./templates/custom/)
  2. User templates in templates_dir (./templates/)
  3. Built-in templates bundled with Loom
Use the API to view templates grouped by source: