Hand this to your coding agent.

A m0saic template is a TypeScript program that compiles to video, so your coding agent can write one. Hand it the prompt wherever you already run it, or run it inside Mosaic Desktop.

Paste it into your agent

Any of the agents above, or any other with a shell: it installs the CLI, reads the knowledge base and the example repos, writes a template, and renders it.

paste into your agent
Set up m0saic and build me a video template.

m0saic is a video compiler built to be driven by agents: a template is a TypeScript program that returns a layout string plus one source per tile, and the m0saic CLI compiles it to MP4 or PNG.

1. Install the CLI and its pinned ffmpeg:
   npm i -g m0saic
   m0saic setup --yes

2. Create a template workspace, then install and build it:
   m0saic init "My Templates" && cd my-templates
   npm install && npm run build

3. Connect the m0saic MCP server. It gives you real tools instead of just a shell: the knowledge base, every template's props, the m0 validator, a single-frame renderer, the publish gate, and a live link into Mosaic Desktop. For Claude Code, the workspace's .mcp.json already registers it; for any other MCP client, run npx -y m0saic mcp as a stdio server. MCP servers usually load when a session starts, so if the tools aren't available to you yet, tell me how to restart you inside the workspace and use the CLI until then. For Codex:
   codex mcp add m0saic -- npx -y m0saic mcp

4. Read AGENTS.md in that workspace and follow it from here on. Before you write any code, read the m0saic knowledge base (node_modules/@m0saic/knowledge/README.md first, or knowledge_search) and look through the example repos AGENTS.md lists for templates close to what I want.

5. Build this template: [describe your video here]. If that is still a bracketed placeholder, make a 1920x1080, 4-second title card with title and subtitle props, the subtitle fading in after the title.

6. Loop on npm run build and npm run verify until both are green. Check frames with render_still as you go.

7. Render it and look at the output before you call it done (-o out.png for a still):
   m0saic make "<template id>" --template-repo . -o out.mp4

8. Tell me the template id and the render command. Then set me up to edit it by hand: if I don't have Mosaic Desktop, point me to https://m0saic.io/download; have me add this folder under Templates → Add source; then open the template in Make for me with desktop_open_in_make.

Replace the bracket in step 5 with the video you want — or leave it, and you get a title card.

Or run it in Mosaic Desktop

In Make, take the Make videos agentically door and pick a workspace and your agent. Desktop connects the m0saic MCP server, and the template opens on the canvas as it builds.

desktop › makeGet Mosaic Desktop
Make's agent session in Mosaic Desktop: a Run in workspace picker above a row of coding agents (Claude Code, Codex CLI, Antigravity CLI, Gemini CLI, Qwen Code, OpenCode, and a custom command), each with its version and whether it has a free tier

1. Say it

Describe the video in plain English, in your terminal or in Mosaic Desktop’s Agent room. m0saic ships no model; bring the agent you already use.

2. It lands on the canvas

The agent writes the template, renders a frame and, in Desktop, opens it in Make. It usually asks one question: a band that could be thinner, a label that could go two ways.

3. Answer either way

Type the answer, or take hold of the rectangle and resize it. Every rectangle has a stable key, so what you moved and what the agent wrote are the same thing in the same language. Or run it headless and let it ship the file.

Wherever your agent runs, it gets real tools instead of a bare shell. The CLI ships an MCP server, m0saic mcp. A workspace from m0saic init registers it in .mcp.json, and Desktop connects it for any agent it starts. For any other MCP client, run npx -y m0saic mcp over stdio.

All 21 tools, by job
  • knowledge_list · knowledge_search · knowledge_readthe m0 handbook and the template-authoring guides
  • workspace_scaffold · list_templates · template_propsstart a template repo; every template's id, props and defaults
  • validate_m0 · render_still · doctorthe layout validator, a one-frame render, the publish gate
  • desktop_status · desktop_layout · desktop_snapshotwhat Make has open right now: every tile, every prop, a picture of the canvas
  • desktop_set_props · desktop_select_tile · desktop_make_control · desktop_edit_geometrychange it with you: undoable prop edits, point at a tile, drive Make's controls, move a tile as a ghost you apply
  • desktop_open_in_make · desktop_open_file · desktop_reload_sources · desktop_read_verdict · desktop_fork_to_documenthand work to you in Make, ask a question, read your answer back; branch a template into a plain .mosaic

What makes the loop trustworthy is that verify and doctor are the same gates a human runs. The shipping Alpine pack and the Weekly Pulse hero were built this way — receipts here.

Advanced — the same steps by hand, the reference repos, and shipping a template

Everything an agent needs to write a good template is public. npm install in any template repo drops @m0saic/knowledge — the m0 handbook, the engine mental models and the template-authoring contract — into node_modules, and the repo’s AGENTS.md tells the agent to read it first and where the examples are. The four repos below are worth having open for the code itself.

git clone https://github.com/m0saic-project/m0saic-template-repo-starter && git clone https://github.com/m0saic-project/m0saic-template-repo-starter-base && git clone https://github.com/m0saic-project/m0saic-packages && git clone https://github.com/m0saic-project/m0saic-community-templates

Deeper look: m0saic-sandbox is the iteration corpus the built-in templates were designed in — every candidate, in order, with the agent’s notes and the human’s replies. Useful once you are past the basics.

01

Render something in your terminal

The CLI is the engine. setup fetches the pinned ffmpeg once; hello-world renders the first template — the Mosaic Home screen saying hello — and prints a link that opens the same template in Mosaic Web.

npm i -g m0saic
m0saic setup
m0saic hello-world
02

Clone the curriculum and render a lesson

m0saic-template-repo-starter is ~80 minimal templates, one concept each, in reading order: the layout string, props, controls, media, connections, quality. Its dist/ is committed, so a clone renders with no build step. --template-repo points the CLI at the folder.

git clone https://github.com/m0saic-project/m0saic-template-repo-starter && cd m0saic-template-repo-starter
m0saic make '@m0saic-starter/basics/hello-world/v1' --template-repo . -w 1280 -h 720 -o hello.mp4

Read CURRICULUM.md for the map and template-manifest.json for the whole inventory as JSON. Change the -w/-h and render again: the same template, a different canvas, no letterbox — that is the point of the layout string.

03

Make one of your own

m0saic init writes a clean template repo — the files of m0saic-template-repo-starter-base, renamed to your own @handle, with AGENTS.md and .mcp.json already in it. Edit the template, and verify runs the same checks a reviewer would — it renders your defaults, checks every displayed prop is bound, and measures the layout against its own canvas.

The hello-world you get is the same card every m0saic repo ships — the field, the M, the wordmark — with your subline under it. It is your repo’s front door: m0saic hello-world --template-repo . renders it, and repo.helloWorld in src/repo.ts is where you point at your own template instead once you have one.

src/basics/hello-world/v1/hello-world.ts
// src/basics/hello-world/v1/hello-world.ts — your repo's front door
const card = defineHelloWorldTemplate({
  id: "@my-templates/basics/hello-world/v1",
  subline: `by ${TEMPLATE_REPO.displayName}`,   // the one line that is yours
});
m0saic init "My Templates" && cd my-templates
npm install && npm run build && npm run verify
m0saic make '@my-templates/basics/hello-world/v1' --template-repo . -o mine.mp4

UI and UX knobs are declared, not built. A template’s propsSchema is the whole editor: each prop’s type plus a meta.control line becomes a real control in Make, Compose and Jobs — a segmented pill, a unit-cycling number, a file drop, a draw-on-preview region picker, a clip-range studio over your video, a lyric cue track, or a layout card with a live geometric thumbnail and the Dictionary behind it. You never write a form.

The Component lab in Mosaic Desktop: the propsSchema snippet for a type m0 layout prop next to the layout card it renders, with a geometric thumbnail and Dictionary, Paste, Copy and View actions
Mosaic Desktop › Tools › Component lab — one story per knob family. The </> toggle prints the exact propsSchema lines that produce the controls below it (generated from the live story, so it cannot drift), with a Copy button. Shown: a type: "m0" prop — the layout picker.

The scaffold builds against @m0saic/types, @m0saic/template-utils and @m0saic/platform (npm, 0.2.0 — the same line the CLI ships) and the language packages @m0saic/dsl and @m0saic/dsl-stdlib. Nothing to clone.

04

Submit it. Earn your tile.

Your first accepted community template puts your mark on the Community M — the brand mark itself, one person per tile, forever, with a provenance video rendered by m0saic — and takes the attribution mark off your renders for a stretch of Pro. Details on the pricing page.

The library is public as a signed snapshot (v2026.10.0): a pull request is the submission, and it lands through the next signed release. Mosaic Desktop picks releases up on its own; from a terminal, m0saic community fetch installs the latest one. Rules and the license in the repo’s CONTRIBUTING.md.

m0saic community fetch

Or ship it from your own repo: publish each release as a bundle, and anyone installs it with m0saic install owner/repo. How to publish template bundles.

The whole anatomy, abridged from the curriculum’s anatomy lesson. A typed props surface, an id, a suggested canvas, and a render that places rectangles and returns the layout string with one source per tile. No timeline, no browser: the string compiles to pixels.

src/basics/anatomy/v1/anatomy.ts
export const AnatomyV1 = defineMosaicTemplate<AnatomyProps>({
  id: asTemplateId("@my-templates/basics/anatomy/v1"),
  label: "Anatomy",
  version: 1,
  outputHints: { width: 1280, height: 720, fps: 30, durationMs: 2000 },

  propsSchema,                       // typed knobs; Make draws the controls
  defaultProps: { text: "Hello, m0saic", backgroundColor: "#0d1117" },

  async render(props, ctx) {
    const { width, height } = ctx.target;
    const side = Math.round(Math.min(width, height) * 0.32);

    const placed = placeInsetPieces({
      rootW: width, rootH: height,
      pieces: [
        { rect: { x: 0, y: 0, w: width, h: height, importance: 0 },
          source: makeColorTile(fill) },
        { rect: { x: gx, y: gy, w: side, h: side, importance: 2 },
          source: brandGlyphTile(HEADER_M_GLYPH, BRAND_ORANGE) },
        { rect: label, importance: 1,
          source: bindProp(svgLabel(text, label.w, label.h), "text") },
      ],
    });

    return {
      kind: "mosaic_document",
      version: 1,
      m0: toM0String(placed.m0, ID),   // the layout string — validated here
      sources: placed.sources,         // one source per tile, in order
      backgroundColor: fill,
      assets: {},
    };
  },
});

Next: the Layout editor · the open-core package map · the Community M · templates written by an agent · why rectangles