Skip to main content
Templates are role-specific starting points for agents. They live in templates/ and get seeded into the gateway’s local git repo as template/<name> branches on first boot.

Template files

Key scripts in skills/hq/scripts/:

How provisioning works

When you create an agent, HQ forks the selected template branch into the agent’s personal branch, then patches identity fields (slug, name, emoji, channel).

Model resolution at provision time

The model field in agent.json is optional. At provision time, add-agent.sh resolves the agent’s model using this cascade:
  1. CLI argument — if the provision command payload includes model, use it
  2. Template’s agent.json — if the template specifies a model, use it
  3. Gateway default — the workspace default from Settings → Connections
  4. First connected model — detected from openclaw models status
After provisioning, you can change the model at any time from the agent detail page → Model section. Changes take effect on the next session without a gateway restart.
To create a custom template, copy templates/default/ to templates/your-role/, edit the identity files, add role-specific skills, and rebuild the templates index. See Agents → Writing a new template for the full walkthrough.