microsoft/power-platform-skills / plugins/pcf/skills/pcf
pcf
VerifiedBuilds, tests, diagnoses, upgrades, deploys and verifies Power Apps component framework (PCF) code components for model-driven apps and Power Pages — field and dataset controls, standard and virtual (React) — from Microsoft-maintained templates and recipes pinned to a tested version matrix. Runs quality gates (manifest and host lint, source checks, lint, unit tests, production build), deploys with pac pcf push, verifies registration and form bindings, and guides Power Pages enablement, with guided setup for canvas apps. Use when the user wants to build, fix, upgrade, deploy or check a PCF control or code component, or asks why one fails to build, import, update or render. For a whole page use /model-apps:genpage; for a whole app use /model-apps:app-builder.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 14.1 KB |
| bind-flow.md | markdown | 3.4 KB |
| create-flow.md | markdown | 7.7 KB |
| deploy-flow.md | markdown | 4.9 KB |
| pages-flow.md | markdown | 4.4 KB |
| upgrade-flow.md | markdown | 4.1 KB |
upgrade-flow.md
View on GitHub# /pcf upgrade flow
Use this flow for an existing PCF project. It keeps upgrade automation narrow and leaves runtime-shape changes to explicit manual work. Microsoft Learn documents PCF lifecycle and manifest/platform-library concepts at https://learn.microsoft.com/en-us/power-apps/developer/component-framework/overview and https://learn.microsoft.com/en-us/power-apps/developer/component-framework/react-controls-platform-libraries.
## Sequence
1. Diagnose:
```powershell
node "${PLUGIN_ROOT}/scripts/pcf-doctor.js" [--project <dir>] [--hosts model,pages] [--needs build]
```
2. Plan:
```powershell
node "${PLUGIN_ROOT}/scripts/pcf-upgrade.js" [--project <dir>] [--hosts model,pages] [--steps <id,...>] [--allow-dirty] [--no-install] [--npm-cli <path>]
```
3. Show the JSON plan. Separate automatic steps from manual notes.
4. Obtain consent before modifying files. If unattended, require explicit `--apply` authority and a clean or `--allow-dirty` workspace.
5. Apply:
```powershell
node "${PLUGIN_ROOT}/scripts/pcf-upgrade.js" [--project <dir>] [--hosts model,pages] --apply [--steps <id,...>] [--allow-dirty] [--no-install] [--npm-cli <path>]
```
For a scoped repair, use the boolean `--apply` flag plus `--steps`, for example:
```powershell
node "${PLUGIN_ROOT}/scripts/pcf-upgrade.js" --project <dir> --apply --steps PLATFORM_LIB_VERSION
```
Do not pass a value to `--apply`; the CLI rejects `--apply <id>` and `--apply=<id>`.
REINSTALL is a selectable step when the plan contains it. Each automatic step has `requiresStep`. `DEPS_TO_MATRIX` sets `requiresStep` to `REINSTALL` because pinning `package.json` without refreshing `package-lock.json` leaves a stale lockfile. Selecting `DEPS_TO_MATRIX` includes that required step even when `--steps` omits it, and listing both still installs once. Selecting `REINSTALL` alone runs only the reinstall, or records the skipped `npm install` command when `--no-install` is set. An unknown `--steps` value lists every selectable id, including `REINSTALL` when the plan contains it.
6. If `--no-install` is used, run the reinstall command the result names, usually `npm install` in the PCF project. If the reinstall itself fails, the upgrade is rolled back: the rewritten files and `package-lock.json` are restored and nothing is applied. Run `npm ci` in the project to restore `node_modules`, fix the install problem, then rerun the upgrade.
7. Run `pcf-gates.js --project <dir>`, redeploy with `deploy-flow.md`, rebind if needed, and verify.
8. Before redeploying over an existing registration, run `lint-pcf.js --manifest <current> --against <previous manifest>` when the previous manifest is available from source control or an exported baseline. If no baseline exists, record that compatibility was not compared instead of claiming a backwards-compatible upgrade.
## STANDARD_TO_VIRTUAL
Changing a standard control to virtual changes the runtime shape and is not automatic. Create or migrate to a virtual template only for model-driven apps, remove Pages from the target hosts, add platform libraries from the matrix, and retest all rendering and bundle assumptions.
## FLUENT_8_TO_9
Fluent 8 to Fluent 9 is a code and styling migration, not a package-only edit. Replace imports with `@fluentui/react-components`, update component props and styling, verify accessibility, then run gates. Keep versions from the matrix.
## PAGES_VIRTUAL_TO_STANDARD
Power Pages does not support virtual controls or platform libraries. For a Pages target, create a standard control, remove platform-library declarations, avoid unsupported Pages APIs, and verify through `pages-flow.md`.
## ESLINT_FLAT_CONFIG
This release does not delete or replace existing ESLint configuration automatically. Add `eslint.config.mjs` from a generated template, run lint, then remove legacy `.eslintrc*` files only after lint proves equivalent coverage.
## DECLARE_FEATURES
When source uses host features such as WebAPI, Device or Utility, declare them in manifest `uses-feature` entries. Use `required="false"` unless the control cannot function without the API, and guard optional methods at runtime.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |