The AI assistant

Guides

The AI assistant

The Studio's assistant writes and changes content for editors. In code mode it changes the site's code too, in a proposal you review.

Use it for

  • Drafting and rewriting copy where it is shown
  • Changing many entries at once
  • Asking for a new section, and reviewing the code it writes

What it does

Content

Ask for a change in words: rewrite an intro, add three questions to an FAQ, translate a page. The assistant reads your schema, including every .describe(), makes the change as drafts, and validation runs on it like on any edit.

Code mode

Ask for something only code can do, like a new section type. The assistant changes the code in a proposal, Val builds it, and you review the code beside the content before anything is published.

Turn it on

The assistant needs a project connected to Val Build, or a site Val hosts. Its settings are content, in the project's settings module, so an editor can change them without a deploy.

context tells the assistant what the site is; tone how to write. Without enabled: true the Studio offers the assistant and asks first.

settings.val.ts
import { s, c } from "./val.config";

export default c.define("/settings.val.ts", s.settings(), {
  assistant: {
    enabled: true,
    context: "The site of a Norwegian design studio. British English.",
    tone: "Plain and direct. Sentence case in headings.",
  },
});

Locally

In local development, sign in from the terminal so the Studio can reach the assistant:

Terminal
npx val login

Your own AI coding tools

Cursor, Claude Code and other tools work on Val content the way you do: it is TypeScript, so they get the types, and npx val validate tells them when content does not match its schema.