Skip to content
Development
Skill

/create-webroles

Creates and configures web roles for a Power Pages SPA site. Web roles control access and permissions for site users, including authenticated and anonymous roles. Use when the user wants to create, add, set up, or manage web roles for their site. Also supports PAC-downloaded

From plugin
power-platform-skills
1.1k110 skills25 agents5 MCP

Claude Code

$ npx -y skills add microsoft/power-platform-skills --skill create-webroles --agent claude-code

SKILL.md

create-webroles.SKILL.md
name: create-webroles
description: >-
  Creates and configures web roles for a Power Pages SPA site. Web roles control access
  and permissions for site users, including authenticated and anonymous roles. Use when the
  user wants to create, add, set up, or manage web roles for their site. Also supports
  PAC-downloaded non-SPA sites with nested or directly opened metadata roots.
user-invocable: true
allowed-tools: Read, Write, Bash, Grep, Glob, AskUserQuestion, Task, TaskCreate, TaskUpdate, TaskList
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 Web Roles

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.

Site Type Routing

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.

---

Core Principles

  • **Use TaskCreate/TaskUpdate**: Track all progress throughout all phases — create the todo list upfront with all phases before starting any work.
  • **Always use the UUID script**: Never generate UUIDs manually — always use `${PLUGIN_ROOT}/scripts/generate-uuid.js` to produce valid UUID v4 values for each web role.
  • **Preserve uniqueness constraints**: Only one role can have `anonymoususersrole: true` and only one can have `authenticatedusersrole: true`. Always check existing roles before setting these flags.
  • **Caller-suppress mode is opt-in**: When invoked by another skill (e.g. `/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-site` folder structure that stores web role definitions.

**Initial request:** $ARGUMENTS

Phase 0: Detect caller-suppress mode

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:

  • **Phase 1 missing-deploy ask**: if `.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.

  • **Phase 6 deploy ask (step 3)** and the closing "Please run `/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.

---

Workflow

1. **Phase 1: Verify Site Structure** → Check for `.powerpages-site/web-roles/` directory 2. **Phase 2: Discover Existing Roles** → Read current web role YAML files 3. **Phase 3: Determine New Roles** → Analyze the site and ask the user what roles are needed 4. **Phase 4: Create Web Role Files** → Generate YAML files with UUIDs from the Node script 5. **Phase 5: Verify Web Roles** → Validate all created files exist, have valid UUIDs, and flags are correct 6. **Phase 6: Review & Deploy** → Present summary and proceed to deployment

---

Phase 1: Verify Site Structure

**Goal**: Confirm the `.powerpages-site/web-roles/` directory exists and is ready for web role files

**Actions**:

1. Locate the project root (`**/powerpages.config.json`) and check for `.powerpages-site/web-roles/`.

<!-- gate: create-webroles:1.deploy-first | category=plan | cancel-leaves=nothing -->

> 🚦 **Gate (plan · create-webroles:1.deploy-first):** `.powerpages-site` missing — skill cannot proceed without that folder. Prompt to deploy first or stop. > > **Trigger:** Phase 1 found no `.powerpages-site` directory. > **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.

2. **If `.powerpages-site` does NOT exist:**

  • **In caller-suppress mode** (Phase 0 flag): stop with a contract-violation message —

the calling skill should have gated on this folder existing before invoking us.

  • **Otherwise**: ask the user to deploy first via `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.

3. **If `.powerpages-site` exists but `web-roles/` does NOT:** Create the `<PROJECT_ROOT>/.powerpages-site/web-roles/` directory.

4. **If both exist:** Proceed to Phase 2.

**O

Read more
@microsoft
Ships withpower-platform-skills

Plugins from Microsoft that teach AI assistants, such as GitHub Copilot and Claude Code, to build on Power Platform.

1.1k110 skills25 agents5 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of microsoft/power-platform-skills on GitHub, a chart by star-history.com

Other skills on power-platform-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills13d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react4d252k
@facebook@facebookInstall Skill

Questions about create-webroles.

Which coding agents can use create-webroles?
create-webroles installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.