A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.
/pcf design record
This document records the /pcf:pcf skill as it ships in the pcf plugin. It is a contributor-facing design record; user workflow details live in ../skills/pcf/SKILL.md, host policy in ../references/pcf-hosts.md, deployment guidance in ../references/pcf-deploy.md, and troubleshooting in ../references/pcf-troubleshooting.md.
Purpose and scope
/pcf builds, tests, diagnoses, upgrades, deploys, verifies and inventories Power Apps component framework (PCF) code components for model-driven apps, with guided setup for Power Pages standard field controls and canvas apps.
This plugin is in preview; pcf-capabilities.md records the shipped capability evidence.
This release covers:
- Model-driven app host guidance, Power Pages guidance for standard field controls only, and guided canvas app setup with manual API review.
- Standard and virtual PCF controls.
- Four scaffold templates:
field-standard,dataset-standard,field-virtual, anddataset-virtual. - Six recipes:
star-rating,hierarchy-tree,lookup-dropdown,contextual-grid,grid-customizer, andattachment-uploader. - Intent capture, plan rendering, scaffold, doctor, upgrade, manifest/source/build gates, deploy, binding verification, inventory, and offline evals.
- Developer registration through
pac pcf pushwith an explicit--environmentand skill-recorded consent.
Canvas setup is guided; a canvas gate profile, reading the environment setting and automated canvas runtime evidence are not implemented in this release. Mobile offline is not covered by this skill. Registration uses pac pcf push in this release. Power Pages runtime certification is shown per recipe only when a recipe records runtime evidence.
Architecture
The skill runs in the main conversation loop because design choices, plan approval, deploy consent and binding decisions require the user or an explicit unattended default. Deterministic work is delegated to dependency-free CommonJS Node scripts under ../scripts/.
intent/request
-> skills/pcf/SKILL.md routes new | existing | doctor | upgrade | deploy | bind | verify | inventory
-> scripts/pcf-doctor.js checks local tooling/project health; check-auth.js runs when an env is involved
-> pcf-intent.json + scripts/write-pcf-plan.js render pcf-plan.md
-> scripts/pcf-scaffold.js writes a matrix-pinned template/recipe
-> implementation uses references/pcf-*.md + recipe README
-> scripts/pcf-gates.js runs manifest/source/lint/test/build gates
-> Pages compatibility gate for Pages targets: standard field controls only + pcf-gates.js --project <dir> --hosts pages
-> scripts/pcf-push.js --project <dir> --env <url> (--solution <uniqueName> | --publisher-prefix <p>) runs pac pcf push --environment <url>
-> scripts/verify-pcf.js checks registration and FormXML binding evidence
-> Pages site configuration guidance and runtime evidence if a target site is reachable
-> canvas environment setting and Studio setup guidance for canvas targets; manual runtime evidence only
-> scripts/pcf-inventory.js lists registered controls and where-used dependencies
The main route list is intentionally explicit in the skill because prompts never authorize writes by themselves. Deploy, binding, and runtime verification remain decision points in the conversation loop; deterministic scripts provide evidence but do not infer consent.
Libraries are split by concern:
pcf-matrix.jsowns version and host policy fromcompatibility-matrix.json.pcf-manifest.jsparses manifests, lints host rules and supports explicit breaking-change diffs.pcf-code-gate.jsscans source for unsupported host/runtime patterns.pcf-scaffold.jsrenders templates and recipes fromtemplates/,shared/, andrecipes/.pcf-build.jsexecutes the project-localpcf-scriptsbinary throughprocess.execPath.pcf-dataverse.jsperforms read-only verification/inventory through the vendored SDK plus documented raw Dataverse reads for surfaces the SDK does not model.pcf-binding-verify.jsvalidates model-driven FormXML binding shape.pcf-intent.jsvalidates the skill's machine-readable intent and renders the plan.pcf-doctor.jsandpcf-upgrade.jsdiagnose and repair common project drift.
Compatibility matrix
compatibility-matrix.json is the only source for PCF toolchain, host, platform-library and dependency-set facts. The committed lockfiles under lock/standard/ and lock/virtual/ are the only dependency snapshots used by scaffolds and CI.
Consumers:
pcf-scaffold.jsreads dependency sets and host compatibility.pcf-doctor.jschecks Node, npm, PAC, .NET and project dependency drift.pcf-manifest.jsandpcf-code-gate.jsenforce host and platform-library policy.pcf-ci-build.jsbuilds templates/recipes and probes published-package drift.references/pcf-hosts.mdrenders contributor/user-facing host and platform-library tables.
Compatibility matrix update procedure
- Review the linked Microsoft Learn pages and public package metadata named in
compatibility-matrix.json. - Bump the lock sets with
npm installin each changed lock directory, for exampleplugins/pcf/lock/standardandplugins/pcf/lock/virtual. - Run
node plugins/pcf/scripts/pcf-ci-build.js --allfrom the repository root. - Update the matrix
revieweddate and any changed source/evidence fields. - Run the pcf plugin suite with
cd plugins/pcf; node scripts/run-tests.js.
The weekly drift workflow .github/workflows/pcf-matrix-drift.yml points maintainers back to this section.
Templates and recipes
Templates are minimal, tested PCF project families:
| Template | Control kind | React/platform library | Hosts |
|---|---|---|---|
field-standard |
Field | Bundled | Model-driven apps, Power Pages |
dataset-standard |
Dataset | Bundled | Model-driven apps |
field-virtual |
Field | Platform libraries | Model-driven apps |
dataset-virtual |
Dataset | Platform libraries | Model-driven apps |
The Hosts column names automated profiles. Canvas targets use the model-driven profile with manual canvas API review, not a new matrix or intent host value.
Scaffolds include the pcf-scripts npm commands build, clean, rebuild, lint, lint:fix, start, start:watch, refreshTypes and test. The build/clean hooks are part of the generated contract because pac pcf push invokes the project package scripts during developer registration.
Recipes overlay a template with task-focused behavior. The recipe catalog in ../references/pcf-recipes.md is rendered from recipes/*/recipe.json and separates designed for hosts from certified runtime evidence. Current recipes are available but not certified in this release unless that rendered catalog names a certification date.
Quality gates and evidence levels
pcf-gates.js is the release gate for generated or edited projects:
- Manifest parse and host checks (
PCF_*findings). - Source checks for host DOM,
Xrm, unsupported internal context access, undeclared features and virtual-root ownership (PCF_CODE_*,PCF_VIRTUAL_*). - Project lint.
- Unit tests.
- Production build and bundle findings (
PCF_BUILD_*,PCF_BUNDLE_*,PCF_OUT_*).
Evidence levels are defined in ../references/pcf-testing.md: built, gated, registered, bound(draft), bound(published), runtime-verified, and runtime-not-checked. A run may honestly end at runtime-not-checked when no browser or target site was checked.
Breaking-change diff checks (PCF_DIFF_* findings) are not part of pcf-gates.js; run lint-pcf.js --manifest <current> --against <previous manifest> separately before redeploying an existing control when a baseline manifest is available. If the baseline is unavailable, the skill reports that compatibility was not compared instead of rounding a green gate up to a compatibility claim.
Deploy
pcf-push.js deploys by wrapping pac pcf push --environment <url>. The skill, not the script, obtains consent before this write and records the target environment origin, solution or publisher prefix, and the publish-all side effect. The script validates PCF names before passing values to PAC and can verify registration afterward.
Release packaging guidance lives in ../references/pcf-deploy.md. Example CI/CD files are under ../pipelines/ and intentionally use placeholders such as https://contoso.crm.dynamics.com.
Live-verified deploy facts carried into this design:
pac pcf pushregisters a control and removes its temporary solution afterward.- A trivial push can take around two minutes, so scripts and docs budget for a long-running deploy step.
- The platform rejected a stock React template declaring Fluent 9.68.0 with
platform library fluent_9_68_0 with version 9.68.0 is not supported by the platform.Fluent 9.46.2 was accepted and is the matrix baseline. - Control web resources are named
cc_<namespace>.<constructor>/<file>without the publisher prefix.
Binding and verification
Model-driven binding verification is metadata-first. verify-pcf.js reads the registered control, form metadata, draft FormXML and published FormXML, then calls pcf-binding-verify.js for field/control placement, client factors and parameter bindings.
Live-verified binding facts:
- A designer-shaped FormXML binding with a custom-control cell class id, matching
uniqueid/forControl, a fallback<customControl id>, and all three client factors survived draft and published reads after targeted publish. - A web-only declaration (
formFactor="2") was rejected at form write withCustom control declaration for form factor(s) 0,1 is missing...;PCF_BIND_FACTOR_UNDECLAREDis an error and every binding must declare phone, tablet and web factors. - A bound control cannot be deleted until the binding is removed and the artifact is published.
- Registered where-used dependencies can be read through
RetrieveDependentComponents(ObjectId, ComponentType=66), including the boundSystemFormdependency row for a form-bound control.pcf-inventory.js --env <url> --where-usedreports only these registered rows; it does not search form or Liquid text. Its output warns that registered dependencies are not proof of Liquid or arbitrary text references, and that an empty result is not "safe to delete".
Power Pages journeys
Power Pages support is guided by ../references/pcf-power-pages.md and host rules in ../references/pcf-hosts.md. This release supports Power Pages only for standard field controls: the form-field journey and the standalone Liquid journey ({% codecomponent %}), both guided. Dataset controls on Pages (form sub-grid and list) are not supported in this release. Dataset templates use paging and openDatasetItem, which Microsoft Learn documents for model-driven and canvas apps only. Virtual controls, platform libraries, unsupported property types, required feature declarations and unguarded host APIs fail or warn before deploy.
Pages outcomes for the guided form-field and Liquid journeys must state whether the journey was runtime-verified. Do not claim a Pages dataset journey was verified. Recipes and the SKILL label uncertified Pages claims as not certified in this release until runtime evidence is recorded in recipe metadata.
Canvas setup
Canvas support is guided by ../references/pcf-canvas.md. Build and gate standard or virtual controls with the default model-driven profile and record model in intent; canvas is not a --hosts or intent host value. Review canvas API limits by hand with the user before the normal push flow. For canvas-only targets, skip model-driven form binding.
After push, guide the Power Apps component framework for canvas apps environment setting and Studio import/updates. Report runtime-not-checked unless the user checks the control in Power Apps Studio. The canvas gate profile, reading the environment setting and automated runtime evidence are not implemented; see #656.
Testing, evals and CI
Automated coverage ships at three levels:
- Unit tests under
scripts/tests/pcf-*.test.jscover matrix validation, manifest lint/diff, source gates, scaffolding, build orchestration, doctor, upgrade, push, binding verification, inventory and CLI behavior. - The offline eval harness under
evals/pcf/grades intent, manifest, source, FormXML, doctor, upgrade and generated-project facts. See../../../evals/pcf/EVAL_GUIDE.md. - CI includes the PCF script-test workflow
.github/workflows/pcf-script-tests.yml, the PCF generated-project workflow.github/workflows/pcf-projects.yml, and the matrix drift workflow.github/workflows/pcf-matrix-drift.yml.
The generated-project workflow builds all templates and available recipes on Ubuntu and Windows, with Node 20. On Windows the projects are generated on the runner's local temporary disk, because installs on the OS disk were several times slower. It also runs a packaging smoke that requires PAC CLI plus .NET SDK. Each job has a time limit, so a hung install fails the check instead of holding a runner.
Status
All shipped components in this release are checked below.
See pcf-capabilities.md for the evidence level behind each shipped capability.
- Skill orchestrator and flows —
skills/pcf/SKILL.md,create-flow.md,deploy-flow.md,bind-flow.md,pages-flow.md,upgrade-flow.md; covered byscripts/tests/pcf-skill-docs.test.jsand the offline eval harness. - Compatibility matrix and lock sets —
compatibility-matrix.json,lock/standard/,lock/virtual/; covered byscripts/tests/pcf-matrix.test.jsandpcf-ci-build.js --all. - Templates —
templates/field-standard,dataset-standard,field-virtual,dataset-virtual; covered byscripts/tests/pcf-scaffold.test.js,pcf-gates.test.js, and generated-project CI. - Recipes —
recipes/star-rating,hierarchy-tree,lookup-dropdown,contextual-grid,grid-customizer,attachment-uploader; covered byscripts/tests/pcf-scaffold.test.js, recipe unit-template tests, and generated-project CI. - Manifest, source and build gates —
scripts/lint-pcf.js,scripts/pcf-gates.js,scripts/pcf-build.js,scripts/lib/pcf-manifest.js,pcf-code-gate.js,pcf-build.js; covered bypcf-manifest.test.js,pcf-lint-cli.test.js,pcf-code-gate.test.js,pcf-gates.test.js, andpcf-build.test.js. - Doctor and upgrade —
scripts/pcf-doctor.js,scripts/pcf-upgrade.js,scripts/lib/pcf-doctor.js,pcf-upgrade.js; covered bypcf-doctor.test.jsandpcf-upgrade.test.js. - Deploy, verify and inventory —
scripts/pcf-push.js,scripts/verify-pcf.js,scripts/pcf-inventory.js,scripts/lib/pcf-dataverse.js,pcf-binding-verify.js; covered bypcf-push.test.js,pcf-verify-cli.test.js,pcf-inventory.test.js,pcf-dataverse*.test.js, andpcf-binding-verify.test.js. - Public references —
references/pcf-best-practices.md,pcf-deploy.md,pcf-hosts.md,pcf-power-pages.md,pcf-canvas.md,pcf-recipes.md,pcf-testing.md,pcf-troubleshooting.md; covered bypcf-skill-docs.test.jsand repository metadata validators. - Eval harness —
evals/pcf/; covered bynode evals/pcf/run-pcf.js --tier smoke,--tier full, andnode --test evals/pcf/tests/*.test.js. - Drift guard for copied model-apps and shared-skill sources —
scripts/tests/model-apps-copies.test.js; covered by the plugin suite and by CI path filters that include the model-apps sources pcf bundles. - Write-safety hook and markers —
hooks/hooks.json,hooks/validate-write-safety.js; covered byscripts/tests/validate-write-safety.test.jsandnode scripts/validate-hooks-manifests.js.