Snabbsite · Hjälp
För utvecklare

Convert a site with an agent

Point a coding agent at an existing website. Choose a connected app, a best-effort visual capture, or a structured redesign, then land an unpublished draft.

0. Should it look the same? Read this first

A package of typed Snabbsite sections is a redesign on our blocks. It does not preserve the source layout. If you want to keep the current layout, choose one of these routes:

  • Your own Next.js or React app that you keep deploying: use Make a site editable. Your code keeps rendering the site; Snabbsite holds the content and the editor.
  • A live address, a static export or an HTML zip: sign in to Snabbsite, choose Move your website (also under Settings → Backup & move), paste the address or drop the zip, and keep the default choice on the preview screen. Snabbsite tries to capture the rendered page. Text, images, and links are editable when the capture succeeds. The internal layout stays fixed, and the flow falls back to Snabbsite blocks when the capture is unavailable or too large. Only a browser can make that capture, so no CLI command produces it.

The prompt below asks the agent this question first and stops it from building a package when the answer is "same look". Since 2026-08-27 a package that rebuilt a website is also held in the app before anything is created, with one button that tries the visual capture from the package's provenance.sourceUrl instead.

Converting into a new design

You point a coding agent (Claude Code, Cursor, Codex) at the source, it produces a validated PortableSiteV1 package plus a conversion report, and a human lands that package as an ordinary unpublished draft.

The deliverable is data, not code. Nothing from the source ever executes on Snabbsite: no React, no PHP, no plugins, no scripts, no arbitrary CSS. Source code is evidence to read.

1. Install the tooling

npm install -g @snabbsajt/cli     # or prefix every command with npx @snabbsajt/cli
snabbsajt --version
snabbsajt site doctor --json

Then install the versioned agent skills into the project you are working in:

npx @snabbsajt/cli skills install --agent auto

import-website is the skill that runs this job. See Agent skills for what else is installed and how updates behave.

2. Give the agent the prompt

The canonical prompt is one file in the app repository, lib/import/conversionPrompt.ts. The quickest way to get it is the copy button on /for-utvecklare, which is the copy to use.

The SDK's prompts/convert-to-snabbsajt.md and the import-website agent skill (2.0.0) are downstream copies of the canonical file and carry the same section 0 gate. They are regenerated from it, never edited on their own.

Paste it into the agent and replace <SOURCE> with a repo path, an HTML file or static zip, or a public URL. The import-website skill is the packaged form of the same instructions - use one or the other, not both.

The prompt's header pins prompt-version, requires-cli, portable-format (sajt-site@1) and report-contract (snabbsajt-import-report@1). An agent running against a CLI below the floor is told to stop rather than improvise, which is what makes a stale prompt fail loudly instead of silently producing a package the validator rejects.

3. What the prompt makes the agent do

Five rules do most of the work, and they are the ones to check if a conversion comes back wrong:

  • Same look first. The agent asks whether the site should look the same and routes to the visual capture or make-site-editable when it should. It only builds a package for an explicit redesign, and then it says so: "This rebuilds the site on Snabbsite blocks. It will not look like the current site."

  • Read, never run. No dependency install, no env vars, no build tools, no executing the source.

  • No invented business facts. A price, opening hour, phone number, address, testimonial or legal line that cannot be cited from the source stays out and becomes a review item.

  • Enumerate the section registry, never recall it. The agent lists SECTION_TYPES and each entry's variants from the installed @snabbsajt/site-kit package rather than trusting remembered names. See the schema reference.

  • Unsupported means skipped and reported, never smuggled in as raw HTML or a faked section.

It then loops snabbsajt site validate / site inspect until clean and packs a bundle:

snabbsajt site validate ./candidate --json
snabbsajt site inspect  ./candidate --json
snabbsajt site pack     ./candidate -o site-bundle.zip

Per-source detail lives in Convert a Next.js site, Convert HTML and Convert WordPress. For HTML and WordPress the agent is told to start from the deterministic importer (snabbsajt site import html|wordpress) and improve its output rather than author from scratch.

4. Read the report before you land anything

Every conversion produces conversion-report.md against the snabbsajt-import-report@1 contract: imported exactly, converted, merged, skipped with reason, missing source evidence, AI-proposed, assets that failed safety checks, redirects proposed, and manual actions required before publish.

A report with unresolved entries in the last six buckets describes a review draft, not a finished site. Read The import report before you accept one.

5. Land it

Three routes, in increasing order of agent autonomy:

  1. Human upload (the default). The agent stops at the validated zip. A person imports it in Snabbsite (/dashboard/import, or Settings → Backup & move). The import creates an unpublished draft and overwrites nothing.
  2. snabbsajt push. With CLI ≥ 0.4.0 and an admin token (snabbsajt admin pair), the agent runs snabbsajt push ./candidate --site <id> --dry-run, shows the merge report (added / updated / unchanged / conflicts), and only runs it for real after the human approves that report. See the CLI reference.
  3. Over MCP. import_site takes the PortableSiteV1 payload and creates the draft directly; migrate_site_from_url does the crawl, convert and create in one call from a live address. Both need content:write, run unattended because they only ever create a draft, and return the honest report. See MCP tools & scopes and Connect Claude over MCP.

Re-importing the same source later merges instead of duplicating, provided the agent gave every page and section a stable externalKey: unedited matches update, app-edited sections are reported as conflicts and kept.

What never comes across

Scripts, tracking snippets, iframes, embeds, booking widgets, custom React or PHP components, and arbitrary CSS. Analytics, booking and animation behaviour may only reappear as an allowlisted native Snabbsite setting or section. An agent that reports a clean conversion of a site full of embeds has not done the job.

Starting a new site instead

Converting is for a site that already exists. To start a fresh one in code, clone the starter kit and point it at a published website.

Then hand it over

A converted draft is normally the start of an agency engagement, not the end of one. Hand off to the client covers inviting them, deciding what they may use, and the one move that voids every limit you set.


Hittade du inte svaret, eller stämmer något inte? Berätta det för oss.

På denna sida