🦞 igor-claw: guard wix-headless create against orphaning an existing project - #943
Open
ayal wants to merge 1 commit into
Open
🦞 igor-claw: guard wix-headless create against orphaning an existing project#943ayal wants to merge 1 commit into
ayal wants to merge 1 commit into
Conversation
…existing project If a prompt names an existing Wix project (siteId/clientId/dashboard URL) but CWD is empty, operation resolution fell straight to `create`, which always provisions a brand-new site via `npm create @wix/new` — there is no CLI/skill path to attach a local scaffold to a project provisioned elsewhere (e.g. the self-managed "sign up" quick start, or a dashboard-created headless client). Neither side raises an error, so the user ends up with two disconnected, fully-functional projects and no signal anything went wrong. Add a check before the create fallback: when the prompt supplies an existing project id, stop and ask instead of silently provisioning a second project.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Opened automatically by an AI agent acting on behalf of Ayal (
ayalg@wix.com), researching feedback reported here: https://wix.slack.com/archives/C0BDXM5LLE7/p1786351421451019Root cause: a user following Wix's self-managed "sign up → get a siteId/clientId" quick start, then handing those IDs to an AI agent to "build with an agent," has no supported way to actually use them.
wix-headless/SKILL.md's operation resolution (§ "Resolving the operation") only branches on on-disk signals (wix.config.jsonpresent →iterate; a brought-in design →connect; otherwise →create) and never inspects the prompt for a pre-existing Wix project id. On an empty directory it always falls tocreate, which runsnpm create @wix/new@latest -- headless— this always provisions a brand-new site, silently ignoring any siteId/clientId the user already has (confirmed: neitherinit,link, nor bareheadlessexposes a flag to attach to an existing site —npm create @wix/new@latest -- headless init --help/link --help).Neither side raises an error — the new project is fully valid on its own — so the user ends up with two disconnected, fully-functional Wix projects and no signal that anything went wrong. It's only diagnosable by comparing
wix.config.json/ dashboard artifacts between the project they expected and the one the agent actually created.Fix: add a check before the
createfallback inskills/wix-headless/SKILL.md. If the prompt names an existing project (siteId, clientId, amanage.wix.com/dashboard/<id>or Headless Settings URL, or explicit "use my existing site/client ID" language), stop and ask instead of silently provisioning a second project — since there's currently no CLI/skill path to attach to it either way.This is a skill-behavior fix (not a CLI feature), scoped to preventing the silent-duplicate-project outcome; adding an actual "attach to existing site" capability to
npm create @wix/newis a separate, larger product decision left out of scope here.Test plan
CREATE.mdcreate/connect/iteraterouting is unaffected when no existing-project id is present in the prompt