Skip to content

Website artifact workflow

Turn a conversation into a small static website. The AI interviews you, plans the pages, writes the HTML, CSS and JavaScript, and stores the result as an artifact you can preview.

Updated View as Markdown

The Website artifact workflow builds a working static website instead of spec files. The AI interviews you, proposes a site plan, writes the pages and stores them as an artifact: a versioned set of files you can preview in MySpec. In the picker it is Website artifact (v1).

At a glance

  • Best for: A clickable prototype, a landing page or a small static site
  • Project type: Any (Greenfield, Brownfield or Auto)
  • Stages: Interview → Site plan → Build
  • Writes: One artifact per session, with one index.html, other .html pages if you need them, and the .css and .js files the pages use. It writes no spec files.

If you do not see Website artifact (v1) in the picker, it is not available in your workspace yet.

Stages

Interview

The AI asks about the site in short rounds of multiple-choice questions: its purpose and audience, the pages and their content, the style, what should be interactive, and any third-party libraries you want. Answer them as in any Generate session. You can base the site on the project’s spec files, attachments or other artifacts: reference them in your message with @.

Site plan

The AI shows a site plan card before it writes any code. The plan names the artifact and lists every file with its purpose, and every library with its address. Approve it, or ask for changes and say what to change.

Build

The AI writes the files and stores them as a new revision of the artifact. The first revision creates the artifact. While it writes, the chat shows a line for each file, such as Writing css/site.css · ~12.0 KB, that turns into Wrote css/site.css when the file is done, and the AI says in one sentence what each file is for. See Watch the AI write the files. Each revision shows a card with the file count, the total size, the outside hosts the pages load from, and a preview you can expand.

Approve the revision to finish, or ask for changes. Each round of changes adds one revision; earlier revisions stay in the artifact’s history.

When you approve, the session ends with a card that links to the artifact. From there you can open it in the viewer, or start an Edit website artifact session to change it later. The artifact also appears in the ARTIFACTS section of the sidebar and on the project’s Artifacts tab. See Artifacts.

What a site can contain

  • File types: .html, .htm, .css, .js, .mjs, .json, .svg, .txt, .md, .xml and .webmanifest. The AI does not create images or fonts; load them from a CDN or use inline SVG.
  • Size: At most 50 files, 2 MiB per file and 10 MiB in all.
  • Relative paths: Pages link to each other and to their files with relative paths, such as css/site.css or about.html. A path that starts with / breaks in the preview, so the AI does not use one. Link pages by file name, not by folder.
  • Third-party libraries: Pages can load scripts, styles and fonts from any CDN over https. Libraries you did not plan show up on the revision card. An http address is blocked by the browser.

Before it stores a revision, the AI checks that every local file a page or style sheet refers to is in the site, and fixes what is missing.

What the preview cannot do

The preview runs the site in an isolated frame with no origin of its own. In it:

  • localStorage, sessionStorage, cookies and IndexedDB do not work. A site that needs to keep data should keep it in memory for the visit.
  • A script loaded as a module, or with crossorigin, from another host loads only when that host allows it.

Example

A small site might have three files:

index.html
css/site.css
js/app.js
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Coffee corner</title>
    <link rel="stylesheet" href="css/site.css" />
  </head>
  <body>
    <h1>Coffee corner</h1>
    <button id="menu-toggle">Show the menu</button>
    <ul id="menu" hidden>
      <li>Espresso</li>
      <li>Flat white</li>
    </ul>
    <script src="js/app.js"></script>
  </body>
</html>
body {
  font-family: system-ui, sans-serif;
  margin: 2rem;
}
document.getElementById('menu-toggle').addEventListener('click', () => {
  const menu = document.getElementById('menu');
  menu.hidden = !menu.hidden;
});

Tips

  • Name the pages you want. A short list of pages and what each one shows gives a better plan than a general description.
  • Keep it small. A session writes a site in a limited number of steps. Ask for more pages in the next round instead of all at once.
  • Use /goback to return to the interview or the site plan. The next revision still goes to the same artifact.

When to pick another workflow

To write specs for a product before you build it, use MySpec, or MySpec brownfield for an existing codebase.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close