generate-pcf-companion

Generates a dispatcher PCF control that calls native modules via the Power Apps wrap bridge.

808|167|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/microsoft/power-platform-skills --skill generate-pcf-companion
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-pcf-companion
Source: https://github.com/microsoft/power-platform-skills/tree/main/plugins/power-apps-mobile-extension/skills/generate-pcf-companion
Command: npx skills add https://github.com/microsoft/power-platform-skills --skill generate-pcf-companion

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Building a Power Apps Component Framework (PCF) control that correctly dispatches to a third-party native module inside a wrapped mobile app requires precise knowledge of the host bridge contract, manifest schema, and property usage rules — mistakes cause silent on-device failures. This Skill scaffolds the entire companion PCF correctly from the committed manifest.json and PRD.

Core Features & Use Cases

  • PCF scaffolding: Runs pac pcf init with the field template and vanilla DOM framework, then rewrites ControlManifest.Input.xml with human-readable labels and correct bound/input/output property usage.
  • Bridge contract wiring: Generates index.ts that dispatches the composite key <name>/<receiver> through window.PowerApps.NativeExtension.sendAsync with an extractResponse helper that unwraps the wrap host's nested response container.
  • Diagnostics built in: Emits Status, ErrorCode, ErrorMessage outputs plus a raw-response bound property so failures are visible in Power Fx without a native debugger.
  • Use Case: After generating a native extension module for a wrapped Power Apps mobile app, run this Skill to produce the Canvas Studio control that triggers the native operation and surfaces its result, validated by npm run build.

Quick Start

Ask the agent to run /generate-pcf-companion to scaffold the dispatcher PCF for the native module already present in the repository.

Frequently Asked Questions about generate-pcf-companion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a PCF control that calls a native module in Power Apps mobile?

Run pac pcf init with the field template and no framework, then wire index.ts to dispatch a composite key '<name>/<receiver>' through window.PowerApps.NativeExtension.sendAsync. This Skill automates that scaffolding and validates it with npm run build.

Why does my PCF call to a native module fail silently on device?

Silent failures usually come from calling cordova.exec directly, which is unavailable in the PCF sandbox, or passing a bare object instead of a JSON array in args. The control must use the host-injected sendAsync global with args as an array.

What is the difference between bound, input, and output PCF property usage?

Output properties are values the control produces for Power Fx formulas, input properties are read-only values the maker configures, and bound is a two-way column the control reads and writes. Most native-extension PCFs use only input and output, with no bound property.

Does this PCF generation skill deploy to a Power Platform environment?

No, it is local only. It runs pac pcf init, npm install, and npm run build but never calls pac pcf push or requires pac auth; deployment is a separate on-demand step via the publish-pcf-companion skill.

Why does pac pcf push fail with a noAposStringType validation error?

The manifest XSD forbids ASCII apostrophes in display-name-key and description-key attributes. Rephrase strings to avoid possessives and contractions, or use the typographic right single quote U+2019 instead.