1// Pin the skill location + project facts into /app/AGENTS.md so later turns (after the platform2// build doc leaves context) still know the rules. Idempotent — safe to re-run; writes at most once.3// Run once by base44.md STEP 1, separately from per-vertical deploys (deploy.cjs), so "copy a4// vertical's files" and "record the project's ground rules" stay independent concerns.5// .cjs on purpose — the app is an ESM package ("type":"module"); a .js here would load as ESM and6// require()/module.exports would throw.7const { existsSync, readFileSync, appendFileSync } = require('fs');89const NOTE = `
11## This app — a Wix-managed headless frontend (built with the Wix skills)
12
13This project is the **frontend for a Wix-managed business** — a REST client that talks directly to a live Wix site over \`WIX_CLIENT_ID\`. The **Wix site is the source of truth** for all content and commerce; build and seed it only through the Wix connector and the skills below. **Do NOT use the Base44 commerce kit (or any Base44 solution kit).**
14
15The Wix skills live under \`.agents/skills/\` — on ANY turn, read them from that exact path (ignore stray copies like \`agent/skills/\`).
16
17- \`wix-vibe-headless\` — **how the CLIENT is built AND how the site is seeded**: your vertical's UI client + REST scaffolds are already deployed into \`src/\`; one vertical per capability under \`references/<vertical>/\`, each with a \`seed/\` module that creates content over the connector:
18 - **storefront** — sell physical or digital products online.
19 - **bookings** — let customers book appointments or services with your business.
20 - **blog** — publish articles for visitors to read.
21 - **forms** — any visitor-fillable form: contact/enquiry, lead, signup, waitlist, application, feedback/survey, quote request, intake or registration. **Not forms** — an event or occasion RSVP is **events** (built-in RSVP registration form), and a per-service booking form is **bookings**.
22 - **cms** — model and serve your own custom, structured content — for anything the other verticals don't cover. **Not cms** — a visitor-fillable form is **forms**; reach for cms only when the app must read the entries back.
23 - **portfolio** — showcase creative work in collections and project pages.
24 - **pricing-plans** — sell memberships or subscriptions to your service.
25 - **events** — publish events and handle RSVPs or ticket sales.
26 - **members** — let visitors create an account and sign in — this is **auth**.
27 - **restaurants** — publish a menu, take online orders, and manage table reservations.
28- **Documentation fallback** for **frontend code**, **backend code**, or **runtime / API management operations** alike: consult the official Wix API documentation using the documentation skill available in your environment.
29`;
30
31const amd = '/app/AGENTS.md';
32const cur = existsSync(amd) ? readFileSync(amd, 'utf8') : '';