@@ -48,10 +48,9 @@ Hostinger connector's OAuth token. **This recipe is not a security boundary.**
4848## The flow stages - STEPS TO FOLLOW
4949
5050Work through the steps in the order below, each reading its recipe and writing its artifact into the
51- site workspace ` ~/.hostinger/<domain>/ ` .
52-
53-
54- The order is sequencial run and check the whole headless flow:
51+ site workspace ` ~/.hostinger/<domain>/ ` . The one exception is content prepare (step 4) and design
52+ (step 5): with a subagent tool, run them at the same time, as * Content and design at the same time*
53+ says.
5554
5655| # | Stage | Skill / source | Writes | Instance? |
5756| ---| --------------------------------------------------------------------------------------------------------------------| -----------------------------------------------------------------------| ---| ---|
@@ -79,8 +78,7 @@ The other 9 numbered steps live under `steps/` and are read from the installed s
7978** One concurrency rule:** two * independent* stages in a single session may run at once, but never
8079two writers of the same artifact, and never two agents/windows on the same domain — the ` .lock `
8180(Step 1) guards that. Parallelism is always * optional* : an agent that can't interleave work runs the
82- steps serially and is still correct. Saying this, Always that you consider, you can run the steps
83- in parallel using different threads or processes to save time, but always ensure the right output.
81+ steps serially and is still correct (see * Content and design at the same time* ).
8482
8583Steps can generate ** State files** those files are only hints; the truth is what the Hostinger connector reports, so
8684verify a "done" marker against reality before acting on it. If a step's ` SKILL.md ` is missing from the installed skill folder, stop and tell
@@ -144,7 +142,8 @@ keep the language you were using.
144142### One instance per headless site (the core invariant)
145143
146144> ** A headless site is exactly one website.** The frontend is served at the site root and WordPress
147- > lives at ` /cms ` ** on the same domain** — one instance, one domain. There is ** never** a second
145+ > lives at ` /cms ` ** on the same domain** (a PocketBase backend at ` /api ` and ` /_/ ` of the same domain) —
146+ > one instance, one domain. There is ** never** a second
148147> website for the same build and ** never** a separate CMS domain: the CMS is always the ` /cms ` path of
149148> the site's own domain (` https://<domain>/cms ` ), not ` cms.<domain> ` or any other host. Provision
150149> therefore ** adopts and swaps** an existing headless shell rather than creating another site, and a
@@ -165,13 +164,16 @@ but an instance existing does **not** mean provision is done or can be skipped.
165164which of these cases applies and records it, then provision takes the matching path:
166165
1671661 . ** An empty headless shell already exists for the domain (the common onboarding case).** Provision
168- ** adopts the shell and swaps it to the chosen backend** (the backend is picked in refine first).
169- ** Never skip provision for a shell, and never create a second site.** See the provision router's
170- * Onboarding handoff* .
167+ ** adopts the shell and swaps it to the chosen backend** (the backend is picked in refine first):
168+ WordPress into ` /cms ` , the shell as the Ecommerce storefront host, or a PocketBase backend created
169+ on it with ` hosting_pocketbase_create-backend ` (which turns the ` headless_empty ` site into
170+ ` headless_pocketbase ` ). ** Never skip provision for a shell, and never create a second site.** See
171+ the provision router's * Onboarding handoff* .
1711722 . ** No instance exists at all.** Provision creates a fresh headless instance with
172- ` hosting_websites_create ` using the chosen backend's own ` type ` .
173- 3 . ** User wants a webapp.** Provision is a plain Node.js app host, not headless — ` webapp ` ignores
174- headless shells entirely and is only reached by experimental actions, never the onboarding flow.
173+ ` hosting_websites_create ` using the chosen backend's own ` type ` (` headless_wordpress ` ,
174+ ` headless_ecommerce ` or ` headless_pocketbase ` ; a PocketBase site gets its backend at the join).
175+
176+ Every backend is a headless website: there is no plain Node.js app host in this flow.
175177
176178Either way the create/install is asynchronous and returns ` queued ` immediately, then it takes a few
177179minutes; the backend's provision step names the ` wait.mjs ` command to run at the join, not at the fire.
@@ -182,6 +184,34 @@ makes the overlap safe:
182184> moment a step must write to the live instance, it waits for provision to report ready (via the
183185> backend step's readiness poll — see above). That wait is the * instance barrier* .**
184186
187+ ### Content and design at the same time
188+
189+ Content prepare and design are the two slow prepare stages, and neither needs the other. ** If you
190+ have a subagent tool** (Claude Code's Agent tool, for one), ** launch content prepare in one background
191+ subagent as soon as provision fires and the user has answered the image-source question, before you
192+ do any content work yourself** , and design while it
193+ runs. A helper you use only to fetch pages doesn't count. ** If you have none, run content prepare
194+ then design, one after the other** , as the table lists them. Either way the output is the same.
195+
196+ 1 . ** Ask what the subagent can't.** A subagent can't talk to the user, so before you launch it, ask
197+ content's one question yourself: the image source (` steps/04-content-model/SKILL.md ` → * Images* ).
198+ 2 . ** Launch the content subagent** with the instructions in ` steps/04-content-model/SKILL.md ` →
199+ * Prepare in a subagent* . It does all of content prepare; nothing else writes its files while it
200+ runs.
201+ 3 . ** Do design yourself, meanwhile** (` steps/05-design/SKILL.md ` ): its one question to the user stays
202+ with you.
203+ 4 . ** Wait for the subagent before the frontend step** , which reads ` content-model.md ` . When it
204+ reports, end its stage in the run log, check the files it names exist and note its gaps for the
205+ final report. Set ` state.json ` → ` stage ` to ` frontend ` only once both the subagent has reported and
206+ ` design.md ` is written, so a resume never skips either. The push, Hostinger AI images and
207+ every other write to the live site stay with you, after the instance barrier.
208+ 5 . ** When the subagent's report resumes you, finish the whole flow** : the content push at the
209+ instance barrier, the frontend, validate, deploy, then done, whose final report must include the
210+ * Steps completed* table (` steps/09-done/SKILL.md ` ).
211+
212+ You alone write ` state.json ` and the run log; log the overlap as two open stages (see * Run log and
213+ build report* ).
214+
185215### Waiting on Hostinger: ` wait.mjs `
186216
187217` wait.mjs ` (next to this file) waits for a slow Hostinger job in one command, so you don't spend a turn
@@ -194,6 +224,7 @@ cd "$HOME" && node <skill>/wait.mjs setup <domain> # a fresh site's
194224cd " $HOME " && node < skill> /wait.mjs cms < domain> < username> # a shell swap's WordPress install at /cms → valid
195225cd " $HOME " && node < skill> /wait.mjs build < domain> < buildUuid> # the deploy build → completed, then the root serves 200 (http:// while SSL is pending)
196226cd " $HOME " && node < skill> /wait.mjs live < domain> # the root serves 200
227+ cd " $HOME " && node < skill> /wait.mjs pocketbase < domain> # a PocketBase backend's /api/health serves 200
197228```
198229
199230Run it in the foreground, with a ` --timeout ` just under your tool's command limit (e.g. ` --timeout 9m `
@@ -235,6 +266,8 @@ took from it.
235266| ` site.json ` | provision | chosen backend, username, install id, all URLs |
236267| ` content-model.md ` | content model | entities, fields, pages, navigation |
237268| ` content.json ` | content model (WordPress) | the drafted content ` push-content.mjs ` pushes |
269+ | ` pocketbase/schema.json ` | content model (PocketBase) | collections, access rules, indexes, rate limits, seed records |
270+ | ` .pocketbase/credentials.json ` | provision (PocketBase) | the backend's superuser email and one-time password; mode ` 600 ` , never deployed, never printed |
238271| ` design.md ` (+ ` brand/ ` logo files) | design | chosen design direction: tokens, type, logo, components, per-page composition, accessibility |
239272| ` src/ ` | frontend | the website source implementing ` design.md ` ; framework choice is recorded in ` state.json → frontend ` |
240273| ` deploy.json ` | deploy | build id, deployed at, live URLs |
@@ -304,6 +337,15 @@ to it, joined with `&&` (e.g. `node <skill>/run-log.mjs <domain> next deploy &&
304337` ok ` or needs a note, put its ` stage-end ` first in the same command. ` next ` refuses when two stages are
305338open and names them; end them with ` stage-end ` .
306339
340+ ** Content and design overlapping** (see * Content and design at the same time* ) are two open stages.
341+ Start both when you launch the subagent, and end each when it finishes:
342+
343+ ``` bash
344+ node < skill> /run-log.mjs < domain> next content_model --phase prepare && node < skill> /run-log.mjs < domain> stage-start design
345+ node < skill> /run-log.mjs < domain> stage-end design ok # design.md written
346+ node < skill> /run-log.mjs < domain> stage-end content_model ok --phase prepare # the subagent finished
347+ ```
348+
307349** Follow-ups continue the run.** When the user asks for a change after the final report in the
308350same session (a layout fix, a copy tweak, a redeploy), that work belongs to the run it follows:
309351call ` run-resume ` , log the feedback and the stages it re-runs as usual, then ` report ` again. That
0 commit comments