Skip to content

Templates

The template system is how Sonic turns a one-off build into a repeatable product. Build the design once, reuse it across every future client. Two skills do the work: sonic-templatize saves a template, sonic-instantiate applies it.

sonic-templatize - save the shell

After a successful build, when the design is worth reusing, run templatize. It captures the shell of the site:

  • The theme.
  • Page layouts and section blueprints.
  • Brand patterns.
  • The style guide.

It deliberately drops the actual content and any client-specific data. You keep the design system, not the client. The template is saved locally to ~/.sonic/sonic-templates/, and it can optionally be packaged as a .zip for sharing with a cohort or team.

Save the shell, keep the design, leave the client behind.

sonic-instantiate - apply to a new client

When a new client needs a site in a proven design, instantiate a saved template instead of building from zero. It:

  1. Takes a template from ~/.sonic/sonic-templates/.
  2. Substitutes the variables (brand name, city, phone, and similar).
  3. Creates the new client folder (honoring the one-folder-per-client rule).
  4. Pre-populates BRAND-BRIEF.md and STYLE-GUIDE.md with the template's brand patterns plus the client-specific values.

The output is a ready-to-build project. The founder then runs it through sonic-build to deploy. You skip brand and design discovery because the template already carries a proven version of both.

The reuse loop

Build a great site
   ↓  sonic-templatize
Save its shell as a template  →  ~/.sonic/sonic-templates/
   ↓  sonic-instantiate (per new client)
Pre-filled, ready-to-build project
   ↓  sonic-build
A new on-brand site, fast

This is the leverage in the whole system. The first build in a niche is the expensive one. Every build after it instantiates a template and ships in a fraction of the time, which is exactly how an agency turns one good design into many billable sites.

Still one folder per client

Instantiate creates a fresh client folder on purpose. Never run two instantiated clients from the same folder, their memories will cross-contaminate. See the one-folder rule.

Unofficial learning site. Sonic Agent is built by Rob Rizk.