pcf — плагин для Claude Code: что делает и как установить
Сборка, тестирование, деплой и аудит компонентов PCF для Power Apps. Помогает создавать контролы для model-driven и canvas-приложений.
MIT ★ 1 167 обновлён 2026-10-29
/plugin marketplace add microsoft/power-platform-skills
/plugin install pcf@power-platform-skillsЧто делает pcf
Плагин pcf автоматизирует работу с Power Apps component framework в проектах для model-driven приложений, Power Pages и canvas apps. Работа начинается с этапа планирования: формируется pcf-intent.json и файл pcf-plan.md, требующий одобрения разработчика. Затем плагин разворачивает проект по официальным шаблонам Microsoft, выполняет линтинг, модульные тесты и проверку манифеста.
Для локальной генерации и тестирования кода достаточно среды Node.js 20+. Однако без установленных PAC CLI и .NET SDK деплой решения через pac pcf push выполнить не удастся, а аудит зависимостей в Dataverse потребует Azure CLI (az).
Плагин находится в статусе превью. Поддержка Power Pages пока ограничена стандартными полями форм и тегом Liquid {% codecomponent %}, а контролы наборов данных для Pages ещё не поддерживаются.
Какие задачи решает
- сгенерировать шаблон компонента PCF из репозитория Microsoft
- проверить манифест и код перед сборкой в продакшен
- развернуть компонент через PAC CLI с подтверждением окружения
- найти все зависимости и места использования контрола в Dataverse
Примеры запросов агенту
- /pcf:pcf Создай контрол рейтинга звёздами для формы model-driven
- /pcf Продиагностируй, почему проект PCF не собирается
- /pcf Разверни компонент и проверь привязку к полям
Как установить pcf
Через маркетплейс плагинов
/plugin marketplace add microsoft/power-platform-skills/plugin install pcf@power-platform-skillsПо шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой
Вопросы о pcf
Как установить pcf в Claude Code?
Сначала подключите каталог командой /plugin marketplace add microsoft/power-platform-skills, а затем установите плагин вызовом /plugin install pcf@power-platform-skills.
Что делает плагин pcf?
Он ведёт разработчика по полному циклу создания PCF-компонентов: от генерации файлов по шаблонам и локальных тестов до деплоя в Power Apps.
Какие системные утилиты нужны для работы?
Для локального создания проектов и тестов требуется Node.js 20+. Для упаковки и деплоя обязательны PAC CLI и .NET SDK, а для инвентаризации в Dataverse — Azure CLI.
Исходный текст
pcf · MIT
# PCF Plugin
Build, test, diagnose, upgrade, deploy, bind, verify and inventory Power Apps component framework (PCF) code components for model-driven apps, with guided setup for Power Pages standard field controls and canvas apps.
> **Preview**: Behaviour, file formats and commands may change between releases, and no recipe is runtime-certified yet. See [`docs/pcf-capabilities.md`](docs/pcf-capabilities.md) for what is proven today and [#656](https://github.com/microsoft/power-platform-skills/issues/656) for pending work.
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.
Canvas apps are guided: an admin must turn on **Power Apps component framework for canvas apps** in each environment in the Power Platform admin center. The skill uses the model-driven gate profile and reviews canvas API limits by hand; reading the setting and automated canvas runtime evidence are not implemented. See [canvas setup](references/pcf-canvas.md).
## Installation
```bash
/plugin marketplace add microsoft/power-platform-skills
/plugin install pcf@power-platform-skills
```
```bash
copilot --plugin-dir /path/to/power-platform-skills/plugins/pcf
# or
claude --plugin-dir /path/to/power-platform-skills/plugins/pcf
```
## Prerequisites
| Prerequisite | Required for | Install |
|---|---|---|
| [Node.js](https://nodejs.org/) 20+ and npm | All PCF work | `winget install OpenJS.NodeJS.LTS` |
| [PAC CLI](https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction) | Deploy/package flows | `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` |
| [.NET SDK](https://dotnet.microsoft.com/download) | PAC solution packaging and package smoke tests | `winget install Microsoft.DotNet.SDK.8` |
| [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) (`az`) | Dataverse verify and inventory reads | `winget install Microsoft.AzureCLI` |
`/pcf` can scaffold, lint, test, build, doctor and upgrade locally with Node.js alone. Deploy needs PAC CLI and the .NET SDK; verify and inventory need Azure CLI for Dataverse Web API reads.
## Skill
Invoke as `/pcf:pcf` when the namespaced form matters, or `/pcf` when unambiguous.
1. **Plan** — captures `pcf-intent.json`, renders `pcf-plan.md`, and asks for approval before writes.
2. **Scaffold** — creates field/dataset and standard/virtual projects from Microsoft-maintained templates, with optional recipes.
3. **Implement and repair** — applies PCF best practices, host policy, source checks and upgrade guidance.
4. **Gate** — runs manifest, host, source, lint, unit-test and production-build checks.
5. **Deploy** — uses `pac pcf push` with an explicit environment and recorded consent.
6. **Bind and verify** — guides Maker binding, then checks registration and draft/published metadata.
7. **Inventory** — lists registered controls and registered where-used dependencies.
Example prompts:
- `Create a PCF star rating control for a model-driven form`
- `Diagnose why this PCF project will not build`
- `Upgrade this PCF control to the pcf compatibility matrix`
- `Deploy this PCF control and verify the binding`
- `Inventory where this PCF control is used`
## Running Without Interruption
The skill pauses before environment writes, destructive local changes, deployment, and binding instructions that require maker action. Unattended runs may scaffold, lint, test, build, doctor, upgrade in dry-run mode, verify already-deployed metadata, and inventory read-only Dataverse evidence when credentials are available.
The plugin invokes multiple tools during a session. To reduce approval prompts:
### GitHub Copilot CLI
**Option 1 — Allow specific tools (recommended)**
```bash
copilot --allow-tool 'write' --allow-tool 'shell(node *)' --allow-tool 'shell(npm *)' --allow-tool 'shell(pac *)' --allow-tool 'shell(az *)' --allow-tool 'shell(powershell *)'
```
**Option 2 — Allow all tools**
```bash
copilot --allow-all-tools
```
### Claude Code
**Option 1 — Permission mode (recommended)**
```jsonc
// .claude/settings.json
{
"defaultMode": "acceptEdits",
"permissions": {
"allow": [
"Bash(node *)",
"Bash(npm *)",
"Bash(pac *)",
"Bash(az *)",
"Bash(powershell *)"
]
}
}
```
**Option 2 — Auto-accept all**
```bash
claude --dangerously-skip-permissions
```
## Hooks and guardrails
The plugin registers lifecycle hooks (in `hooks/hooks.json`) that run automatically while it's loaded. They are **fail-open**: any internal error exits 0, so a hook can never fail or abort a skill run. Because the plugin installs **globally**, the write-safety guard is scoped so it does not interfere with unrelated projects: it only **flags** (never blocks) writes outside the cwd during an active PCF authoring session (a `pcf-intent.json` or `pcf-plan.md` at/under cwd).
| Hook | When | What it does |
|---|---|---|
| Write-safety | before Write/Edit/MultiEdit | **Flags (non-blocking)** writes outside the cwd only during a PCF authoring session. Never blocks; silent in unrelated projects. |
| Skill telemetry | before Skill/skill | Emits `skill_started` for tracked PCF skills; see [Telemetry](#telemetry). |
| Prompt telemetry | on UserPromptSubmit | Emits `skill_started` for tracked PCF slash commands; see [Telemetry](#telemetry). |
**Escape hatches** (environment variables — set to `1` or `true`):
| Variable | Effect |
|---|---|
| `PCF_DISABLE_HOOKS` | Disables **all** pcf hooks. |
| `PCF_SKIP_WRITE_GUARD` | Disables **only** the write-safety guard. |
```powershell
# Windows (PowerShell)
$env:PCF_DISABLE_HOOKS = "1"
```
```bash
# macOS / Linux (bash)
export PCF_DISABLE_HOOKS=1
```
## Telemetry
Usage telemetry is **enabled and default-on** for transmission, with **no first-run prompt**. PCF shares model-apps' 1DS tenant and instrumentation keys; its bundled `ikey.json` is a byte-identical copy.
The hooks send **`skill_started` only**, with these approved base fields:
- `pluginName`, `pluginVersion`, `skillName` - plugin and invoked skill identity.
- `sessionId`, `correlationId` - session and per-invocation correlation.
- `osName`, `osVersion`, `nodeVersion` - OS and Node runtime metadata (Node major version only).
- `pacCliVersion`, `aiAgentName`, `aiAgentVersion` - PAC and host agent metadata when available.
- `orgId`, `tenantId` - Dataverse organization and Entra tenant GUIDs when PAC is signed in.
There is **no user object ID** and **no `eventInfo` payload**. The Power Apps client `event` envelope uses `clientType: "PcfAIPlugin"` and `pluginName: "pcf"` so PCF usage stays separate from other plugins and native-client traffic.
**Routing matches model-apps:** a public-cloud organization routes by its geo to the US or EU collector, with no public-default fallback when its geo is unknown. Only signed-out PAC uses the configured US default. Sovereign or internal clouds route from the PAC cloud stamp alone, never to a public collector; unknown clouds and signed-in organizations without a cloud stamp send nothing.
**Never sent:** file paths, cwd, environment variables, prompts, skill arguments, tool inputs, site names, Dataverse URLs, stack traces, error-message text, credentials, usernames or hostnames.
**Transmission opt-outs:** `/pcf:telemetry off` saves `telemetry["pcf"] = "off"` in `~/.power-platform-skills/config.json`; `POWER_PLATFORM_SKILLS_TELEMETRY_PCF_OPTOUT=1` (or `true`) has the **highest precedence**, including over `/pcf:telemetry on`. `/pcf:telemetry status` shows the actual build state and effective preference.
**Local mirror:** `~/.power-platform-skills/telemetry/pcf/sessions/<sessionId>/events.jsonl` retains the same approved fields even after a transmission opt-out. Sessions older than 14 days are pruned best-effort, and logs rotate above 10 MB.
## Relation to model-apps
PCF code components ship in this separate plugin because the same component can be used by model-driven apps, canvas apps and Power Pages; this release builds and verifies them for model-driven apps, and guides Power Pages standard field controls and canvas apps. The model-apps plugin still owns whole-app and generative-page authoring: `/model-apps:app-builder` builds whole apps, and `/model-apps:genpage` builds pages. The plugins connect only at the skill level. With both installed, an agent working in `/model-apps:app-builder` can hand a control off to `/pcf:pcf` by passing it a `pcf-intent.json`; App Builder does not do this on its own. Neither plugin runs the other's scripts, because each installs on its own.
© Microsoft · MIT · microsoft/power-platform-skills