Skill v1.0.0
currentAutomated scan100/100name: headless-step-provision description: "Step 3 (provision) of the Hostinger Headless flow. Chooses the backend from brief.md (wordpress | ecommerce | webapp), then routes to the matching subfolder to provision it; writes site.json. WordPress + WooCommerce routes to the wordpress subfolder with the WooCommerce store turned on — it is not a separate backend." metadata: version: "1.0.0"
headless-step-provision
Router. The backend is decided in refine and recorded in brief.md; this step only routes to the matching subfolder, which provisions it.
In: brief.md. Out: site.json (written by the subfolder).
Step 1 — Route on the suggested backend
Read the brief's Suggested backend section:
| Suggested backend | Follow | |
|---|---|---|
| WordPress | wordpress/SKILL.md | |
| WordPress + WooCommerce | wordpress/SKILL.md with the WooCommerce store on (its Steps 4–5; site.json → backend stays "wordpress") | |
| Ecommerce | ecommerce/SKILL.md | |
| Webapp | webapp/SKILL.md |
If the section is missing or names something else, go back to refine — don't pick one here. Tell the user the backend and its one-line reason before provisioning.
Supported backends: `wordpress` (optionally with a WooCommerce store), `ecommerce` and `webapp`.webappis a plain Node.js app host (an empty website — no CMS, no store, no/cms) for any app/SPAthat brings its own code and data; it never installs WordPress. PocketBase is not available in thisversion — refine never proposes it, and there is nopocketbase/subfolder; if a brief somehow namesit, stop and tell the user rather than improvising it. A WordPress + Ecommerce brief (two separatebackends — a WordPress site and a Hostinger Ecommerce store) has no single combinedhosting_websites_createtype yet: stop, tell the user it isn't supported as one site, and offer either to continue with justWordPress or just Ecommerce (route to that one subfolder), or, if they want content and a store onone site, to switch the brief to WordPress + WooCommerce — the one-site path, which routes towordpress/SKILL.mdwith the store on.
Onboarding handoff — swap an existing empty headless shell (do this before creating anything)
Onboarding can create the website before you ever run, as an empty headless shell (hosting_websites_create { type: "headless_empty" }: website_type is headless, but nothing is installed). The single-instance gate in Step 2 is the checklist.
Webapp is not part of this handoff at all.webappis not reached on the usual onboardingflow — it is only triggered by experimental actions — so it ignores headless instances entirely:it never detects, adopts or swaps an empty headless shell, and provisions its own Node.js app hostexactly aswebapp/SKILL.mddefines today. The swap below is WordPress and Ecommerce only.But webapp must still never create a second instance for this build. Only route here when thebrief's backend iswebapp— awordpressorecommercebrief is never provisioned as a webapp. Andif this build's domain already has a headless shell/site (an onboardingheadless_empty, or any rowfrom the single-instance gate below), do not spin up a separate Node.js host on another domain:stop and tell the user the domain already has a headless instance, rather than leaving the build splitacross two sites.
Step 2 — Fire (don't block)
Single-instance gate — pass all four before you create anything:1. Exact-match the domain inhosting_websites_list(substring filter — match the exactdomain).2. A `headless` row already exists → adopt + swap it, never create. Install the backend into thatsame site (WordPress →wordpress_installations_install { type: "headless" }into/cms; Ecommerce→ adopt as the storefront host). Do not call `hosting_websites_create` again — that makes a second site.3. No row at all → create one fresh with the backend's ownhosting_websites_createtype. Create it for **thisbuild's domain only** — never provision the backend on a different domain than the frontend (the CMSis the/cmspath of the same site, never a separatecms.<domain>).4. A row of a different kind (website_typenotheadless) → stop and tell the user; neveroverwrite it.wordpress/SKILL.mdStep 1 andecommerce/SKILL.mdStep 1 say how to tell an empty shell from analready-provisioned backend.
Follow the chosen subfolder's SKILL.md through detect + create (its hosting_websites_create call). The moment the create is accepted and queued, record it in state.json and return — do not wait for it yet:
{ "stage": "content_model","provision": { "status": "in_progress", "domain": "<domain>", "started_at": "<now>" } }
Now go run the prepare work that doesn't need the backend (content-model prepare, frontend shell). The subfolder's readiness poll, verification and site.json are the join half below.
Step 3 — Join (at the instance barrier)
When an instance-barrier step is about to run (content-model push, frontend data wiring, deploy) — or right away, if the agent can't interleave — finish the subfolder's SKILL.md: run its wait.mjs (it returns at once if the job is already done), run its verification, and write site.json (which records the chosen backend). Then set provision.status to "completed" in state.json with a fresh updated_at.