/power-pages:create-webrolesfrom power-pages
Creates and configures web roles for Power Pages SPA and non-SPA sites, controlling user access and permissions including authenticated and anonymous roles.
Ships in power-pages. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Plugin check: Run
node "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Create web roles for a Power Pages SPA site. Web roles define the permissions and access levels for different types of site users.
Non-SPA sites use the same role schema and uniqueness constraints, but their metadata root can
be either <projectRoot>/.powerpages-site or a directly opened PAC export.
Before reading or executing the workflow below, perform the existing SPA project lookup first:
Look for powerpages.config.json in the current directory or immediate subdirectories using the
existing file-search patterns.
If found, continue with the existing SPA workflow below. Do not change its phases, prompts, gates, file naming, caller-suppress contract, or deployment behavior.
Only when that existing SPA lookup finds no powerpages.config.json, run:
node "${PLUGIN_ROOT}/scripts/lib/detect-project-context.js"
If it returns siteType: "non-spa", read and follow
${PLUGIN_ROOT}/skills/create-webroles/references/non-spa-site-workflow.md. Do not execute
any of the SPA workflow below.
Otherwise, continue to Phase 1 and preserve its existing not-found handling.
${PLUGIN_ROOT}/scripts/generate-uuid.js to produce valid UUID v4 values for each web role.anonymoususersrole: true and only one can have authenticatedusersrole: true. Always check existing roles before setting these flags./add-ai-webapi) with the [CALLED-BY-PARENT-SKILL] sentinel in $ARGUMENTS, suppress this skill's deploy prompts (Phase 1's missing-deploy ask, Phase 6's deploy ask (step 3), and the closing reminder) and return as soon as roles are created. The caller batches the deploy at end-of-orchestration. Human invocations never trigger this mode. See Phase 0 below for parsing.Prerequisite: The site must be deployed at least once before web roles can be created, since deployment creates the
.powerpages-sitefolder structure that stores web role definitions.
Initial request: $ARGUMENTS
Inspect $ARGUMENTS. If the text contains the sentinel [CALLED-BY-PARENT-SKILL], set an
internal flag caller-suppress = true that downstream phases consult. The optional token
caller=<skill-name> may follow the sentinel for diagnostic purposes (e.g.
caller=add-ai-webapi); record it for the final summary but do not branch on it.
When the flag is set, skip every deploy prompt this skill would otherwise issue:
.powerpages-site is absent, do NOT ask the user to
deploy now. Stop with a clear contract-violation message back to the caller — the caller
was supposed to gate on this before invoking us./deploy-site"
reminder: skip both. The caller batches the single deploy decision at end-of-orchestration.When the sentinel is absent, proceed exactly as today (full interactive flow). This is the regression guard — no human invocation changes behavior.
.powerpages-site/web-roles/ directoryGoal: Confirm the .powerpages-site/web-roles/ directory exists and is ready for web role files
Actions:
**/powerpages.config.json) and check for .powerpages-site/web-roles/.🚦 Gate (plan · create-webroles:1.deploy-first):
.powerpages-sitemissing — skill cannot proceed without that folder. Prompt to deploy first or stop.Trigger: Phase 1 found no
.powerpages-sitedirectory. Why we ask: Web role YAML files written to a non-existent path will never get picked up by deploy; user thinks roles were created but they weren't. Cancel leaves: Nothing — no YAML files written.
If .powerpages-site does NOT exist:
AskUserQuestion (options: "Yes, deploy now (Recommended)", "No, I'll do it later"). If yes, invoke /deploy-site then resume from Phase 2. If no, stop.If .powerpages-site exists but web-roles/ does NOT: Create the <PROJECT_ROOT>/.powerpages-site/web-roles/ directory.
If both exist: Proceed to Phase 2.
Output: Confirmed .powerpages-site/web-roles/ directory exists and is ready
Goal: Identify all web roles already defined for the site
Actions:
Read all YAML files in the .powerpages-site/web-roles/ directory. Each file represents one web role with this format:
anonymoususersrole: false
authenticatedusersrole: false
id: 778fa3d0-a2ef-4d2b-98b8-e6c7d8ce1444
name: Administrators
Parse each file and compile a list of existing web roles (name, id, and flags).
Present the existing roles to the user:
"I found the following existing web roles in your site:"
- Administrators (id:
778fa3d0-..., authenticated: false, anonymous: false)- (etc.)
If no roles exist yet, inform the user:
"No web roles are currently defined for your site."
Output: Complete list of existing web roles with their names, IDs, and flags
Goal: Decide which new web roles to create based on site needs and user input
Actions:
🚦 Gate (plan · create-webroles:3.role-selection): Multi-select over suggested + custom web roles. Drives the Phase 4 YAML file writes.
Trigger: Phase 2 inventoried existing roles; Phase 3 suggests new ones. Why we ask: Wrong roles get created locally — fixable but adds churn to the
.powerpages-site/web-roles/folder. Cancel leaves: Nothing — no YAML files written yet.
Based on the site's purpose and the existing roles, suggest appropriate web roles. Use AskUserQuestion to confirm with the user.
Common web roles for Power Pages sites include:
authenticatedusersrole: true)anonymoususersrole: true)Ask the user which roles they want to create:
| Question | Options |
|---|---|
| Which web roles would you like to create for your site? You can select from suggestions or describe custom roles. | (Provide relevant suggestions based on site context, existing roles, and business domain) |
CRITICAL: Do NOT suggest roles that already exist. Filter out any existing role names before presenting options.
Allow the user to specify custom role names as well.
Output: Confirmed list of new web roles to create
Goal: Generate properly formatted YAML files with valid UUIDs for each new web role
Actions:
For each new web role the user approved, create a YAML file in .powerpages-site/web-roles/.
For each role, generate a UUID using the Node script. NEVER generate UUIDs yourself — always use the script.
node "${PLUGIN_ROOT}/scripts/generate-uuid.js"
The filename should be the role name in kebab-case with a .yml extension (e.g., Administrators → administrators.yml, Content Editors → content-editors.yml).
Write the file with this exact format (4 fields, no extra whitespace or comments):
anonymoususersrole: <true if this is the anonymous users role, false otherwise>
authenticatedusersrole: <true if this is the authenticated users role, false otherwise>
id: <UUID from generate-uuid.js>
name: <Role Name>
Rules:
anonymoususersrole: trueauthenticatedusersrole: truetrue, do not set it again on a new roleOutput: All new web role YAML files created
Goal: Validate that all created web role files exist, have valid format, and constraints are satisfied
Actions:
List all files in .powerpages-site/web-roles/ and read each new file to confirm they were written correctly.
For each new web role file, verify:
id field contains a valid UUID v4 formatname field matches the expected role nameanonymoususersrole and authenticatedusersrole are valid booleansVerify uniqueness constraints across ALL role files (existing + new):
anonymoususersrole: trueauthenticatedusersrole: trueid values exist across rolesIf any file fails validation, fix the issue before proceeding.
Output: All web role files validated — correct format, valid UUIDs, no constraint violations
Goal: Present a summary of created roles and offer deployment
Actions:
Record skill usage:
Reference:
${PLUGIN_ROOT}/references/skill-tracking-reference.md
Follow the skill tracking instructions in the reference to record this skill's usage. Use --skillName "CreateWebroles".
Present a summary of what was created:
"I've created the following new web roles:"
Role Name ID Anonymous Authenticated Content Editors a1b2c3d4-...false false (etc.)
🚦 Gate (plan · create-webroles:6.deploy): Final post-create prompt — deploy now to make the new roles take effect, or defer.
Trigger: Phase 5 validation succeeded. Why we ask: Auto-invoking
/deploy-sitewould push the site to whatever env PAC CLI happens to point at — wrong-env push is messy to undo. Cancel leaves: Nothing — the YAML files stay on disk; no deploy fired.
In caller-suppress mode (Phase 0 flag): skip the deploy ask and the closing reminder entirely. Return the created-roles summary to the caller and stop. The caller owns the single end-of-orchestration deploy decision; nesting deploy reminders inside delegations gives the user 2–3 redundant prompts per parent-skill run.
Otherwise, ask the user if they want to deploy the site to apply the new roles:
| Question | Options |
|---|---|
| The new web roles have been created locally. To apply them in Power Pages, the site needs to be deployed. Would you like to deploy now? | Yes, deploy now (Recommended), No, I'll deploy later |
If "Yes, deploy now": Tell the user to invoke the deploy skill:
"Please run
/deploy-siteto deploy your site and apply the new web roles."
If "No, I'll deploy later": Acknowledge and remind them:
"No problem! Remember to deploy your site using
/deploy-sitewhen you're ready to apply the new web roles to your Power Pages environment."
Output: Summary presented and deployment offered
.powerpages-site is missingBefore starting Phase 1, create a task list with all phases using TaskCreate:
| Task subject | activeForm | Description |
|---|---|---|
| Verify site structure | Verifying site structure | Check for .powerpages-site/web-roles/ directory, create if needed |
| Discover existing roles | Discovering existing roles | Read current web role YAML files and compile list of existing roles |
| Determine new roles | Determining new roles | Analyze site needs and ask user which roles to create |
| Create web role files | Creating web role files | Generate YAML files with UUIDs from the Node script for each new role |
| Verify web roles | Verifying web roles | Validate all files exist, have valid UUIDs, and uniqueness constraints are satisfied |
| Review and deploy | Reviewing and deploying | Present summary of created roles and offer deployment |
Mark each task in_progress when starting it and completed when done via TaskUpdate. This gives the user visibility into progress and keeps the workflow deterministic.
Begin with Phase 1: Verify Site Structure
What SKILL.md sets; muted values are Claude Code's defaults
opusThree short reads, in order
npx claudepluginhub microsoft/power-platform-skills --plugin power-pages41 skills in this plugin
/activate-siteActivates and provisions a Power Pages website in a Power Platform environment via the Power Platform REST API. Use when the user wants to activate, provision, turn on, or enable a Power Pages website or portal./add-ai-webapiIntegrates Power Pages generative-AI summarization APIs (PREVIEW) into a Single Page Application (SPA) site — the Search Summary API and the Data Summarization API — on any record-detail or list page. Generates per-target service code (CSRF-handled) and AI site settings; delegates Web API settings, table permissions, and web roles to `/integrate-webapi` and `/create-webroles`. Use whenever a user wants AI/Copilot output that condenses Dataverse content on a Power Pages site — an AI summary, AI-generated overview or "key insights" across a record or list, a search-results summary, a case/incident summary, or recommendation-chip refinement — even when phrased as "AI-generated paragraph", "insights", or "overview". Do NOT use for: generative pages in model-driven apps (use the model-apps `genpage` skill), Copilot Studio agents/chatbots, summarizing documents or PDFs, Power BI dashboards, plain keyword search with no AI summary, or plain Dataverse CRUD (use `/integrate-webapi`)./add-cloud-flowIntegrates Power Automate cloud flows into a Power Pages site. Lists available flows, suggests relevant ones based on intent, identifies scenarios and web roles, creates metadata files, and generates client-side code to call flows. Handles both new flow registration and adding already-registered flows to additional pages without re-creating metadata. Use when the user wants to add, connect, register, or link a Power Automate cloud flow to their site./add-localizationAdds or extends multilingual localization in a Power Pages code-site SPA. Use whenever the user asks to translate, localize, internationalize, support multiple languages, add a language selector, add locale routes, repair an i18n setup, or add languages to an existing React, Vue, Angular, or Astro Power Pages site./add-sample-dataPopulates Dataverse tables with sample records for testing and demoing a Power Pages site. Use when the user wants to add sample data, seed data, generate test records, or insert demo data into their tables./add-seoAdds SEO essentials to a Power Pages SPA site, including robots.txt, sitemap.xml, meta tags, Open Graph tags, and favicon configuration. Use when the user wants to improve search engine optimization or make their site more searchable.Other plugins' skills for the same job