SnabbSajt · Docs
For website ownersFor developers

Convert a site with an agent

Point a coding agent at an existing website and land it as an editable SnabbSajt draft - the prompt, the rules that keep it honest, and the three ways to land the result.

You do not convert an existing website by hand. 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 SnabbSajt: 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 lives in the SDK repository at prompts/convert-to-snabbsajt.md. 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

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

  • 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 SnabbSajt (/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 SnabbSajt setting or section. An agent that reports a clean conversion of a site full of embeds has not done the job.

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.


Didn't find the answer, or is something wrong here? Tell us.

Last updated on

On this page