Plugin check: Run
node "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Create Power Pages Site
Guide the user through creating a complete Power Pages site. Keep discovery and template browsing path-agnostic, then route the selected SPA or non-SPA creation path to its own provisioning steps.
Core Principles
- Design for the first impression: The site must make the user say "wow" the moment the Home page replaces the scaffold, and keep earning it on every page. Once the user answers the aesthetic, mood, and brand questions, make confident decisions about fonts, colors, layouts, imagery, and motion yourself - the design references (
design-aesthetics.md,page-blueprints.md,design-critique.mdunder${PLUGIN_ROOT}/references/) define the bar, and your own taste fills the rest. - Use TaskCreate/TaskUpdate: Track all progress throughout all phases — create the path-agnostic upfront tasks first, then append branch-specific tasks after the creation path is selected.
- Scaffold early, design with intention: Get the dev server running immediately after discovery so the user has something to look at. Then plan the design and features while the scaffold is live — apply the chosen aesthetic during implementation.
- Live preview feedback loop: The dev server MUST be running before any customization begins. Browse the site via Playwright (
browser_navigate+browser_snapshot) to verify the structure of every significant change. Visual design review captures every page with one script call and opens the screenshots in one turn (see 5.7); use Playwright MCP screenshots only for brand extraction in Phase 3. - Keep the scaffold loader in sync with reality: The scaffold loader polls
public/scaffold-status.json. Update this file before everyAskUserQuestion(to raise the "waiting for your input" banner so the user doesn't miss a terminal prompt) and before each implementation step in Phase 5 (so the progress-bar label matches what you're actually doing while the decorative spinner continues its default cycle). See Live Preview Status Protocol. - Use purposeful visuals: Every image explains, orients, demonstrates, or reinforces identity. Prefer the site's own UI composed as a product moment, then bespoke inline SVG, then specific Unsplash photography with one art direction (see 5.3). Never leave image placeholders or broken
<img>tags pointing to nonexistent files. - Git checkpoints: Commit after every individual page and component — each gets its own commit so breaking changes can be reverted.
- Site content language is independent of Dataverse language: Generate every user-visible SPA string in the approved content language. Dataverse and Power Pages platform-managed messages remain English (
en-US, LCID1033) in this workflow. - Bidirectional by default: Read
${PLUGIN_ROOT}/references/bidirectional-design.md. Every site must use direction-neutral layout, mixed-content boundaries, and script-capable typography even when its initial language has only one direction. A later LTR/RTL locale must not require a general redesign. - Lifecycle-ready output: Follow
${PLUGIN_ROOT}/references/site-modification-integrity.mdso later pages and components can preserve localization, direction, and content-expansion behavior through the shared post-modification validator. - Path-specific design rules: Read
${PLUGIN_ROOT}/references/site-design-quality.md. SPA paths use the live scaffold workflow below. Non-SPA sites need no dev server or live preview and follow their dedicated workflow. - Non-SPA route: When the user selects Non-SPA (Liquid + Web Template) or a non-SPA template, read and follow
${PLUGIN_ROOT}/skills/create-site/workflows/non-spa-site.md. Do not continue into the SPA scaffold phases.
Supported paths: static SPA frameworks (React, Vue, Angular, Astro) and Enhanced-model non-SPA sites using Liquid + Web Templates. Next.js, Nuxt.js, Remix, and SvelteKit are not supported.
Initial request: $ARGUMENTS
Live Preview Status Protocol
While the scaffold loading screen is visible (from Phase 2.6 until the Home page itself is replaced in Phase 5), the loader polls GET /scaffold-status.json every 1.5 seconds. The message you write into <PROJECT_ROOT>/public/scaffold-status.json appears as the label under the progress bar, and awaitingInput controls the "waiting for your input" banner. The decorative spinner above the progress bar continues its built-in phrase cycle; keep the progress-bar label current so the loader still reflects what is actually happening.
Why this matters: When the browser with the loader takes over the user's screen, a prompt in the terminal can sit unanswered for a long time because the user doesn't realize anything is waiting. The banner makes it obvious.
File shape (all fields optional — omit any field you don't want to change):
{
"message": "Creating Contact page",
"awaitingInput": false,
"inputPrompt": "Please check your terminal to respond."
}
message— one short present-participle phrase shown as the status line under the progress bar in the loader (replacing the default "Getting started…" / "Setting up infrastructure…" cycle). Include the grouping context inline when it helps (e.g.,"Creating Footer component (shared components)").awaitingInput— whentrue, a prominent pulsing banner appears at the top of the loader and stays visible until this field is cleared. Set this before everyAskUserQuestioncall and clear it (false) immediately after the user answers.inputPrompt— short context for the banner (e.g.,"Choose a framework"). Optional.
When to update the file:
- After scaffold launches (end of Phase 2): write an initial status like
{ "message": "Planning your site", "awaitingInput": false }. - Before any
AskUserQuestionthat runs while the scaffold is visible (Phases 3, 4, and any in-scaffold prompt in Phase 5): setawaitingInput: truewith a shortinputPrompt. After the user answers, write again withawaitingInput: false. - Before each implementation step in Phase 5 — applying design tokens, creating each shared component, creating each page, updating the router, updating navigation — update
messageto the specific action. Examples:"Applying design tokens","Creating Navbar component","Creating Contact page". - At the end of Phase 5, after the Home page has been replaced: delete
public/scaffold-status.jsonso it isn't deployed with the site.
Write the file with the Write tool (atomic overwrite). You do not need to read it first.
Phase 1: Discovery
Goal: Understand what site needs to be built and what problem it solves
Actions:
🚦 Gate (plan · create-site:1.purpose): Path-agnostic discovery prompt collecting site name, purpose, and audience. Determines what kind of site the user needs before the skill decides between a template-backed path and the from-scratch scaffold path. Fires only on the "site purpose unclear" branch (step 3 below).
Trigger: Phase 1 when site name, purpose, or audience was not provided in
$ARGUMENTS. Why we ask: Wrong purpose/audience context → wrong branch decision and wrong generated site plan; cleanup is annoying. Cancel leaves: Nothing — no scaffolding has started yet.
Create the minimal upfront todo list (see Progress Tracking):
- Discover site requirements
- Select template or choose from-scratch
If site name, purpose, and audience are clear from arguments:
- Summarize understanding
- Identify site type (portal, dashboard, landing page, blog, etc.)
If site name, purpose, or audience is unclear, use
AskUserQuestion:Question Header Options What should the site be called? (e.g., "Contoso Portal", "HR Dashboard") Site Name (free text — use a single generic option so the user types a custom name via "Other") What is the site's purpose? Purpose Company Portal, Blog/Content, Dashboard, Landing Page Who is the target audience? Audience Internal (employees, partners), External (public-facing customers) From the user's answers, derive:
__SITE_NAME__(Title Case, e.g.,Contoso Portal)- A preliminary
__SITE_SLUG__(lowercase ASCII kebab-case derived from the site name when possible)
Summarize the path-agnostic understanding and confirm with user before proceeding:
- Site name
- Site purpose/type
- Target audience
Do not ask for framework or project location in Phase 1. Each creation path asks for its location after Phase 1.5 selects that path.
Audience influences site generation:
- Internal: Prioritize task completion - status, the next action, data tables, dashboards, authentication, navigation depth. The wow comes from clarity, density done right, and polish in the details rather than marketing heroes.
- External: Prioritize a striking first impression, a persuasive page narrative with proof at the point of doubt, SEO-friendly structure, and contact forms.
Output: Clear statement of site purpose, audience, site name, and preliminary technical slug.
Phase 1.5: Template Branch Decision
Goal: Route the user into the appropriate creation path after path-agnostic Discovery.
Actions:
Mark Select template or choose from-scratch as
in_progress.Fetch the shared template catalog:
node "${PLUGIN_ROOT}/scripts/fetch-template-catalog.js"Use the returned immutable commit SHA for every template artifact request in this run. Pass
--ref <tag-or-branch>only for a deliberate test or rollback.Also load the supported non-SPA entries from the same pinned catalog:
node "${PLUGIN_ROOT}/skills/create-site/scripts/list-site-templates.js" \ --modelVersion Enhanced --bootstrapVersion 5Build one
SELECTABLE_TEMPLATEScollection:- Add every SPA family from
selectableCatalog.templateswith categorySPA. - Add every entry from the non-SPA result's
catalog.templateswithkind: "non-spa", categoryNon-SPA, itspreviews, and its exactnameprovisioning identifier. - Keep the pinned owner, repository, and commit SHA returned by the non-SPA result with those entries.
If one catalog path fails, continue with the other path and explain which category is temporarily unavailable. Continue from scratch only when no templates remain.
- Add every SPA family from
Semantically match
SELECTABLE_TEMPLATESagainst the Phase 1 context ($ARGUMENTS, site name, purpose, audience, and any framework mentioned by the user):- Use each template's category,
displayName,description, keywords, audience, capabilities, available SPA variants, and previews. - For non-SPA templates, treat the template as data-model/domain context and requirements guidance, not a visual constraint. Carry explicit preservation preferences into customization.
- Do not compute a numeric score or invent a ranking script. Keywords guide agent judgement; they are not counted.
- Treat a template family as the user-facing template and a framework variant as the installable package. A family can have multiple variants (
react,vue,angular,astro).
- Use each template's category,
Ask the user how to proceed after semantic matching:
Match situation Question Header Options One or more clear matches I found matching template(s) for your site. What would you like to do? Creation Path Show matching templates (Recommended), Browse all templates, Create from scratch No clear match I couldn't find a matching template for your site. What would you like to do? Creation Path Browse all templates, Create from scratch (Recommended) Branch on the answer:
- Show matching templates: set
TEMPLATE_PREVIEW_FAMILIESto the matched family or families and continue to browser preview. - Browse all templates: set
TEMPLATE_PREVIEW_FAMILIESto every SPA and non-SPA entry inSELECTABLE_TEMPLATESand continue to browser preview. - Create from scratch: set
CREATION_PATH = "from-scratch"and continue to the deferred framework/location questions.
- Show matching templates: set
Render
TEMPLATE_PREVIEW_FAMILIESfor browser preview:- Download each
previewImagesartifact into the SHA-keyed cache before rendering:
Replace each preview image path with the returnednode "${PLUGIN_ROOT}/scripts/fetch-template-artifact.js" --sha "<catalog-sha>" --artifactPath "<preview-image-path>"localUrl. If a preview download returnsok: false, omit that one image from the gallery and continue; a missing preview should not block using an otherwise-valid template. - Write a temporary JSON file containing a
TEMPLATES_JSONarray with the templates the user should preview. Preservekindso the HTML showsSPAorNon-SPAbeside every template name. Include SPA variants and cachedpreviewImages; include non-SPA responsivepreviewsunchanged. Keep the browser read-only. - Run:
Evaluate the JSON result before telling the user to use the browser:node "${PLUGIN_ROOT}/scripts/render-template-browser.js" --templatesJsonPath "<temp-json>" --outputPath "<temp-html>" --openstatus: "ok": continue; the browser preview was generated and opened.status: "invalid": do not continue with template selection. Surface the validation errors, rebuild theTEMPLATES_JSONfile from the matched families, and rerun the render. If it is still invalid, fall back to from-scratch rather than showing an empty or incomplete template browser.status: "ok"withopened: false: the HTML validated but the browser could not be opened automatically. Show the file path and continue with terminal selection only after the user has had a chance to open it manually.
- The browser view is read-only and exists to browse template capabilities and available framework variants; the terminal
AskUserQuestionremains the decision surface.
- Download each
Ask one of the following
AskUserQuestionprompts:Match situation Prompt options One strong family + framework match Use <displayName>-<framework>(Recommended), Choose another framework, See all templates, Start from scratchOne strong family but no framework match One option per available framework, See all templates, Start from scratch Several plausible family matches One option per shortlisted family, See all templates, Start from scratch Full catalog browse One option per template formatted as ` (<SPA When the user chooses See all templates from a matching-template branch, set
TEMPLATE_PREVIEW_FAMILIESto all entries inSELECTABLE_TEMPLATES, render the combined gallery, and ask again with the Full catalog browse options. If the selected SPA family has multiple variants, ask a second terminal question for the framework.Branch on the user's selection:
- Non-SPA template selected: set
PRESELECTED_NON_SPA_TEMPLATE_NAMEto its exactname, retain its pinned catalog coordinates, read${PLUGIN_ROOT}/skills/create-site/workflows/non-spa-site.md, and follow that workflow. Do not continue into the SPA template or from-scratch phases. - Template family and framework variant selected:
- Set
SELECTED_TEMPLATEto the family entry andSELECTED_TEMPLATE_VARIANTto the exact framework variant. Resolve the selected template assets once from the pinned catalog SHA. The result combines the family's supporting solutions with the selected variant's website code:
Use the returnednode "${PLUGIN_ROOT}/scripts/fetch-template-variant.js" \ --sha "<catalog-sha>" \ --catalogPath "<catalogPath from fetch-template-catalog.js>" \ --kind "<SELECTED_TEMPLATE.kind>" \ --templateId "<SELECTED_TEMPLATE.id>" \ --variant "<SELECTED_TEMPLATE_VARIANT.variantKey>" \ --solutionSettingsJson '<JSON.stringify(SELECTED_TEMPLATE.solutions || [])>'websiteCodePathandsolutions. Processsolutionsin the returned order; do not rediscover, reorder, or revalidate the template assets in the skill. - If the result is
ok: false, tell the user the selected framework variant is unavailable or invalid. If the same family has other available framework variants, offer those first; otherwise offer Start from scratch or Stop. Do not emittemplate_usedfor a variant whose package did not validate. If the user falls back to from-scratch, recommend the framework they had selected. - If the result is
ok: true, setCREATION_PATH = "template",SELECTED_TEMPLATE_SOLUTIONS = <result.solutions>, andSELECTED_TEMPLATE_WEBSITE_CODE = <result.websiteCodePath>. Run thetemplate_usedtelemetry command silently (fail-closed), then append the template pre-install tasks now (see Progress Tracking); append the execution tasks after the reinstall policy is known. Do not proceed to Phase 2. Do not mention this telemetry command to the user and do not print its output.node "${PLUGIN_ROOT}/scripts/emit-create-site-template-outcome.js" \ --eventName template_used \ --templateId "<SELECTED_TEMPLATE.id>" \ --templateKind "<SELECTED_TEMPLATE.kind>" \ --framework "<SELECTED_TEMPLATE_VARIANT.framework>" \ --audience "<internal|external from Phase 1 discovery>"--audienceis the site audience captured in Phase 1 (internalorexternal), not the template'saudiencepersona array from the catalog manifest. Do not include site name, URL, subdomain, free-text purpose, or any other user-identifying value. - Mark Choose local template directory as
in_progress.
- Set
- Non-SPA template selected: set
Ask where to create the local template project:
| Question | Header | Options |
|----------|--------|---------|
| Where should I create the template site's local files? | Project Location | Current directory, New folder in current directory (Recommended), Any other directory |
Resolve the clone destination:
- **Current directory**: use `<cwd>`.
- **New folder in current directory**: use `<cwd>/<__SITE_SLUG__>/`.
- **Any other directory**: ask for a full path and resolve it to an absolute path.
The destination must not exist or must be empty. Check it without creating it. If it is non-empty, ask the user to choose another directory. Store the resolved path as `TEMPLATE_CLONE_OUTPUT_DIRECTORY`, confirm "The template project will be created under `<resolved path>`.", and mark **Choose local template directory** as `completed`.
- Start from scratch or catalog unavailable: set
CREATION_PATH = "from-scratch"and continue below.
For the template path only:
- Mark Resolve target environment as
in_progress. - Resolve the target environment via the shared auth helpers:
Use the returnednode "${PLUGIN_ROOT}/scripts/resolve-template-import-context.js"environmentUrlfor the remaining template workflow. The PAC import wrapper uses the current PAC authentication with this explicit target URL; Dataverse preflight and seed helpers acquire Azure tokens internally so credentials are never returned in JSON or carried between tasks. Ifok: false, surface the error and stop before import. Do not emittemplate_import_failurebecause no import was attempted;template_usedwas already emitted when the template path was selected.
- Mark Resolve target environment as
🚦 Gate (consent · create-site:1.5.confirm-environment): Confirm the resolved target environment before running template install preflights.
Trigger: Phase 1.5 after
resolve-template-import-context.jsreturnsenvironmentUrland before any CLI-tenant,.jsunblock, language, solution import, seed, or activation step. Why we ask: PAC auth can point at a different Dataverse environment than the user intended. Even preflights can inspect or modify environment-level settings, so the skill must not continue silently. Cancel leaves:template-cache— template catalog assets, the discovered solution sources, and website code may already be cached locally; no org mutation has happened if cancelled here.
Mark Resolve target environment as
completedand Confirm target environment asin_progress, then ask the user to confirm the resolved target environment before any environment preflight:Question Header Options Use <environmentUrl>as the target environment for this template install?Confirm Environment Yes, use this environment (Recommended), No, start from scratch, Cancel - Yes: continue to the preflight checks below.
- No, start from scratch: set
CREATION_PATH = "from-scratch"and continue to the deferred framework/location questions. Do not run environment preflights or import the template. - Cancel: stop before environment preflights. Do not emit
template_import_failurebecause no import was attempted;template_usedwas already emitted when the template path was selected.
Mark Confirm target environment as
completedand Validate CLI tenant alignment asin_progress, then confirm PAC CLI and Azure CLI are authenticated to the same tenant before any import preflight that depends on both CLIs:node "${PLUGIN_ROOT}/scripts/validate-cli-tenant-alignment.js" --envUrl "<environmentUrl>"ok: true: mark Validate CLI tenant alignment ascompleted.ok: false: surface the error and thepacTenantId,azTenantId, andtokenTenantIdfields when present. Stop before import and tell the user to switch either PAC auth or Azure CLI to the same tenant, then rerun the skill. Do not emittemplate_import_failurebecause no import was attempted.
Mark both Validate JavaScript unblock requirement and Validate Dataverse language requirements as
in_progress. Run the.jsblocked-attachment dry run and the Dataverse language check in parallel because both are read-only preflights against the confirmed target environment:node "${PLUGIN_ROOT}/scripts/lib/fix-blocked-attachments.js" --envUrl "<environmentUrl>" --extensions js --dry-run --quiet node "${PLUGIN_ROOT}/scripts/check-available-languages.js" --envUrl "<environmentUrl>" --requiredLocaleIds "<SELECTED_TEMPLATE_VARIANT.requiredDataverseLanguages or SELECTED_TEMPLATE.requiredDataverseLanguages comma-separated>"Capture both JSON results before deciding what to do next. Do not mutate
blockedattachmentsuntil the language check has also completed; if the language check blocks import, route to the language-requirement question without changing attachment settings. Evaluate the.jsresult:wasBlockeddoes not includejs: mark Validate JavaScript unblock requirement ascompleted; JavaScript attachments are allowed.wasBlockedincludesjs: keep Validate JavaScript unblock requirement asin_progress; this may need the.jsunblock consent gate below, but handle language failures first because they block import without any environment mutation. Evaluate the language result:ok: trueandhasRequiredLanguages: true: mark Validate Dataverse language requirements ascompleted; the target environment has every LCID required by the selected variant, falling back to the family requirements when the variant does not override them.ok: false: tell the user the skill could not verify available Dataverse languages, surface the script error, then ask whether to switch to from-scratch or stop. Do not import the template and do not mutateblockedattachments.ok: trueandhasRequiredLanguages: false: explain that the selected template requires the missing Dataverse language LCIDs frommissingLocaleIds. Block before any solution import mutation. Do not provide a "proceed anyway" branch and do not mutateblockedattachments.
🚦 Gate (consent · create-site:1.5.unblock-js): Preflight unblock of
.jsfrom the target environment'sblockedattachmentssetting before uploading website code.Trigger: Phase 1.5 when
fix-blocked-attachments.js --dry-run --extensions jsreports.jsis blocked in the target environment. Why we ask: The packaged SPA is uploaded withpac pages upload-code-siteafter its supporting solutions are ready. That upload includes JavaScript files and fails when.jsis blocked. Checking before solution import avoids leaving supporting artifacts behind when the site cannot be created. Cancel leaves:attachment-block-modifiedis possible only if the user approved and the update partially completed. Pure Cancel here leaves the originalblockedattachmentsvalue untouched and no template installation has started.
Use `AskUserQuestion`:
| Question | Header | Options |
|----------|--------|---------|
| This environment currently blocks `.js` attachments. The template site's code upload will fail unless `.js` is unblocked. Remove only `js` from `blockedattachments` now? | Unblock JavaScript | Yes, unblock `.js` and continue (Recommended), No, start from scratch, Cancel |
- **Yes**: run the helper without `--dry-run`, preserving every other blocked extension:
```bash
node "${PLUGIN_ROOT}/scripts/lib/fix-blocked-attachments.js" --envUrl "<environmentUrl>" --extensions js --quiet
```
Confirm the JSON result has `removed` containing `js` or `changed: true`, then rerun the dry-run check and continue only if `.js` is no longer blocked.
- **No, start from scratch**: set `CREATION_PATH = "from-scratch"` and continue to the deferred framework/location questions. Do not import the template.
- **Cancel**: stop before template installation. Do not emit `template_import_failure` because no import was attempted; `template_used` was already emitted when the template path was selected.
6. Use `AskUserQuestion` only when the language preflight cannot continue:
| Question | Header | Options |
|----------|--------|---------|
| This template requires Dataverse language LCID(s) `<requiredLocaleIds>`, but the target environment is missing `<missingLocaleIds>` or the language check could not be completed. What would you like to do? | Template Language Requirement | Start from scratch (Recommended), Cancel |
- **Start from scratch**: set `CREATION_PATH = "from-scratch"` and continue to the deferred framework/location questions. Do not import the template.
- **Cancel**: stop before template installation. Do not emit `template_import_failure` because no import was attempted; `template_used` was already emitted when the template path was selected.
🚦 Gate (consent · create-site:1.5.template-import): Confirm installing the selected template in the current Power Platform environment.
Trigger: Phase 1.5 after the template variant and its unpacked solutions are downloaded and the target environment is resolved. Why we ask: The install can import unmanaged supporting solutions and create a new code site. Choosing the wrong environment or template is disruptive and cannot be cleanly undone. Cancel leaves:
template-cache— the discovered solution sources and preview images may remain in the private SHA-keyed template cache; no org mutation has occurred.
If the language preflight passed but
.jswas blocked and the user approved/verification passed, mark Validate JavaScript unblock requirement ascompleted. Then mark Confirm template install asin_progress, present the template and environment, and ask:List any supporting solution whose manifest metadata has
publishChanges: true. Explain that those solutions usepac solution import --publish-changesso imported forms, views, and other customizations become visible immediately after import. Disclose that PAC's publication step can also publish other pending customizations in the target environment.Question Header Options Install <SELECTED_TEMPLATE.displayName>into<environmentUrl>? This imports any required unmanaged supporting solutions, runs PAC's publish-changes step for solutions that declare it in the template manifest, clones and builds the website code, and uploads the new code site. The publication step can include other pending customizations in this environment. Seed data is applied before activation when available.Install Template Yes, install this template (Recommended), No, start from scratch, Cancel - No, start from scratch: set
CREATION_PATH = "from-scratch"and continue to the deferred framework/location questions. - Cancel: stop; no org mutation has happened. Do not emit
template_import_failurebecause no import was attempted;template_usedwas already emitted when the template path was selected.
- No, start from scratch: set
Mark Confirm template install as
completed. InitializeTEMPLATE_SOLUTIONS_TO_IMPORT = []andTEMPLATE_SOLUTIONS_TO_SKIP = [], then process every entry inSELECTED_TEMPLATE_SOLUTIONSin the returned order:node "${PLUGIN_ROOT}/scripts/inspect-template-solution.js" --solutionPath "<solution.solutionPath>" node "${PLUGIN_ROOT}/scripts/check-solution-installed.js" --solutionName "<solution.uniqueName>" --envUrl "<environmentUrl>" node "${PLUGIN_ROOT}/scripts/inspect-template-solution.js" --solutionPath "<solution.solutionPath>" --installed "<true|false>" --installedVersion "<version-or-empty>"Do not derive a website name from a solution or expect supporting-solution import to add a
pac pages list -vrow. If metadata inspection returnsok: falseafter variant validation, orcheck-solution-installed.jsexits 1, treat that solution asdecision: "ask"rather than assuming it is absent.decision: "import": append the solution toTEMPLATE_SOLUTIONS_TO_IMPORT.decision: "confirm-update": tell the user that this specific solution has a newer version available and confirm before adding it toTEMPLATE_SOLUTIONS_TO_IMPORT.🚦 Gate (consent · create-site:1.5.update-installed): Confirm updating an already-installed unmanaged template solution. Repeat for each solution that needs an update.
Trigger: Phase 1.5 when one of the selected template solutions is already installed and the downloaded source has a newer version. Loop behavior: Fires once per matching entry in
SELECTED_TEMPLATE_SOLUTIONS; three solutions needing updates require three confirmations. Why we ask: Updating an unmanaged solution merges changes into the environment and cannot be cleanly rolled back. Cancel leaves:template-cache— downloaded template artifacts remain in the private SHA-keyed template cache; no org mutation happens if cancelled.Use
AskUserQuestion:Question Header Options Solution <solution.uniqueName>is installed at version<installedVersion>, and the template contains<availableVersion>. Update it in this environment?Update Solution Yes, update this solution (Recommended), No, cancel If the user declines or cancels, stop before import; no org mutation has happened. Do not emit
template_import_failurebecause no import was attempted;template_usedwas already emitted when the template path was selected. If the user confirms, append this solution toTEMPLATE_SOLUTIONS_TO_IMPORT.decision: "offer-clone": append the same-or-newer solution toTEMPLATE_SOLUTIONS_TO_SKIP.decision: "ask"or detection failure: ask whether to import that solution anyway, start from scratch, or stop.🚦 Gate (consent · create-site:1.5.reinstall-unknown): Confirm whether to import when installed-solution detection failed.
Trigger: Phase 1.5 when
check-solution-installed.jscannot determine whether one selected template solution already exists. Loop behavior: Fires once per unknown entry inSELECTED_TEMPLATE_SOLUTIONS; an answer applies only to the named solution. Why we ask: Importing an unmanaged solution that may already exist can merge components. Cancel leaves:template-cache— downloaded template artifacts remain in the private SHA-keyed template cache; no org mutation happens if cancelled.Use
AskUserQuestion:Question Header Options I couldn't determine whether solution <solution.uniqueName>is installed. Importing it may merge unmanaged components. How would you like to proceed?Solution Install Unknown Import anyway (advanced), Start from scratch (Recommended), Stop Branch on the answer:
- Import anyway: append this solution to
TEMPLATE_SOLUTIONS_TO_IMPORT. - Start from scratch: set
CREATION_PATH = "from-scratch"and continue to the deferred framework/location questions. - Stop: stop before import; no org mutation has happened. Do not emit
template_import_failurebecause no import was attempted;template_usedwas already emitted when the template path was selected.
- Import anyway: append this solution to
Append the full site-install tasks. Include Import template supporting solutions only when
TEMPLATE_SOLUTIONS_TO_IMPORTis non-empty. If every solution was skipped, ask once before creating the site:🚦 Gate (consent · create-site:1.5.clone-existing): Confirm creating a new site while reusing already-installed supporting solutions.
Trigger: Phase 1.5 when every selected template solution is installed at the same or a newer version. Why we ask: The skill will skip all solution imports but still clone and upload a new code site. Cancel leaves:
template-cache— downloaded template artifacts remain in the private SHA-keyed template cache; no site clone/upload happens if cancelled.Question Header Options All supporting solutions are already installed at the same or newer versions. Create a new <SELECTED_TEMPLATE_VARIANT.framework>site from the website code?Create Template Site Yes, create the site (Recommended), No, cancel If the user confirms, set
SKIP_TEMPLATE_SOLUTION_IMPORT = true. If the user declines, stop. Do not emit an import result event because no solution import was attempted.Render and open a read-only status page:
# Create <temp-import-status-dir>/ under the operating-system temporary directory, # then write this initial status JSON to <temp-import-status-dir>/status.json: # Import path: # Use "Installing solution" when TEMPLATE_SOLUTIONS_TO_IMPORT has one entry, # otherwise use "Installing solutions": # { "state": "running", "phase": "solution", "message": "<solution install label>" } # SKIP_TEMPLATE_SOLUTION_IMPORT path: # { "state": "running", "phase": "site", "message": "Preparing template site" } node "${PLUGIN_ROOT}/scripts/render-template-import-status.js" \ --templateName "<SELECTED_TEMPLATE.displayName>" \ --templateDescription "<SELECTED_TEMPLATE.description>" \ --statusPath "<temp-import-status-dir>/status.json" \ --previewImagesJson '<JSON array of SELECTED_TEMPLATE.previewImages localUrl values from the template browser step>' \ --solutionCount "<TEMPLATE_SOLUTIONS_TO_IMPORT.length, or SELECTED_TEMPLATE_SOLUTIONS.length when imports are skipped>" \ --outputPath "<temp-import-status-dir>/index.html" node "${PLUGIN_ROOT}/scripts/serve-static-dir.js" --root "<temp-import-status-dir>" --urlFile "<temp-import-status-dir>/url.txt" --cleanupRoot node "${PLUGIN_ROOT}/scripts/open-url.js" --url "<url from <temp-import-status-dir>/url.txt>"Reuse the already-downloaded local preview image URLs from the browser step; do not fetch preview images again for this page. Name device-specific captures
desktop-<page>.<ext>andmobile-<page>.<ext>so the status page can pair them. Unprefixed images count as desktop previews, and the Mobile control appears only when a mobile-prefixed image is present. The server command returns only after the listener is ready. It removes the temporary status directory after a successful redirect, after the browser stops polling, or when the maximum lifetime expires.Unless
SKIP_TEMPLATE_SOLUTION_IMPORT = true, mark Import template supporting solutions asin_progress. ProcessTEMPLATE_SOLUTIONS_TO_IMPORTsequentially in its existing case-insensitive lexical unique-name order. For each entry, setCURRENT_TEMPLATE_SOLUTIONand prepare its unmanaged solution for import:# Update the status JSON: # { "state": "running", "phase": "solution", "message": "Preparing solution <CURRENT_TEMPLATE_SOLUTION.uniqueName>" } node "${PLUGIN_ROOT}/scripts/pack-template-solution.js" \ --solutionPath "<CURRENT_TEMPLATE_SOLUTION.solutionPath>"Set
PACKED_TEMPLATE_SOLUTION_ZIP = <result.zipPath>,PACKED_TEMPLATE_SOLUTION_WORK_DIRECTORY = <result.workDirectory>, `PACKED_TEMPLATE_SOLUTION_CLEANUP_MARKER = <result.clean
…(truncated)