[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699QZC1VM5JFY0XFWDSCEHW":3,"skill-same:01M699QZC1VM5JFY0XFWDSCEHW":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M699QZC1VM5JFY0XFWDSCEHW","publish-pcf-companion",null,"Deploy the dispatcher PCF for a third-party `.ppmplugin` control to a Power Platform environment via `pac pcf push`. The dispatcher PCF is the Studio-side control that dispatches the composite key `\u003Cname>\u002F\u003Creceiver>` over the wrap shell's `SendMessagePlugin` bridge to the control's native module. Verifies deploy prereqs (Node.js 20+ with npm, .NET SDK, and active `pac auth`), then three confirmation gates — publisher prefix (2–8 chars; defaults to `pamext` or the last-used value from `.extension-state.md`), version bump (patch \u002F minor \u002F major \u002F no-bump), target environment URL (from `pac org who`). Builds the PCF if needed, then pushes. Decoupled from \u002Fgenerate-pcf-companion so the engineer can scaffold and customize locally, then deploy when ready. Updates `.extension-state.md` with deployment history (timestamp, env URL, version, prefix used).","microsoft\u002Fpower-platform-skills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699JVYJFB75D9JM70BN4H0Q",1149,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-apps-mobile-extension\u002Fskills\u002Fpublish-pcf-companion\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"companion","pcf","publish pcf companion","publish","confirmation","when","updates","studio","URL","native","bump","engineer","patch","ready","power","bridge","sdk","timestamp","Bash","dispatcher","customize","scaffold","deploy","power platform","auth","2026-11-10 10:12:30",false,"---\nname: publish-pcf-companion\ndescription: Deploy the dispatcher PCF for a third-party `.ppmplugin` control to a Power Platform environment via `pac pcf push`. The dispatcher PCF is the Studio-side control that dispatches the composite key `\u003Cname>\u002F\u003Creceiver>` over the wrap shell's `SendMessagePlugin` bridge to the control's native module. Verifies deploy prereqs (Node.js 20+ with npm, .NET SDK, and active `pac auth`), then three confirmation gates — publisher prefix (2–8 chars; defaults to `pamext` or the last-used value from `.extension-state.md`), version bump (patch \u002F minor \u002F major \u002F no-bump), target environment URL (from `pac org who`). Builds the PCF if needed, then pushes. Decoupled from \u002Fgenerate-pcf-companion so the engineer can scaffold and customize locally, then deploy when ready. Updates `.extension-state.md` with deployment history (timestamp, env URL, version, prefix used).\nallowed-tools: Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Skill\nmodel: sonnet\n---\n\n# \u002Fpublish-pcf-companion\n\nOn-demand deployment of the **dispatcher PCF** for a third-party `.ppmplugin` control to a Power Platform environment. The dispatcher PCF is the Studio-side control that dispatches the composite key `\u003Cname>\u002F\u003Creceiver>` over the wrap shell's `SendMessagePlugin` bridge to the control's native module. Runs `pac pcf push` against the user's active `pac auth` profile. Decoupled from `\u002Fgenerate-pcf-companion` — the engineer scaffolds locally, customizes \u002F iterates, then deploys when ready.\n\n---\n\n## Step 1 — Read shared docs and verify prereqs\n\n1. Read [`shared\u002Fshared-instructions.md`](..\u002F..\u002Fshared\u002Fshared-instructions.md), [`shared\u002Fnaming-conventions.md`](..\u002F..\u002Fshared\u002Fnaming-conventions.md).\n2. Apply the **per-skill minimal prereq policy** ([`shared-instructions.md §1.5`](..\u002F..\u002Fshared\u002Fshared-instructions.md)). This skill needs Node.js 20+ with npm, `pac` CLI, .NET SDK, and an active `pac auth` profile. It does not need pnpm.\n\n   **Print the prereq status as a visible block per `shared-instructions.md §9.2`** before continuing:\n\n   ```\n   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n    Prereq check — \u002Fpublish-pcf-companion\n   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n    ? ✓ Node.js 20+ and npm installed       (for npm install \u002F npm run build)\n    ? ✓ pac CLI installed                   (for pac pcf push)\n    ? ✓ .NET SDK installed                  (solution build runs inside pac pcf push)\n    ? ✓ pac auth profile active             (target env: \u003Cenv URL from pac org who>)\n\n    ? 4 checks passed. Ready to proceed.\n   ```\n\n   Fix table for failures:\n\n   | Missing | `→ Fix:` line in the failure block |\n   |---|---|\n   | Node.js \u002F npm | Install Node.js 20 LTS from `https:\u002F\u002Fnodejs.org`, then verify with `node -v` and `npm -v` |\n   | `pac` CLI | `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` (chains on .NET SDK first if also missing) |\n   | .NET SDK | `brew install dotnet` (mac) \u002F `winget install Microsoft.DotNet.SDK.10` (win) \u002F package manager (linux) |\n   | No active `pac auth` | `pac auth create --environment \u003Cyour-env-url>` (interactive browser flow; use an identity with access to the target Power Platform environment). **Do not reach for `--deviceCode` first** — it's a headless-shell fallback that commonly fails under Conditional Access. |\n\n   Run the `\u002Fpublish-pcf-companion` check from [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md). Per the auto-fix policy (shared-instructions §1.5): a missing `pac` CLI is auto-fixable when .NET is present — **offer `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` and continue on `yes`**; no active `pac auth` → **initiate `pac auth create --environment \u003Curl>`** (browser) and verify after. If an auth attempt *fails*, walk the variant ladder in [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md) (browser → device code only if headless → back to browser with `--environment` → `pac auth clear`) — change a variable each step and never re-run a variant that already failed. A missing **.NET SDK** hard-stops (system-wide install — print the command).\n3. Read `.\u002FPRD.md`. Required — the skill derives the PCF folder name (`pcf\u002F\u003CPascal>PCF\u002F`) and publisher prefix from PRD §2. If PRD is missing, STOP with `BLOCKED: PRD.md missing — cannot determine PCF folder name`.\n4. Read `.\u002F.extension-state.md` if present. The state file is informational; this skill works without it but uses Phase info to surface \"scaffold-pcf hasn't happened yet\" early.\n\n---\n\n## Step 2 — Detect current state\n\nBuild a status dashboard so the user sees what was detected before any action.\n\n**Discover the PCF folder robustly** — don't assume the exact nesting depth. Use Glob to find\n`pcf\u002F**\u002FControlManifest.Input.xml` and select the first match. `pac pcf init` normally produces\n`pcf\u002F\u003CPascal>PCF\u002F\u003CPascal>PCF\u002FControlManifest.Input.xml`, but case differences and manual\nrestructuring should not break discovery. If `pcf\u002F` is absent, stop with\n`BLOCKED: no pcf\u002F directory — PCF has not been scaffolded. Run \u002Fgenerate-pcf-companion first.` If\n`pcf\u002F` exists but the manifest is absent, list the relevant files with Glob and stop with\n`BLOCKED: pcf\u002F exists but no ControlManifest.Input.xml was found.`\n\nDerive the PCF project root from the manifest path by moving up two directory levels. Use Glob to\ncheck whether `\u003CPCF_PROJECT_ROOT>\u002Fout\u002F` exists. Use Read to extract the `\u003Ccontrol version=\"X.Y.Z\">`\nvalue from the manifest and the latest deployment version from `.extension-state.md`. Run\n`pac org who` to retrieve the active environment because that is a real toolchain command.\n\nPrint:\n\n```\nPCF deploy status\n─────────────────\nRepo: \u003Ccwd>\nPCF project root: \u003CPCF_PROJECT_ROOT from find>\nManifest: \u003CMANIFEST path>\nBuilt (out\u002F): \u003Cyes | no — will build now>\nCurrent manifest version: \u003CCURRENT_VERSION>\nLast deployed version: \u003CLAST_DEPLOYED or \"none — first deploy\">\nPublisher prefix: \u003CLAST_PREFIX from .extension-state.md, else `pamext` default — confirmed in Step 3.0>\nActive pac auth env: \u003Cenv URL from `pac org who`>\nActive pac auth user: \u003Cuser from `pac org who`>\n\nPlan: pick publisher prefix → bump version if chosen → build if needed → pac pcf push --publisher-prefix \u003Cchosen prefix>\n```\n\n**Why the version matters:** Power Platform caches PCF controls by version in deployed apps. If you re-push the same version, apps that already loaded the previous bundle may not see your changes until their cache invalidates (timing varies — sometimes minutes, sometimes hours, sometimes never until the maker re-publishes the app). **Best practice is to bump the patch version on every meaningful push.**\n\nIf `pac org who` returns \"No active connection\": STOP — this means `pac auth list` showed a profile but it's not currently selected. Run `pac auth select --index \u003Cn>` and re-run this skill. (Step 1 catches missing auth; this catches the rarer \"auth exists but not active\" case.)\n\n> **Why Glob instead of an exact path:** the standard layout is nested two levels below the project\n> root, but case differences, manual restructuring, and non-standard scaffolders occur. Glob provides\n> OS-neutral discovery without assuming a fixed path.\n\n---\n\n## Step 3 — Confirm with the user\n\nThis step has THREE gates: publisher prefix → version-bump → deploy confirmation. Each is its own `AskUserQuestion`.\n\n### 3.0 — Publisher prefix gate\n\nThe publisher prefix becomes part of the solution name in Power Platform (e.g. `pamext_\u003CPascal>PCF`). It must be **2–8 characters** — `pac pcf push` rejects anything outside that range with `Argument --publisher-prefix has incorrect length`.\n\nUse Read on `.extension-state.md` and extract the most recent `Publisher prefix: \u003Cvalue>` entry. If\nthe file or entry is absent, use `pamext` as the default.\n\nThen ask via `AskUserQuestion`:\n\n> Publisher prefix for this deployment? (must be 2–8 lowercase chars)\n> - **\u003CLAST_PREFIX>** (use the prefix from the previous deployment) — only shown if `LAST_PREFIX` was found\n> - **pamext** (recommended) — 6 chars; \"PAM Extension\"; the default we suggest for first-party native-extension PCFs\n> - **mspa** — 4 chars; \"Microsoft PowerApps\"\n> - **Custom** — supply your own 2–8-char prefix (free-text input, validate length before continuing)\n\nValidate the chosen value:\n\n```bash\nPREFIX=\"\u003Cfrom user choice>\"\nPREFIX_LEN=${#PREFIX}\nif [ \"$PREFIX_LEN\" -lt 2 ] || [ \"$PREFIX_LEN\" -gt 8 ]; then\n  echo \"❌ Publisher prefix '$PREFIX' is $PREFIX_LEN chars; must be 2–8. Try again.\"\n  # Re-prompt\nfi\nif ! [[ \"$PREFIX\" =~ ^[a-z][a-z0-9]*$ ]]; then\n  echo \"❌ Publisher prefix must start with a lowercase letter and contain only lowercase letters and digits.\"\n  # Re-prompt\nfi\n```\n\n**Why the prefix matters:** it groups your PCF with other solutions under the same publisher identity in Power Platform's solution explorer. Use the same prefix across all first-party native-extension PCFs so they appear together. The recommended `pamext` is a project convention — your team may have its own; ask before picking custom on a shared environment.\n\n**Why we don't hardcode it:** the team \u002F environment may have an existing publisher prefix established. Hardcoding \"powerapps\" was wrong on two counts — it's 9 chars (over the limit) AND it doesn't respect environment conventions.\n\n### 3.1 — Version-bump gate\n\nUse `AskUserQuestion`. Compute the bump-target options from `CURRENT_VERSION` (the version currently in the manifest):\n\n> Current PCF version: **\u003CCURRENT_VERSION>** (last deployed: \u003CLAST_DEPLOYED or \"never\">)\n>\n> Power Platform caches PCFs by version. Re-pushing the same version may not invalidate caches in apps that already use this control. Bump the version?\n>\n> - **Patch bump → \u003CCURRENT major.minor.(patch+1)>** (recommended for bug fixes, internal improvements) — typical default\n> - **Minor bump → \u003CCURRENT major.(minor+1).0>** (for new features or new outputs\u002Fconfigurable inputs the maker can opt into)\n> - **Major bump → \u003C(CURRENT major+1).0.0>** (for breaking changes to the bound input, output names, or trigger semantics)\n> - **No bump — push as-is at \u003CCURRENT_VERSION>** (only if you're iterating during initial dev and accept the cache risk; the skill will print a warning)\n\nApply the chosen bump with the Edit tool by replacing only the `\u003Ccontrol version=\"...\">` attribute\nin the manifest. Show the exact version change (`\u003CCURRENT_VERSION> → \u003CNEW_VERSION>`) before writing\nand preserve every other manifest field.\n\nAfter bumping, **re-build** is required (the manifest changed, so `out\u002F` is stale). The build runs as part of Step 4 regardless of the user's choice in 3.2 below, so this is fine.\n\nIf user picked \"No bump\": skip the manifest edit. Print a warning:\n> ⚠️  Pushing at \u003CCURRENT_VERSION> again. Apps that previously loaded this control may not see your changes until their PCF cache invalidates. Use a version bump for the next push if this matters.\n\n### 3.2 — Deploy confirmation gate — lead with the ENVIRONMENT\n\n**Wrong-env deploys are a confirmed failure mode** (a publish once went to `wrap-bug-bash-env` instead of `wrap-player-test-env` because the env URL was buried in a long question). So make the **target environment the headline** of this gate, and **explicitly offer to change it** — never silently reuse whatever `pac auth` happens to be active. **Show the FULL current-env details** (not just the URL) so the user can tell *which* env it is: read `pac org who` (and `pac auth list` for the friendly profile name) and print:\n\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n ►► CURRENT DEPLOY TARGET ◄◄\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n Environment:   \u003Cfriendly org name from `pac org who` — e.g. \"Contoso Test (default)\">\n URL:           \u003Cenv-url>\n Environment ID:\u003Corg\u002Fenvironment id from `pac org who`, if shown>\n Signed-in as:  \u003Cuser from `pac org who`>\n Auth profile:  \u003Cactive profile name from `pac auth list` (the ★ row)>\n Last deployed: \u003Cfrom .extension-state.md PCF deployments — env + timestamp, or \"first deploy\">\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\nThen a third `AskUserQuestion` whose **question text names the env again, verbatim**, and leads with the keep-or-change decision:\n\n> Deploy `\u003CPascal>PCF@\u003Cresolved version>` (prefix `\u003CPREFIX>`) to **\u003Cfriendly org name> — \u003Cenv-url>**. Keep this environment, or switch?\n> - **Yes, keep this env — build + push** (recommended): runs `npm run build`, then `pac pcf push --publisher-prefix \u003CPREFIX>`.\n> - **Switch environment** — change the target before deploying. Run `pac auth list` and offer the existing profiles (`pac auth select --index \u003Cn>`), or create a new one (`pac auth create --environment \u003Curl>`), **in-flow** — then re-print this headline and re-ask. Don't make the user leave and re-run the skill.\n> - **Push without rebuild** (only if you didn't bump version AND you trust the current `out\u002F`): skips `npm run build`. **Disabled if 3.1 bumped the version** — a bumped manifest requires a rebuild.\n> - **Cancel**\n\nThe env (friendly name + URL) and prefix appear **twice, verbatim** (the headline block + the question) — typos in env config or the wrong active auth are the most common causes of \"the wrong tenant got the deploy.\" **Always surface the current env and the switch option even when an auth profile already exists** — never assume the active profile is the one the user wants.\n\n---\n\n## Step 4 — Execute\n\n### 4.1 — Build if needed (or always, for \"Yes — build + push\")\n\nUse the `$PCF_PROJECT_ROOT` discovered in Step 2 — don't hardcode `pcf\u002F\u003CPascal>PCF`:\n\n```bash\ncd \"$PCF_PROJECT_ROOT\"\n[ -d node_modules ] || npm install --no-audit --no-fund\nnpm run build --silent\n```\n\nIf build fails: STOP with `BLOCKED: pcf-scripts build failed — fix the source and re-run \u002Fpublish-pcf-companion`. Direct user to `\u002Ftest-native-extension` Layer 4 for diagnostics.\n\n### 4.2 — Push to Power Platform\n\n```bash\ncd \"$PCF_PROJECT_ROOT\"\npac pcf push --publisher-prefix \"$PREFIX\"   # $PREFIX from Step 3.0\n```\n\nThe prefix `$PREFIX` was chosen by the user in Step 3.0 and length-validated (2–8 chars). If `pac pcf push` still rejects with `Argument --publisher-prefix has incorrect length`, something downstream (env config, prefix regex change in newer `pac` versions) is unexpected — surface the raw error and re-run Step 3.0 to pick a different value.\n\nIf the prefix doesn't exist as a publisher in the target environment, the push errors with `Publisher prefix '$PREFIX' not found`. Surface this and direct the user to either:\n\n- Ask the env admin to add the prefix: `pac solution publisher-add --prefix \"$PREFIX\" --name \"\u003Cpublisher name>\"`, OR\n- Re-run this skill and pick a prefix that already exists in the env (the env admin can list them via the Power Platform admin center).\n\n### 4.3 — Pass\n\nPrint:\n```\n? ✓ Deployed \u003CPascal>PCF to \u003Cenv-url> at \u003CISO timestamp>\n  Solution: \u003CPREFIX>_\u003CPascal>PCF (verify in https:\u002F\u002Fmake.powerapps.com → Solutions)\n```\n\n### 4.4 — Fail\n\n`pac pcf push` can fail for several reasons. Common ones:\n\n| Error | Likely fix |\n|---|---|\n| `Publisher prefix '\u003CPREFIX>' not found` | Env admin needs to add the prefix, or re-run Step 3.0 and pick one that exists in the env |\n| `Authentication failed` \u002F `401` | `pac auth` token expired or the profile is bound to the wrong identity\u002Fenv. Try `pac auth select`, then re-create with `pac auth create --environment \u003Curl>` (browser). If that fails, walk the variant ladder in [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md) — do not retry the same variant, and do not default to `--deviceCode`. |\n| `Solution import failed: missing dependency` | Env is missing a required Power Platform feature (rare for native-extension PCFs; surface the dep name) |\n| `Build of \u003CPascal>PCF.csproj failed` | The PCF tooling tried `dotnet build` and it failed. Often a stale `out\u002F` — run `rm -rf out\u002F && npm run build` then retry. |\n\nUpdate `.extension-state.md`: under a new \"PCF deployments\" section, add `Deploy: fail — \u003CISO> — \u003Cenv-url> — \u003Cone-line reason>`. STOP with `BLOCKED: pac pcf push failed — \u003Creason>`.\n\n---\n\n## Step 5 — Update state and summarize\n\nAfter a successful push, update `.\u002F.extension-state.md`:\n\n- Add (or update) a **PCF deployments** section:\n  ```markdown\n  ## PCF deployments\n  - \u003CISO timestamp> — \u003Cenv-url> — Version: \u003CX.Y.Z> — Publisher prefix: \u003CPREFIX> — Result: success\n  ```\n  Append a new line on each subsequent successful deploy. Most recent at the bottom. The `Version:` field is the value from `\u003Ccontrol version=\"...\"\u002F>` at push time (post-bump if 3.1 bumped it). The `Publisher prefix:` field is what the user chose in Step 3.0 — subsequent runs default to this value via the LAST_PREFIX detection.\n- DO NOT change the **Phase** field — deploy is orthogonal to the phase ladder.\n\nPrint final summary:\n\n```\nDeploy complete\n───────────────\nPCF: \u003CPascal>PCF\nVersion: \u003CX.Y.Z>     ← post-bump if 3.1 bumped; else same as before\nBump: \u003Cpatch | minor | major | none — re-pushed at same version>\nEnvironment: \u003Cenv-url>\nPublisher prefix: \u003CPREFIX>\nBuild: \u003Cskipped — current out\u002F used | rebuilt at \u003Ctime>>\nDeployed at: \u003CISO timestamp>\n\nWhere to look next (informational — these are makers-portal steps, not skills):\n  • Open https:\u002F\u002Fmake.powerapps.com → switch to \u003Cenv> → Solutions → find `\u003CPREFIX>_\u003CPascal>PCF`.\n  • In a Canvas app: Insert → Custom → search for `\u003CPascal>PCF` under the `PowerApps` namespace.\n  • If a previously-deployed app doesn't show your changes: re-publish that app (File → Save → Publish) to bust the PCF cache.\n```\n\n### 5.1 Next-step gate\n\nPer `shared\u002Fshared-instructions.md §9.1`: surface real next-step choices via `AskUserQuestion` with **context-aware options** based on repo state. **Execute, don't describe** — when the user picks a `Run \u002F…` option, immediately invoke that skill via the `Skill` tool in the same turn (shared-instructions §9.1). The only option that ends the run without invoking anything is the escape hatch.\n\nDetect state to filter options:\n\n| Detector | Implies |\n|---|---|\n| No `.ppmplugin` bundle built yet (`ppmplugin\u002F\u003Cname>.ppmplugin` absent) | `\u002Fgenerate-ppmplugin` is the natural next step — the dispatcher PCF is deployed but the binary bundle it dispatches to still needs to be built. |\n| A `.ppmplugin` bundle already exists (`ppmplugin\u002F\u003Cname>.ppmplugin` present) | `\u002Faudit-ppmplugin` re-verifies the built bundle; `\u002Fdebug-extension` debugs\u002Frefines the control. |\n\nThen `AskUserQuestion`. Typical post-deploy options:\n\n```\nQuestion: \"Dispatcher PCF deployed. What would you like to do next?\"\nHeader:   \"Next step\"\n\nOptions:\n  1. \"Run \u002Fgenerate-ppmplugin\"   description: \"Build (or rebuild) the verified .ppmplugin binary bundle end-to-end (manifest → build → assemble → audit) — the bundle this dispatcher PCF routes to over the wrap bridge.\"\n  2. \"Run \u002Fdebug-extension\"       description: \"Debug\u002Frefine the control (PRD or native\u002FPCF code), then re-deploy with another version bump.\"\n  3. \"Run \u002Faudit-ppmplugin\"      description: \"Re-verify an already-built .ppmplugin bundle against the format spec and the manifest's receiver\u002Fmethod contract.\"\n  4. \"Stay — I'll verify in Studio\"   description: \"Skill exits. Open make.powerapps.com → your env → find the new PCF in Solutions \u002F insert it in a Canvas app to verify.\"\n```\n\n> **Informational (not a skill option):** uploading the built `.ppmplugin` via the wrap wizard and wiring this dispatcher PCF into a canvas app is **Stage 3 — not yet a skill**. Once the bundle is built and the PCF is deployed, that final hosting step is a manual makers-portal \u002F wrap-wizard flow.\n\nWhen the user picks a `Run \u002F…` option, invoke it via the `Skill` tool. When they pick \"Stay\", print one line confirming the deploy is done and proceed to the return-status block.\n\n---\n\n## Return-status protocol\n\n| Code | Meaning |\n|---|---|\n| `DONE` | `pac pcf push` succeeded; state file updated with deployment row. |\n| `DONE_WITH_CONCERNS: \u003Clist>` | Push succeeded but with caveats (publisher prefix mismatch and user accepted the alternate; or `npm run build` produced warnings the user accepted). |\n| `NEEDS_CONTEXT: \u003Cmissing>` | PRD missing, PCF not yet scaffolded, or required user input incomplete in a scenario question. |\n| `BLOCKED: \u003Creason>` | Prereq failed (`pac`, dotnet, or auth missing), `pac pcf push` rejected for a non-collision reason (perms, network), `npm run build` failed, user cancelled, or `pac org who` shows no active connection. |\n\nAfter the first line, blank line, then the human-readable summary.\n\n---\n\n## Hard rules\n\n- **Never push without explicit confirmation of the env URL.** The env URL appears verbatim in the Step 3 question; the user typed `yes` to that URL. If env changes between Step 3 and Step 4 (e.g. `pac auth select` was run by a parallel session), STOP and re-prompt.\n- **Never use `--force`-style flags to bypass auth or solution conflicts.** If `pac pcf push` errors, surface and stop — don't try alternative prefixes or solution targets without user confirmation.\n- **Publisher prefix is user-chosen at deploy time, not hardcoded.** Length must be 2–8 lowercase chars + digits (validated in Step 3.0). Default the gate to the last-used prefix from `.extension-state.md` if present, otherwise to `pamext`. Never push without an explicit prefix confirmation — environments often have established prefixes and the wrong one creates an orphan solution.\n- **Never deploy to an env the user didn't explicitly authorize.** This skill reads the active `pac auth` profile; if the user wants a different env, they switch it BEFORE running the skill.\n- **Don't auto-bump without confirmation.** PCF version (`\u003Ccontrol version=\"X.Y.Z\">` in the manifest) drives Power Platform's cache invalidation. The skill MUST present the bump options at Step 3.1 with `AskUserQuestion`, default-highlighting patch bump, and apply the chosen bump verbatim. Never bump silently and never skip the prompt — the engineer needs to see \"we're changing your manifest version\" before it happens.\n- **A bumped manifest requires a rebuild.** If Step 3.1 changed the manifest, the \"Push without rebuild\" option in Step 3.2 must be disabled or unavailable — pushing a stale `out\u002F` with a new manifest version is a real bug (the deployed bundle wouldn't match the version declared in the solution).\n- **Don't run inside a directory without a PRD.md.** This skill needs PRD §2 to derive the PCF folder name; without it, it'd have to guess.\n","# \u002Fpublish-pcf-companion\n\nOn-demand deployment of the **dispatcher PCF** for a third-party `.ppmplugin` control to a Power Platform environment. The dispatcher PCF is the Studio-side control that dispatches the composite key `\u003Cname>\u002F\u003Creceiver>` over the wrap shell's `SendMessagePlugin` bridge to the control's native module. Runs `pac pcf push` against the user's active `pac auth` profile. Decoupled from `\u002Fgenerate-pcf-companion` — the engineer scaffolds locally, customizes \u002F iterates, then deploys when ready.\n\n---\n\n## Step 1 — Read shared docs and verify prereqs\n\n1. Read [`shared\u002Fshared-instructions.md`](..\u002F..\u002Fshared\u002Fshared-instructions.md), [`shared\u002Fnaming-conventions.md`](..\u002F..\u002Fshared\u002Fnaming-conventions.md).\n2. Apply the **per-skill minimal prereq policy** ([`shared-instructions.md §1.5`](..\u002F..\u002Fshared\u002Fshared-instructions.md)). This skill needs Node.js 20+ with npm, `pac` CLI, .NET SDK, and an active `pac auth` profile. It does not need pnpm.\n\n   **Print the prereq status as a visible block per `shared-instructions.md §9.2`** before continuing:\n\n   ```\n   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n    Prereq check — \u002Fpublish-pcf-companion\n   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n\n    ? ✓ Node.js 20+ and npm installed       (for npm install \u002F npm run build)\n    ? ✓ pac CLI installed                   (for pac pcf push)\n    ? ✓ .NET SDK installed                  (solution build runs inside pac pcf push)\n    ? ✓ pac auth profile active             (target env: \u003Cenv URL from pac org who>)\n\n    ? 4 checks passed. Ready to proceed.\n   ```\n\n   Fix table for failures:\n\n   | Missing | `→ Fix:` line in the failure block |\n   |---|---|\n   | Node.js \u002F npm | Install Node.js 20 LTS from `https:\u002F\u002Fnodejs.org`, then verify with `node -v` and `npm -v` |\n   | `pac` CLI | `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` (chains on .NET SDK first if also missing) |\n   | .NET SDK | `brew install dotnet` (mac) \u002F `winget install Microsoft.DotNet.SDK.10` (win) \u002F package manager (linux) |\n   | No active `pac auth` | `pac auth create --environment \u003Cyour-env-url>` (interactive browser flow; use an identity with access to the target Power Platform environment). **Do not reach for `--deviceCode` first** — it's a headless-shell fallback that commonly fails under Conditional Access. |\n\n   Run the `\u002Fpublish-pcf-companion` check from [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md). Per the auto-fix policy (shared-instructions §1.5): a missing `pac` CLI is auto-fixable when .NET is present — **offer `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` and continue on `yes`**; no active `pac auth` → **initiate `pac auth create --environment \u003Curl>`** (browser) and verify after. If an auth attempt *fails*, walk the variant ladder in [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md) (browser → device code only if headless → back to browser with `--environment` → `pac auth clear`) — change a variable each step and never re-run a variant that already failed. A missing **.NET SDK** hard-stops (system-wide install — print the command).\n3. Read `.\u002FPRD.md`. Required — the skill derives the PCF folder name (`pcf\u002F\u003CPascal>PCF\u002F`) and publisher prefix from PRD §2. If PRD is missing, STOP with `BLOCKED: PRD.md missing — cannot determine PCF folder name`.\n4. Read `.\u002F.extension-state.md` if present. The state file is informational; this skill works without it but uses Phase info to surface \"scaffold-pcf hasn't happened yet\" early.\n\n---\n\n## Step 2 — Detect current state\n\nBuild a status dashboard so the user sees what was detected before any action.\n\n**Discover the PCF folder robustly** — don't assume the exact nesting depth. Use Glob to find\n`pcf\u002F**\u002FControlManifest.Input.xml` and select the first match. `pac pcf init` normally produces\n`pcf\u002F\u003CPascal>PCF\u002F\u003CPascal>PCF\u002FControlManifest.Input.xml`, but case differences and manual\nrestructuring should not break discovery. If `pcf\u002F` is absent, stop with\n`BLOCKED: no pcf\u002F directory — PCF has not been scaffolded. Run \u002Fgenerate-pcf-companion first.` If\n`pcf\u002F` exists but the manifest is absent, list the relevant files with Glob and stop with\n`BLOCKED: pcf\u002F exists but no ControlManifest.Input.xml was found.`\n\nDerive the PCF project root from the manifest path by moving up two directory levels. Use Glob to\ncheck whether `\u003CPCF_PROJECT_ROOT>\u002Fout\u002F` exists. Use Read to extract the `\u003Ccontrol version=\"X.Y.Z\">`\nvalue from the manifest and the latest deployment version from `.extension-state.md`. Run\n`pac org who` to retrieve the active environment because that is a real toolchain command.\n\nPrint:\n\n```\nPCF deploy status\n─────────────────\nRepo: \u003Ccwd>\nPCF project root: \u003CPCF_PROJECT_ROOT from find>\nManifest: \u003CMANIFEST path>\nBuilt (out\u002F): \u003Cyes | no — will build now>\nCurrent manifest version: \u003CCURRENT_VERSION>\nLast deployed version: \u003CLAST_DEPLOYED or \"none — first deploy\">\nPublisher prefix: \u003CLAST_PREFIX from .extension-state.md, else `pamext` default — confirmed in Step 3.0>\nActive pac auth env: \u003Cenv URL from `pac org who`>\nActive pac auth user: \u003Cuser from `pac org who`>\n\nPlan: pick publisher prefix → bump version if chosen → build if needed → pac pcf push --publisher-prefix \u003Cchosen prefix>\n```\n\n**Why the version matters:** Power Platform caches PCF controls by version in deployed apps. If you re-push the same version, apps that already loaded the previous bundle may not see your changes until their cache invalidates (timing varies — sometimes minutes, sometimes hours, sometimes never until the maker re-publishes the app). **Best practice is to bump the patch version on every meaningful push.**\n\nIf `pac org who` returns \"No active connection\": STOP — this means `pac auth list` showed a profile but it's not currently selected. Run `pac auth select --index \u003Cn>` and re-run this skill. (Step 1 catches missing auth; this catches the rarer \"auth exists but not active\" case.)\n\n> **Why Glob instead of an exact path:** the standard layout is nested two levels below the project\n> root, but case differences, manual restructuring, and non-standard scaffolders occur. Glob provides\n> OS-neutral discovery without assuming a fixed path.\n\n---\n\n## Step 3 — Confirm with the user\n\nThis step has THREE gates: publisher prefix → version-bump → deploy confirmation. Each is its own `AskUserQuestion`.\n\n### 3.0 — Publisher prefix gate\n\nThe publisher prefix becomes part of the solution name in Power Platform (e.g. `pamext_\u003CPascal>PCF`). It must be **2–8 characters** — `pac pcf push` rejects anything outside that range with `Argument --publisher-prefix has incorrect length`.\n\nUse Read on `.extension-state.md` and extract the most recent `Publisher prefix: \u003Cvalue>` entry. If\nthe file or entry is absent, use `pamext` as the default.\n\nThen ask via `AskUserQuestion`:\n\n> Publisher prefix for this deployment? (must be 2–8 lowercase chars)\n> - **\u003CLAST_PREFIX>** (use the prefix from the previous deployment) — only shown if `LAST_PREFIX` was found\n> - **pamext** (recommended) — 6 chars; \"PAM Extension\"; the default we suggest for first-party native-extension PCFs\n> - **mspa** — 4 chars; \"Microsoft PowerApps\"\n> - **Custom** — supply your own 2–8-char prefix (free-text input, validate length before continuing)\n\nValidate the chosen value:\n\n```bash\nPREFIX=\"\u003Cfrom user choice>\"\nPREFIX_LEN=${#PREFIX}\nif [ \"$PREFIX_LEN\" -lt 2 ] || [ \"$PREFIX_LEN\" -gt 8 ]; then\n  echo \"❌ Publisher prefix '$PREFIX' is $PREFIX_LEN chars; must be 2–8. Try again.\"\n  # Re-prompt\nfi\nif ! [[ \"$PREFIX\" =~ ^[a-z][a-z0-9]*$ ]]; then\n  echo \"❌ Publisher prefix must start with a lowercase letter and contain only lowercase letters and digits.\"\n  # Re-prompt\nfi\n```\n\n**Why the prefix matters:** it groups your PCF with other solutions under the same publisher identity in Power Platform's solution explorer. Use the same prefix across all first-party native-extension PCFs so they appear together. The recommended `pamext` is a project convention — your team may have its own; ask before picking custom on a shared environment.\n\n**Why we don't hardcode it:** the team \u002F environment may have an existing publisher prefix established. Hardcoding \"powerapps\" was wrong on two counts — it's 9 chars (over the limit) AND it doesn't respect environment conventions.\n\n### 3.1 — Version-bump gate\n\nUse `AskUserQuestion`. Compute the bump-target options from `CURRENT_VERSION` (the version currently in the manifest):\n\n> Current PCF version: **\u003CCURRENT_VERSION>** (last deployed: \u003CLAST_DEPLOYED or \"never\">)\n>\n> Power Platform caches PCFs by version. Re-pushing the same version may not invalidate caches in apps that already use this control. Bump the version?\n>\n> - **Patch bump → \u003CCURRENT major.minor.(patch+1)>** (recommended for bug fixes, internal improvements) — typical default\n> - **Minor bump → \u003CCURRENT major.(minor+1).0>** (for new features or new outputs\u002Fconfigurable inputs the maker can opt into)\n> - **Major bump → \u003C(CURRENT major+1).0.0>** (for breaking changes to the bound input, output names, or trigger semantics)\n> - **No bump — push as-is at \u003CCURRENT_VERSION>** (only if you're iterating during initial dev and accept the cache risk; the skill will print a warning)\n\nApply the chosen bump with the Edit tool by replacing only the `\u003Ccontrol version=\"...\">` attribute\nin the manifest. Show the exact version change (`\u003CCURRENT_VERSION> → \u003CNEW_VERSION>`) before writing\nand preserve every other manifest field.\n\nAfter bumping, **re-build** is required (the manifest changed, so `out\u002F` is stale). The build runs as part of Step 4 regardless of the user's choice in 3.2 below, so this is fine.\n\nIf user picked \"No bump\": skip the manifest edit. Print a warning:\n> ⚠️  Pushing at \u003CCURRENT_VERSION> again. Apps that previously loaded this control may not see your changes until their PCF cache invalidates. Use a version bump for the next push if this matters.\n\n### 3.2 — Deploy confirmation gate — lead with the ENVIRONMENT\n\n**Wrong-env deploys are a confirmed failure mode** (a publish once went to `wrap-bug-bash-env` instead of `wrap-player-test-env` because the env URL was buried in a long question). So make the **target environment the headline** of this gate, and **explicitly offer to change it** — never silently reuse whatever `pac auth` happens to be active. **Show the FULL current-env details** (not just the URL) so the user can tell *which* env it is: read `pac org who` (and `pac auth list` for the friendly profile name) and print:\n\n```\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n ►► CURRENT DEPLOY TARGET ◄◄\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n Environment:   \u003Cfriendly org name from `pac org who` — e.g. \"Contoso Test (default)\">\n URL:           \u003Cenv-url>\n Environment ID:\u003Corg\u002Fenvironment id from `pac org who`, if shown>\n Signed-in as:  \u003Cuser from `pac org who`>\n Auth profile:  \u003Cactive profile name from `pac auth list` (the ★ row)>\n Last deployed: \u003Cfrom .extension-state.md PCF deployments — env + timestamp, or \"first deploy\">\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n```\n\nThen a third `AskUserQuestion` whose **question text names the env again, verbatim**, and leads with the keep-or-change decision:\n\n> Deploy `\u003CPascal>PCF@\u003Cresolved version>` (prefix `\u003CPREFIX>`) to **\u003Cfriendly org name> — \u003Cenv-url>**. Keep this environment, or switch?\n> - **Yes, keep this env — build + push** (recommended): runs `npm run build`, then `pac pcf push --publisher-prefix \u003CPREFIX>`.\n> - **Switch environment** — change the target before deploying. Run `pac auth list` and offer the existing profiles (`pac auth select --index \u003Cn>`), or create a new one (`pac auth create --environment \u003Curl>`), **in-flow** — then re-print this headline and re-ask. Don't make the user leave and re-run the skill.\n> - **Push without rebuild** (only if you didn't bump version AND you trust the current `out\u002F`): skips `npm run build`. **Disabled if 3.1 bumped the version** — a bumped manifest requires a rebuild.\n> - **Cancel**\n\nThe env (friendly name + URL) and prefix appear **twice, verbatim** (the headline block + the question) — typos in env config or the wrong active auth are the most common causes of \"the wrong tenant got the deploy.\" **Always surface the current env and the switch option even when an auth profile already exists** — never assume the active profile is the one the user wants.\n\n---\n\n## Step 4 — Execute\n\n### 4.1 — Build if needed (or always, for \"Yes — build + push\")\n\nUse the `$PCF_PROJECT_ROOT` discovered in Step 2 — don't hardcode `pcf\u002F\u003CPascal>PCF`:\n\n```bash\ncd \"$PCF_PROJECT_ROOT\"\n[ -d node_modules ] || npm install --no-audit --no-fund\nnpm run build --silent\n```\n\nIf build fails: STOP with `BLOCKED: pcf-scripts build failed — fix the source and re-run \u002Fpublish-pcf-companion`. Direct user to `\u002Ftest-native-extension` Layer 4 for diagnostics.\n\n### 4.2 — Push to Power Platform\n\n```bash\ncd \"$PCF_PROJECT_ROOT\"\npac pcf push --publisher-prefix \"$PREFIX\"   # $PREFIX from Step 3.0\n```\n\nThe prefix `$PREFIX` was chosen by the user in Step 3.0 and length-validated (2–8 chars). If `pac pcf push` still rejects with `Argument --publisher-prefix has incorrect length`, something downstream (env config, prefix regex change in newer `pac` versions) is unexpected — surface the raw error and re-run Step 3.0 to pick a different value.\n\nIf the prefix doesn't exist as a publisher in the target environment, the push errors with `Publisher prefix '$PREFIX' not found`. Surface this and direct the user to either:\n\n- Ask the env admin to add the prefix: `pac solution publisher-add --prefix \"$PREFIX\" --name \"\u003Cpublisher name>\"`, OR\n- Re-run this skill and pick a prefix that already exists in the env (the env admin can list them via the Power Platform admin center).\n\n### 4.3 — Pass\n\nPrint:\n```\n? ✓ Deployed \u003CPascal>PCF to \u003Cenv-url> at \u003CISO timestamp>\n  Solution: \u003CPREFIX>_\u003CPascal>PCF (verify in https:\u002F\u002Fmake.powerapps.com → Solutions)\n```\n\n### 4.4 — Fail\n\n`pac pcf push` can fail for several reasons. Common ones:\n\n| Error | Likely fix |\n|---|---|\n| `Publisher prefix '\u003CPREFIX>' not found` | Env admin needs to add the prefix, or re-run Step 3.0 and pick one that exists in the env |\n| `Authentication failed` \u002F `401` | `pac auth` token expired or the profile is bound to the wrong identity\u002Fenv. Try `pac auth select`, then re-create with `pac auth create --environment \u003Curl>` (browser). If that fails, walk the variant ladder in [`prereq-check.md`](..\u002F..\u002Fshared\u002Fprereq-check.md) — do not retry the same variant, and do not default to `--deviceCode`. |\n| `Solution import failed: missing dependency` | Env is missing a required Power Platform feature (rare for native-extension PCFs; surface the dep name) |\n| `Build of \u003CPascal>PCF.csproj failed` | The PCF tooling tried `dotnet build` and it failed. Often a stale `out\u002F` — run `rm -rf out\u002F && npm run build` then retry. |\n\nUpdate `.extension-state.md`: under a new \"PCF deployments\" section, add `Deploy: fail — \u003CISO> — \u003Cenv-url> — \u003Cone-line reason>`. STOP with `BLOCKED: pac pcf push failed — \u003Creason>`.\n\n---\n\n## Step 5 — Update state and summarize\n\nAfter a successful push, update `.\u002F.extension-state.md`:\n\n- Add (or update) a **PCF deployments** section:\n  ```markdown\n  ## PCF deployments\n  - \u003CISO timestamp> — \u003Cenv-url> — Version: \u003CX.Y.Z> — Publisher prefix: \u003CPREFIX> — Result: success\n  ```\n  Append a new line on each subsequent successful deploy. Most recent at the bottom. The `Version:` field is the value from `\u003Ccontrol version=\"...\"\u002F>` at push time (post-bump if 3.1 bumped it). The `Publisher prefix:` field is what the user chose in Step 3.0 — subsequent runs default to this value via the LAST_PREFIX detection.\n- DO NOT change the **Phase** field — deploy is orthogonal to the phase ladder.\n\nPrint final summary:\n\n```\nDeploy complete\n───────────────\nPCF: \u003CPascal>PCF\nVersion: \u003CX.Y.Z>     ← post-bump if 3.1 bumped; else same as before\nBump: \u003Cpatch | minor | major | none — re-pushed at same version>\nEnvironment: \u003Cenv-url>\nPublisher prefix: \u003CPREFIX>\nBuild: \u003Cskipped — current out\u002F used | rebuilt at \u003Ctime>>\nDeployed at: \u003CISO timestamp>\n\nWhere to look next (informational — these are makers-portal steps, not skills):\n  • Open https:\u002F\u002Fmake.powerapps.com → switch to \u003Cenv> → Solutions → find `\u003CPREFIX>_\u003CPascal>PCF`.\n  • In a Canvas app: Insert → Custom → search for `\u003CPascal>PCF` under the `PowerApps` namespace.\n  • If a previously-deployed app doesn't show your changes: re-publish that app (File → Save → Publish) to bust the PCF cache.\n```\n\n### 5.1 Next-step gate\n\nPer `shared\u002Fshared-instructions.md §9.1`: surface real next-step choices via `AskUserQuestion` with **context-aware options** based on repo state. **Execute, don't describe** — when the user picks a `Run \u002F…` option, immediately invoke that skill via the `Skill` tool in the same turn (shared-instructions §9.1). The only option that ends the run without invoking anything is the escape hatch.\n\nDetect state to filter options:\n\n| Detector | Implies |\n|---|---|\n| No `.ppmplugin` bundle built yet (`ppmplugin\u002F\u003Cname>.ppmplugin` absent) | `\u002Fgenerate-ppmplugin` is the natural next step — the dispatcher PCF is deployed but the binary bundle it dispatches to still needs to be built. |\n| A `.ppmplugin` bundle already exists (`ppmplugin\u002F\u003Cname>.ppmplugin` present) | `\u002Faudit-ppmplugin` re-verifies the built bundle; `\u002Fdebug-extension` debugs\u002Frefines the control. |\n\nThen `AskUserQuestion`. Typical post-deploy options:\n\n```\nQuestion: \"Dispatcher PCF deployed. What would you like to do next?\"\nHeader:   \"Next step\"\n\nOptions:\n  1. \"Run \u002Fgenerate-ppmplugin\"   description: \"Build (or rebuild) the verified .ppmplugin binary bundle end-to-end (manifest → build → assemble → audit) — the bundle this dispatcher PCF routes to over the wrap bridge.\"\n  2. \"Run \u002Fdebug-extension\"       description: \"Debug\u002Frefine the control (PRD or native\u002FPCF code), then re-deploy with another version bump.\"\n  3. \"Run \u002Faudit-ppmplugin\"      description: \"Re-verify an already-built .ppmplugin bundle against the format spec and the manifest's receiver\u002Fmethod contract.\"\n  4. \"Stay — I'll verify in Studio\"   description: \"Skill exits. Open make.powerapps.com → your env → find the new PCF in Solutions \u002F insert it in a Canvas app to verify.\"\n```\n\n> **Informational (not a skill option):** uploading the built `.ppmplugin` via the wrap wizard and wiring this dispatcher PCF into a canvas app is **Stage 3 — not yet a skill**. Once the bundle is built and the PCF is deployed, that final hosting step is a manual makers-portal \u002F wrap-wizard flow.\n\nWhen the user picks a `Run \u002F…` option, invoke it via the `Skill` tool. When they pick \"Stay\", print one line confirming the deploy is done and proceed to the return-status block.\n\n---\n\n## Return-status protocol\n\n| Code | Meaning |\n|---|---|\n| `DONE` | `pac pcf push` succeeded; state file updated with deployment row. |\n| `DONE_WITH_CONCERNS: \u003Clist>` | Push succeeded but with caveats (publisher prefix mismatch and user accepted the alternate; or `npm run build` produced warnings the user accepted). |\n| `NEEDS_CONTEXT: \u003Cmissing>` | PRD missing, PCF not yet scaffolded, or required user input incomplete in a scenario question. |\n| `BLOCKED: \u003Creason>` | Prereq failed (`pac`, dotnet, or auth missing), `pac pcf push` rejected for a non-collision reason (perms, network), `npm run build` failed, user cancelled, or `pac org who` shows no active connection. |\n\nAfter the first line, blank line, then the human-readable summary.\n\n---\n\n## Hard rules\n\n- **Never push without explicit confirmation of the env URL.** The env URL appears verbatim in the Step 3 question; the user typed `yes` to that URL. If env changes between Step 3 and Step 4 (e.g. `pac auth select` was run by a parallel session), STOP and re-prompt.\n- **Never use `--force`-style flags to bypass auth or solution conflicts.** If `pac pcf push` errors, surface and stop — don't try alternative prefixes or solution targets without user confirmation.\n- **Publisher prefix is user-chosen at deploy time, not hardcoded.** Length must be 2–8 lowercase chars + digits (validated in Step 3.0). Default the gate to the last-used prefix from `.extension-state.md` if present, otherwise to `pamext`. Never push without an explicit prefix confirmation — environments often have established prefixes and the wrong one creates an orphan solution.\n- **Never deploy to an env the user didn't explicitly authorize.** This skill reads the active `pac auth` profile; if the user wants a different env, they switch it BEFORE running the skill.\n- **Don't auto-bump without confirmation.** PCF version (`\u003Ccontrol version=\"X.Y.Z\">` in the manifest) drives Power Platform's cache invalidation. The skill MUST present the bump options at Step 3.1 with `AskUserQuestion`, default-highlighting patch bump, and apply the chosen bump verbatim. Never bump silently and never skip the prompt — the engineer needs to see \"we're changing your manifest version\" before it happens.\n- **A bumped manifest requires a rebuild.** If Step 3.1 changed the manifest, the \"Push without rebuild\" option in Step 3.2 must be disabled or unavailable — pushing a stale `out\u002F` with a new manifest version is a real bug (the deployed bundle wouldn't match the version declared in the solution).\n- **Don't run inside a directory without a PRD.md.** This skill needs PRD §2 to derive the PCF folder name; without it, it'd have to guess.\n",{"name":5,"model":54,"description":7,"allowed-tools":55},"sonnet","Read, Write, Edit, Bash, Glob, Grep, AskUserQuestion, Skill","main","0a55a88fa2855404029d1e5450faf92878baf763","plugins\u002Fpower-apps-mobile-extension\u002Fskills\u002Fpublish-pcf-companion",232,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills","https:\u002F\u002Fmicrosoft.github.io\u002Fpower-platform-skills\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 21:46:39",{"source":8,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add microsoft\u002Fpower-platform-skills --skill publish-pcf-companion",{"tool":72,"command":73},"bunx","bunx skills add microsoft\u002Fpower-platform-skills --skill publish-pcf-companion",{"tool":75,"command":76},"pnpm","pnpm dlx skills add microsoft\u002Fpower-platform-skills --skill publish-pcf-companion","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-apps-mobile-extension\u002Fskills\u002Fpublish-pcf-companion\u002FSKILL.md",true,[],[81,89,109,132,150,164],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":88},"01M78JN2BFRRV1J54Q6WKZQ08D","compare-site-configurations","Compare Power Pages site configurations between two environments, such as dev, test and production, or between a local download and the live site, and explain which differences change site behavior. Use when a site works in one environment but not another (for example, works in dev but fails in test), to check configuration drift before promoting or deploying, or to see what changed between two sites. Produces a shareable HTML report and a JSON file that VS Code can import.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-pages\u002Fskills\u002Fcompare-site-configurations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":49},"01M699WVHX0XN59EPBTTPEKYPG","setup","Use when Process Intelligence needs building, explicit cloud\u002Faccount\u002Fenvironment configuration, sign-in, connection diagnostics, or recovery from an authentication error.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fsetup\u002FSKILL.md",[],[91,96,97,98,99,100,29,101,102,103,42,104,105,106,107,108],"configuration","diagnostics","error","environment","cloud","connection","authentication","use","recovery","process","sign","read","intelligence",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":120,"publishedAt":49},"01M699WSR9EX55YY1WD9J22FEG","report-issue","Use when the user wants a Process Intelligence bug-report draft or support summary for a failed operation.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Freport-issue\u002FSKILL.md",[115],{"categoryNo":116,"categoryName":117,"taxonomyType":118,"taxonomyTypeDesc":119},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[121,122,123,124,103,29,125,126,105,127,108,128,129,130,131],"issue","report","report issue","bug-report","operation","draft","bug","summary","user","for","support",{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":49},"01M699WR26YQ9Q21KE6MJF5B2G","investigate-process","Use when a broad Process Mining business question, observed pattern or competing explanation needs investigation across analytical perspectives.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Finvestigate-process\u002FSKILL.md",[],[139,105,140,141,103,142,143,29,144,145,146,107,147,148,149],"investigate","investigate process","question","process mining","business","across","perspectives","mining","pattern","investigation","analytical",{"skillNo":151,"name":152,"nameZh":6,"description":153,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":154,"categories":155,"keywords":156,"publishedAt":49},"01M699WP9SDG5ZR12P8VYNXKTN","derive-metric","Use when a requested measure is missing, a saved custom metric needs reuse, or an ephemeral formula or derived scalar is needed.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fderive-metric\u002FSKILL.md",[],[157,158,159,160,161,162,103,29,163,107],"metric","derive metric","missing","formula","custom","reuse","saved",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":49},"01M699WMG5R8P6SMTDAS1TKF9E","compare-cohorts","Use when comparing process cohorts, departments, periods or before-and-after results under matched definitions.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fcompare-cohorts\u002FSKILL.md",[],[171,172,103,29,173,105,107],"compare","compare cohorts","results"]