--- name: convert-site description: Convert a live website (WordPress first; Drupal, Webflow, Squarespace, Wix and static sites too) into a static Astro site with the same URLs, content, head tags, media, redirects and look, proven by parity gates and a pixel-level visual review, ending in one pull request, a noindexed staging deploy and a launch runbook. Use when asked to convert, rebuild, migrate or clone a site to Astro, when handed a site URL with this kit's link, to resume a conversion from .conversion/state.json, or with --apply to apply one suggestion as a proposal. --- # convert-site The orchestrator. It asks one message of questions, then runs every other skill in order without stopping again, and ends with a pull request the person merges and a runbook they launch from. ## The golden rules 1. **One intake message, then no stops.** Every question carries a default. Anything that later needs an account, a login or a token you do not have goes on the "needs you" list (`state.needsYou` and `docs/LAUNCH.md` section A) and the run carries on. 2. **The live site is read-only.** Only these read it, paced: the capture scripts, `shoot.mjs` and `styles.mjs` on live, `css-coverage.mjs`, `launch-audit --old-url` and `pre-launch --predecessor-url`. Analytics are blocked on their live page loads, so no visit is counted. Never submit a form on it, log in, or fetch a page by hand to fill a gap. 3. **The default build equals live, faults included.** Content is moved from captured markup, never retyped or tidied. Every oddity is a decision row that says "reproduce live by default". A forced difference is an exception; an improvement is a proposal (`PROPOSALS=on` only). 4. **Gates on every commit, never softened.** Never edit `baseline/` to pass (only the `keep` flags in `baseline/scripts.json`). A skip is not a pass; "Not covered" is never a pass. 5. **`main` gets the scaffold commit and nothing else.** On a new, empty repository init-site makes one commit on `main`, the exception to "never commit to main": the PR needs a base. Everything after it is on `astro-rebuild`, one PR. Never force-push, never merge, never touch DNS, the old host or a dashboard setting. 6. **No secrets in chat or in the repository.** Never ask the person to paste a token. Credentials come from the environment or a CLI's own login. ## Names used below `KIT` is the absolute path of this kit (the folder holding `skills/` and `package.json`). `LIVE` is the live origin. `SITE` is the absolute path of the new site repository (default `/`); the capture and the run state are written into it from the start, and `init-site.mjs` scaffolds around them. Run every command from `SITE`. Every script prints `--help`; run that rather than reading the source. Every Node command in a fresh shell starts with `source ~/.nvm/nvm.sh && nvm use 22.23.4` (or runs in a shell that reads `.nvmrc`). ## Step 0a: a kit that can run The scripts import `parse5`, `playwright` and the rest from the kit's `node_modules`. If `$KIT/package.json` or `$KIT/node_modules` is missing (an install that copied only the skill folders has neither), clone the kit and install it, then use the clone as `KIT`: git clone https://github.com/ethanplusai/astro-conversion-kit /astro-conversion-kit npm install --prefix /astro-conversion-kit ## Step 0: preflight and fingerprint (before the intake message) node $KIT/skills/convert-site/scripts/preflight.mjs --json node $KIT/skills/capture-site/scripts/fingerprint.mjs $LIVE Install what is missing that you can install yourself, without asking: `npx playwright install chromium` when `playwright.chromium` is false; `vercel` and `wrangler` run through `npx`. A CLI that is present but not logged in is the person's to log in: name the command (`gh auth login`, `npx vercel login`, `npx wrangler login`) in the intake message and check again at the scaffold. `experience` sets how you talk, not what you do. `new`: one plain sentence per phase on what it does and why, every term explained once, installs done silently. `some`: one line per phase. `experienced`: commands and results only. A Shopify fingerprint is a store: stop and say so. ## Step 1: intake (the one message) Send `references/intake.md`'s template, filled in with what preflight and the fingerprint found: every question with its default, and the "what is missing and what happens" list. If the person does not answer, the defaults stand. Never send a second question message. ## The phases The order is `docs/process.md`'s; `references/phases.md` has every command and each proof. At each boundary run `node $KIT/skills/convert-site/scripts/state.mjs --dir $SITE phase `; do not start a phase until the previous one's proof holds. Run `state.mjs` calls one at a time, never chained with `&&`: each rewrites `state.json`, and a chain failing partway leaves it out of step. | # | Phase (``) | What happens | Done when | |---|---|---|---| | 1 | `intake` | Preflight, fingerprint, the one message | Answered, or defaults stand | | 2 | `capture` | `capture-site` into `$SITE/capture/`, CSS coverage | Every URL saved or recorded with its status; Notes written | | 3 | `plan` | Decide hosting, URL form, media mode, templates; decisions in state; drafts under `.conversion/` | Every template, count, oddity and out-of-scope feature has a decision | | 4 | `scaffold` | Repo, `init-site.mjs` around the capture, then `docs/plan.md` and `docs/media-plan.json` | It builds empty; `main` holds the one scaffold commit | | 5 | `baseline` | `npm run baseline` (`templates.json` already exists) | `build-baseline.mjs --check` exits 0 | | 6 | `build` | Layouts and shared parts, one page per template, design lock on the templates, then every page | `npm run build` passes; template gates pass path by path | | 7 | `gates` | The full gates | `npm run verify` exits 0 | | 8 | `visual` | Every template at 390, 768, 1440; every page at 390 and 1440 | Every pair passes | | 9 | `components` | Optional, off by default (`references/components-optional.md`) | Gates and diffs still pass, one separate commit | | 10 | `prelaunch` | `pre-launch`, staging deploy, `verify-live`, `launch-audit`, one test submission | `prelaunch-reconcile.mjs` exits 0 (`references/phases.md` §10); audit blockers fixed or listed | | 11 | `suggestions` | `suggest-improvements` with `gates.json` and `review/` | `docs/suggestions.md` with its "From the review" section | | 12 | `pr` | Runbook, push, PR, final report | The PR quotes gate output and every "Not covered" section | | 13 | launch | The person's, from `docs/LAUNCH.md` | `post-launch` checks the cutover and watches 30 days | The skills each phase uses, with their own rules: `capture-site` (2), `parity-gates` (5 to 7), `visual-review` (6, 8), `pre-launch` and `launch-audit` (10), `suggest-improvements` (11), `post-launch` (in the runbook). Read each skill's SKILL.md before its phase. ## The build, in one paragraph `references/build-rules.md` is binding. Layouts and the shared header, navigation and footer are always components; content blocks are the captured markup, moved by a script. Media at its original paths, fonts self-hosted, CSS by coverage pruning (`css-coverage.mjs` then `css-prune.mjs`), never a rewrite. Forms per `references/forms.md`, third-party scripts per `references/third-party.md`. `redirects.csv` is the single redirect source: a new redirect is a row whose `source` is `decision` and whose `note` names the decision id, then `npm run redirects:build`; never hand-edit the generated rules. One commit per template (`feat: