create-site · microsoft — Claude Code skill: build a Power Pages site
The create-site skill walks through building a Power Pages site, from picking a template and SPA framework to provisioning, design, and deployment.
MIT ★ 1,167 updated 2026-10-29
/plugin marketplace add microsoft/power-platform-skills
/plugin install power-pages@power-platform-skillsWhat create-site does
The skill provisions a new Power Pages site from an SPA or non-SPA template, or scaffolds an SPA from the ground up with React, Angular, Vue, or Astro. It covers the whole path: gathering requirements, picking a template, provisioning, shaping the design, validating the result, and deploying.
On the SPA path, the dev server starts right after requirements discovery, and the skill drives a live preview through Playwright while pages and components get built — each one lands as its own commit, so a bad change is easy to roll back. Progress gets written to scaffold-status.json, which the loading screen reads. Next.js, Nuxt.js, Remix, and SvelteKit are outside the supported SPA frameworks.
For a non-SPA site built on Liquid and Web Templates, a separate workflow applies with no dev server and no live preview step.
What it helps with
- pick between an SPA and a non-SPA Power Pages template
- scaffold an SPA site with React, Angular, Vue, or Astro
- walk through provisioning and deploying a new site
- get a live preview of pages while building them
- keep one design consistent across every page
Example prompts for the agent
- Create a new Power Pages site with a React SPA
- Build a portal site from a non-SPA Liquid and Web Templates template
- Scaffold an Astro SPA for a client portal
How to install create-site
1Plugin marketplace
/plugin marketplace add microsoft/power-platform-skills/plugin install power-pages@power-platform-skillsThis installs the whole power-pages plugin with all its skills
2Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill create-site -a claude-code3Manually: put the files in place
~/.claude/skills/create-site/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/create-site/
1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill create-site -a codex2Manually: put the files in place
.agents/skills/create-site/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill create-site -a cursor2Manually: put the files in place
.cursor/skills/create-site/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install microsoft/power-platform-skills plugins/power-pages/skills/create-site2Manually: put the files in place
.github/skills/create-site/SKILL.md1Skills CLI (Vercel)
npx skills add microsoft/power-platform-skills --skill create-site -a gemini-cli2Platform CLI
gemini skills install https://github.com/microsoft/power-platform-skills --path plugins/power-pages/skills/create-siteManually: put the files in place
.devin/skills/create-site/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about create-site
How do I install create-site in Claude Code?
Run /plugin marketplace add microsoft/power-platform-skills, then /plugin install power-pages@power-platform-skills.
What does create-site do?
It walks through building a Power Pages site: choosing between an SPA template (React, Angular, Vue, Astro) or a non-SPA one (Liquid + Web Templates), then provisioning, design, validation, and deployment.
Which SPA frameworks does create-site support?
React, Angular, Vue, and Astro. Next.js, Nuxt.js, Remix, and SvelteKit are not supported.
Source text
SKILL.md · MIT
---
name: create-site
description: >-
Creates a new Power Pages site from an SPA or non-SPA template, or scaffolds an SPA from scratch
using React, Angular, Vue, or Astro. Guides requirements discovery, template selection,
provisioning, design, validation, and deployment. Use when the user wants to create, build, use
a template for, or scaffold a new Power Pages website or portal.
user-invocable: true
argument-hint: Optional site description
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, WebSearch, AskUserQuestion, Task, TaskCreate, TaskUpdate, TaskList, Skill, mcp__plugin_power-pages_playwright__browser_navigate, mcp__plugin_power-pages_playwright__browser_snapshot, mcp__plugin_power-pages_playwright__browser_click, mcp__plugin_power-pages_playwright__browser_take_screenshot, mcp__plugin_power-pages_playwright__browser_evaluate
model: opus
---
> **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.md` under `${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](#57-design-critique-pass)); 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 every `AskUserQuestion` (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](#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](#53-source-purposeful-visuals)). 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`, LCID `1033`) 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.md` so 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
<!-- not-a-gate: prose-only section — mentions of `AskUserQuestion` here describe the live-status protocol that wraps every real prompt in Phases 3/4/8; the actual gates are catalogued in §6.13 of references/approval-gates.md and marked at their call sites below -->
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):
```json
{
"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` — when `true`, a prominent pulsing banner appears at the top of the loader and stays visible until this field is cleared. Set this **before** every `AskUserQuestion` call 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**:
1. **After scaffold launches (end of Phase 2)**: write an initial status like `{ "message": "Planning your site", "awaitingInput": false }`.
2. **Before any `AskUserQuestion` that runs while the scaffold is visible** (Phases 3, 4, and any in-scaffold prompt in Phase 5): set `awaitingInput: true` with a short `inputPrompt`. After the user answers, write again with `awaitingInput: false`.
3. **Before each implementation step in Phase 5** — applying design tokens, creating each shared component, creating each page, updating the router, updating navigation — update `message` to the specific action. Examples: `"Applying design tokens"`, `"Creating Navbar component"`, `"Creating Contact page"`.
4. **At the end of Phase 5, after the Home page has been replaced**: delete `public/scaffold-status.json` so 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: create-site:1.purpose | category=plan | cancel-leaves=nothing -->
> 🚦 **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.
1. Create the minimal upfront todo list (see [Progress Tracking](#progress-tracking)):
- Discover site requirements
- Select template or choose from-scratch
2. If site name, purpose, and audience are clear from arguments:
- Summarize understanding
- Identify site type (portal, dashboard, landing page, blog, etc.)
3. 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) |
4. 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)
5. 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**:
1. Mark **Select template or choose from-scratch** as `in_progress`.
2. Fetch the shared template catalog:
```bash
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:
```bash
node "${PLUGIN_ROOT}/skills/create-site/scripts/list-site-templates.js" \
--modelVersion Enhanced --bootstrapVersion 5
```
Build one `SELECTABLE_TEMPLATES` collection:
- Add every SPA family from `selectableCatalog.templates` with category `SPA`.
- Add every entry from the non-SPA result's `catalog.templates` with `kind: "non-spa"`,
category `Non-SPA`, its `previews`, and its exact `name` provisioning 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.
3. Semantically match `SELECTABLE_TEMPLATES` against 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`).
<!-- not-a-gate: read-only route selection after semantic matching; no project directory, Dataverse write, or durable skill state exists yet -->
4. 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_FAMILIES` to the matched family or families and continue to browser preview.
- **Browse all templates**: set `TEMPLATE_PREVIEW_FAMILIES` to every SPA and non-SPA entry in
`SELECTABLE_TEMPLATES` and continue to browser preview.
- **Create from scratch**: set `CREATION_PATH = "from-scratch"` and continue to the deferred framework/location questions.
5. Render `TEMPLATE_PREVIEW_FAMILIES` for browser preview:
- Download each `previewImages` artifact into the SHA-keyed cache before rendering:
```bash
node "${PLUGIN_ROOT}/scripts/fetch-template-artifact.js" --sha "<catalog-sha>" --artifactPath "<preview-image-path>"
```
Replace each preview image path with the returned `localUrl`. If a preview download returns `ok: 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_JSON` array with the templates the user
should preview. Preserve `kind` so the HTML shows `SPA` or `Non-SPA` beside every template
name. Include SPA variants and cached `previewImages`; include non-SPA responsive `previews`
unchanged. Keep the browser read-only.
- Run:
```bash
node "${PLUGIN_ROOT}/scripts/render-template-browser.js" --templatesJsonPath "<temp-json>" --outputPath "<temp-html>" --open
```
Evaluate the JSON result before telling the user to use the browser:
- **`status: "ok"`**: continue; the browser preview was generated and opened.
- **`status: "invalid"`**: do not continue with template selection. Surface the validation errors, rebuild the `TEMPLATES_JSON` file 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"` with `opened: 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 `AskUserQuestion` remains the decision surface.
<!-- not-a-gate: read-only route selection after template preview; only disposable temp preview files exist, with no project directory, Dataverse write, or durable skill state -->
6. Ask one of the following `AskUserQuestion` prompts:
| Match situation | Prompt options |
|-----------------|----------------|
| One strong family + framework match | Use `<displayName>` - `<framework>` (Recommended), Choose another framework, See all templates, Start from scratch |
| One 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 `<displayName> (<SPA|Non-SPA>)`, Start from scratch |
When the user chooses **See all templates** from a matching-template branch, set
`TEMPLATE_PREVIEW_FAMILIES` to all entries in `SELECTABLE_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.
7. Branch on the user's selection:
- **Non-SPA template selected**: set `PRESELECTED_NON_SPA_TEMPLATE_NAME` to its exact `name`,
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**:
1. Set `SELECTED_TEMPLATE` to the family entry and `SELECTED_TEMPLATE_VARIANT` to 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:
```bash
node "${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 || [])>'
```
Use the returned `websiteCodePath` and `solutions`. Process `solutions` in the returned order; do not rediscover, reorder, or revalidate the template assets in the skill.
2. 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 emit `template_used` for a variant whose package did not validate. If the user falls back to from-scratch, recommend the framework they had selected.
3. If the result is `ok: true`, set `CREATION_PATH = "template"`, `SELECTED_TEMPLATE_SOLUTIONS = <result.solutions>`, and `SELECTED_TEMPLATE_WEBSITE_CODE = <result.websiteCodePath>`. Run the `template_used` telemetry command silently (fail-closed), then append the template pre-install tasks now (see [Progress Tracking](#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.
```bash
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>"
```
`--audience` is the site audience captured in Phase 1 (`internal` or `external`), **not** the template's `audience` persona array from the catalog manifest. Do not include site name, URL, subdomain, free-text purpose, or any other user-identifying value.
4. Mark **Choose local template directory** as `in_progress`.
<!-- not-a-gate: read-only location selection for the later template clone; no directory is created and no environment change has started -->
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.
8. For the template path only:
1. Mark **Resolve target environment** as `in_progress`.
2. Resolve the target environment via the shared auth helpers:
```bash
node "${PLUGIN_ROOT}/scripts/resolve-template-import-context.js"
```
Use the returned `environmentUrl` for 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. If `ok: false`, surface the error and stop before import. Do not emit `template_import_failure` because no import was attempted; `template_used` was already emitted when the template path was selected.
<!-- gate: create-site:1.5.confirm-environment | category=consent | cancel-leaves=template-cache -->
> 🚦 **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.js` returns `environmentUrl` and before any CLI-tenant, `.js` unblock, 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.
3. Mark **Resolve target environment** as `completed` and **Confirm target environment** as `in_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_failure` because no import was attempted; `template_used` was already emitted when the template path was selected.
4. Mark **Confirm target environment** as `completed` and **Validate CLI tenant alignment** as `in_progress`, then confirm PAC CLI and Azure CLI are authenticated to the same tenant before any import preflight that depends on both CLIs:
```bash
node "${PLUGIN_ROOT}/scripts/validate-cli-tenant-alignment.js" --envUrl "<environmentUrl>"
```
- **`ok: true`**: mark **Validate CLI tenant alignment** as `completed`.
- **`ok: false`**: surface the error and the `pacTenantId`, `azTenantId`, and `tokenTenantId` fields 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 emit `template_import_failure` because no import was attempted.
5. Mark both **Validate JavaScript unblock requirement** and **Validate Dataverse language requirements** as `in_progress`. Run the `.js` blocked-attachment dry run and the Dataverse language check in parallel because both are read-only preflights against the confirmed target environment:
```bash
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 `blockedattachments` until the language check has also completed; if the language check blocks import, route to the language-requirement question without changing attachment settings.
Evaluate the `.js` result:
- **`wasBlocked` does not include `js`**: mark **Validate JavaScript unblock requirement** as `completed`; JavaScript attachments are allowed.
- **`wasBlocked` includes `js`**: keep **Validate JavaScript unblock requirement** as `in_progress`; this may need the `.js` unblock consent gate below, but handle language failures first because they block import without any environment mutation.
Evaluate the language result:
- **`ok: true` and `hasRequiredLanguages: true`**: mark **Validate Dataverse language requirements** as `completed`; 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 mutate `blockedattachments`.
- **`ok: true` and `hasRequiredLanguages: false`**: explain that the selected template requires the missing Dataverse language LCIDs from `missingLocaleIds`. Block before any solution import mutation. Do not provide a "proceed anyway" branch and do not mutate `blockedattachments`.
<!-- gate: create-site:1.5.unblock-js | category=consent | cancel-leaves=attachment-block-modified -->
> 🚦 **Gate (consent · create-site:1.5.unblock-js):** Preflight unblock of `.js` from the target environment's `blockedattachments` setting before uploading website code.
>
> **Trigger:** Phase 1.5 when `fix-blocked-attachments.js --dry-run --extensions js` reports `.js` is blocked in the target environment.
> **Why we ask:** The packaged SPA is uploaded with `pac pages upload-code-site` after its supporting solutions are ready. That upload includes JavaScript files and fails when `.js` is blocked. Checking before solution import avoids leaving supporting artifacts behind when the site cannot be created.
> **Cancel leaves:** `attachment-block-modified` is possible only if the user approved and the update partially completed. Pure Cancel here leaves the original `blockedattachments` value 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.
<!-- not-a-gate: route selection after a blocking preflight; no org mutation has happened and there is no option to override missing template language requirements -->
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: create-site:1.5.template-import | category=consent | cancel-leaves=template-cache -->
> 🚦 **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 down...
© Microsoft · MIT · microsoft/power-platform-skills
Similar skills
All skills for Frontend and UI →create-site by other authors comes first.