plugins/power-pages/skills/diagnose-deployment/SKILL.md
Surfaces PAC CLI upload errors and Dataverse async operation errors, pattern-matches against a known failure catalog, and optionally auto-fixes identified issues. Use when asked to: "diagnose deployment", "debug deployment", "deployment failed", "show deployment errors", "fix deployment issues", "show upload logs", "why did my deploy fail", or "troubleshoot upload".
npx skillsauth add microsoft/power-platform-skills diagnose-deploymentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Plugin check: Run
node "${CLAUDE_PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Surfaces and pattern-matches deployment errors against a known failure catalog. For each identified error with an available auto-fix, asks explicit user permission before applying any changes. Never auto-applies fixes without confirmation.
powerpages.config.jsonCreate all tasks upfront at the start of this phase.
Tasks to create:
Steps:
powerpages.config.json in cwd and parent directoriespac --version (report version or "not installed")pac env who (report environment URL or "not authenticated")az account show (report subscription or "not logged in")Auth failures are non-blocking — report them as findings, continue collecting other artifacts.
Reference:
${CLAUDE_PLUGIN_ROOT}/references/alm-docs-grounding.md
Cap this step at ~30 seconds. If MCP search / fetch errors out, log a one-line note and continue — this skill must remain runnable offline.
microsoft_docs_search with the query: Power Pages deployment errors solution import troubleshooting.https://learn.microsoft.com/en-us/power-platform/alm/solution-concepts-alm (and at most one sister page on troubleshooting or known import errors) in parallel via microsoft_docs_fetch.${CLAUDE_PLUGIN_ROOT}/references/deployment-error-catalog.md and flag any new error patterns not yet captured in the catalog.Gather all available context:
powerpages.config.json — extract siteName, websiteRecordId, compiledPath.powerpages-site/ folder exists.powerpages-site/*-manifest.yml — list all found, note their environment hostnames.solution-manifest.json exists (for solution-related diagnostics)docs/alm/last-import.json exists (for recent import failures){compiledPath}/ exists and is non-emptyReport: "Found project: {siteName}. Artifacts collected."
Re-run pac pages upload-code-site in capture mode to get fresh error output:
pac pages upload-code-site --rootPath "." 2>&1
Note: This intentionally triggers the upload to capture any errors. If the upload succeeds cleanly, that is also a valid diagnostic result ("no errors found").
Capture stdout+stderr as a single string. Pass to scripts/parse-deployment-errors.js:
echo "{escaped-output}" | node "${CLAUDE_PLUGIN_ROOT}/scripts/parse-deployment-errors.js"
Parse the JSON findings array. If the upload succeeded with no errors, note this and skip to Phase 5 with an empty findings list.
Only run if .solution-manifest.json exists.
GET {envUrl}/api/data/v9.2/asyncoperations?$filter=statecode eq 3 and statuscode eq 31 and createdon gt {yesterday}&$select=asyncoperationid,name,message,friendlymessage,statuscode,completedon&$orderby=completedon desc&$top=5
GET {envUrl}/api/data/v9.2/importjobs?$select=solutionname,completedon,progress&$orderby=completedon desc&$top=3
message field through parse-deployment-errors.jsSkip gracefully if auth is not available (auth failure in Phase 1).
Consolidate all findings from Phases 3 and 4. For each finding, categorize:
Also add findings for missing artifacts discovered in Phase 2:
websiteRecordId → Error (patternId: missing-website-record-id)empty-build)Present all findings in a table:
| # | Severity | Type | Issue | Auto-fix? | |---|---|---|---|---| | 1 | Error | upload | JavaScript uploads blocked | Yes | | 2 | Warning | config | Multiple manifest files found | No |
For each Error finding with autoFixAvailable: true, in order:
🚦 Gate (consent · diagnose-deployment:6.auto-fix): Per-finding consent before applying any auto-fix. Loops once per Error finding with
autoFixAvailable: true— each finding gets its own Yes / No / Skip-allAskUserQuestion. The pattern ID surfaces in the prompt. Never batch fixes — three findings = three separate consent prompts (unless the user picks "Skip all" on the first, which short-circuits the loop). The Yes from finding 1 does NOT cover finding 2; each fix has its own blast radius (different files, different settings, different reversibility).
Explain the issue and proposed fix
Ask explicit permission via AskUserQuestion:
"Issue: {message} Proposed fix: {suggestedFix} Apply this fix? Yes / No / Skip all auto-fixes"
If approved, execute the fix:
stale-manifest: Delete *-manifest.yml file(s) in .powerpages-site/
# Ask which manifest to delete if multiple found, then:
rm ".powerpages-site/{manifestFile}"
blocked-js: Update blockedattachments setting
# Get current setting first
pac env list-settings | grep -i blocked
# Remove .js from the blocked list (preserve other blocked types)
pac env update-settings --name blockedattachments --value "{updated-value}"
missing-website-record-id: Retrieve and update record ID
pac pages list
# Parse output, find matching site by name, then update powerpages.config.json
auth-expired: Guide re-authentication
pac auth create --environment "{envUrl}"
az login
empty-build: Run build
npm run build
After each fix, re-run the relevant check to verify it resolved the issue. Update finding status to "Fixed" or "Manual required".
Key Constraint: Never apply any fix without explicit user permission. Each fix requires a separate confirmation.
Display a final summary table of all findings:
| # | Severity | Type | Issue | Status | |---|---|---|---|---| | 1 | Error | upload | JS uploads blocked | Fixed | | 2 | Error | config | Missing websiteRecordId | Manual required | | 3 | Warning | config | Multiple manifest files | Informational |
Status values:
If all errors are resolved: suggest retrying deployment with /power-pages:deploy-site.
If manual steps remain: list them explicitly with commands or links.
Reference:
${CLAUDE_PLUGIN_ROOT}/references/skill-tracking-reference.md
Follow the skill tracking instructions in the reference to record this skill's usage. Use --skillName "DiagnoseDeployment".
pac pages upload-code-site produces no output: report "No upload errors detected in current state"parse-deployment-errors.js returns no findings: report "No known error patterns detected" and show raw output for manual review| Task subject | activeForm | Description | |---|---|---| | Verify prerequisites and locate project | Verifying prerequisites | Check PAC CLI, Azure CLI, locate project root and powerpages.config.json | | Collect deployment artifacts | Collecting deployment artifacts | Read config, list manifests, check build output, check solution manifest | | Surface upload errors | Surfacing upload errors | Re-run pac pages upload-code-site in capture mode, parse stdout/stderr | | Query solution import status | Querying solution import status | Check recent failed async operations and import jobs in Dataverse | | Diagnose and categorize findings | Diagnosing findings | Pattern-match all errors against deployment-error-catalog, assign severity | | Offer auto-fixes | Applying auto-fixes | For each fixable error, ask permission and execute fix, verify result | | Present findings summary | Presenting summary | Show all findings table with severity and fix status, list manual steps |
tools
Configure the Canvas Authoring MCP server for the current coauthoring session. USE WHEN "configure MCP", "set up MCP server", "MCP not working", "connect Canvas Apps MCP", "canvas-authoring not available", "MCP not configured", "set up canvas apps". DO NOT USE WHEN prerequisites are missing — direct the user to install .NET 10 SDK first.
development
Use when the user asks to "set up authentication", "add login", "add logout", "add sign in", "enable auth", "add role-based access", "add authorization", "protect routes", "configure identity provider", "configure Entra ID", "configure Entra External ID", "configure OpenID Connect", "add OIDC", "set up SAML", "set up WS-Federation", "set up local login", "add username password", "add Facebook login", "add Google sign in", "add Microsoft Account", "set up invitation login", or otherwise wants to set up authentication (login/logout) and role-based authorization for their Power Pages code site using any supported identity provider (Microsoft Entra ID, Entra External ID, OpenID Connect, SAML2, WS-Federation, local authentication, Microsoft Account, Facebook, or Google).
development
Creates, updates, and deploys Power Apps generative pages for model-driven apps using React v17, TypeScript, and Fluent UI V9. Orchestrates specialist agents for planning, entity creation, and code generation. Use it when user asks to build, retrieve, or update a page in an existing Microsoft Power Apps model-driven app. Use it when user mentions "generative page", "page in a model-driven", or "genux".
development
Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new Power Pages website or portal.