Skip to Content
Developer GuideConvert a Design to Code

Convert a Design to Code

Your AI tool can turn a design into a Visor site: a theme, layouts and widgets in the site’s code, with the content in Visor for your team to edit.

The easiest way is to connect the Visor MCP and say “help me build my site”. Visor looks for your design and leads each step. The skills below do the code work, and you can also run them yourself.

What you can start from

You haveUse
HTML and CSS, or a Figma or Claude Design HTML exportconvert-html
Screenshots or imagesconvert-image, which reconstructs them as HTML first
An existing websitereplicate-site, which captures it as a design first
Nothing yetSay so. Your AI tool interviews you, proposes pages from the site’s existing widgets, and builds a design for you only if new code is needed

Put your design in source/

      • index.html
      • about.html
      • styles.css

source/ is ignored by git, so it stays on your machine. Use clean, unminified code, because minified code slows the conversion and costs more tokens.

A design in the source folder

Run the conversion

Start the skill

Run convert-html in your AI tool, or let the guided path do it.

The convert-html skill running

Review the plan

With the guided path, it first reports the pages, shared parts, repeated sections, fonts and scripts, suggests which repeated content should become content types, and gives a verdict: go, go with caveats or stop. Your yes covers the whole build.

Let it build

The order is fixed, because layouts and widgets take their colours and fonts from the theme:

  1. Theme in app/styles/<theme>/.
  2. Layouts in components/layouts/, with the shared header and footer as widgets.
  3. Content types in Visor, for repeated content, after your yes.
  4. Widgets in components/widgets/site-widgets/, one per section, using a design-system widget where one fits.
  5. Styles in styles/site/.

Check it in Developer mode

Turn on Developer mode to see the theme, layouts and widgets in Visor on your own machine.

Generated widgets

Merge it

Push your branch and let Visor merge it. See Code Changes. The preview rebuilds in a few minutes.

Set it up in Visor

An AI tool does this after the merge, or do it by hand:

  1. Activate the theme.
  2. Set up each layout.
  3. Build the pages, starting with Home, then add content items.
  4. Publish them, then Deploy.

Replicate an existing website

replicate-site always creates a design in source/ first. It starts by asking about your rights.

The website isWhat it captures
Yours, or you have permissionStructure, styles, text and images.
Anyone else’sStructure only. You supply your own brand, text and images.

Then you agree on the pages, about 8 to start, and it captures them:

npm run replicate:site -- --out source/<name> <home-url> <page-url>

Add --mode structure for someone else’s site, or --render for pages built by JavaScript, which needs Playwright. It keeps trackers out and records what it took in manifest.json.

The AI tool then cleans the pages. You compare them with the original on phone and desktop, and the conversion continues as usual.

Rules to know

  • Names must not match the platform’s. Prefix widgets and layouts with Site or your site’s name.
  • Write only in your site’s places, so you can still take template updates.
  • Keep content out of the code. Anything your team should edit belongs in pages and content types.

Review what is generated. The skills give a working start, but names, content bindings and edge cases may still need adjusting.

Where to go next

Last updated on