Skip to main content
plugin

model-apps — Claude Code plugin: model-driven Power Apps builder

model-apps turns a plain-language brief into a model-driven Power Apps app, or into a generative page written in React and TypeScript.

MIT ★ 1,167 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add microsoft/power-platform-skills
/plugin install model-apps@power-platform-skills
Open on GitHub

What model-apps does

Two commands share the work. /app-builder reads a description of the app you want and lays out the Dataverse pieces behind it: tables, relationships, forms, views, charts, security roles, the app itself and its sitemap. /genpage handles generative pages — specialist agents plan the page, create the entities it needs and generate code in parallel, then the bundled SDK deploys it and you check the result in the browser.

You need Node.js LTS, PAC CLI above 2.10.0 and the Azure CLI before the first run. Sign in with az login using the same identity your pac auth list profile shows, because every Dataverse call goes through az, page deployment and language detection included. Neither has a pac fallback, so a signed-out az stops the deploy.

Custom telemetry and built-in Dataverse operations ship switched off. Turn one on with a GENPAGE_ENABLE_... environment variable for a single run, or set it in feature-flags.json to keep it; node scripts/lib/feature-flags.js --list shows the current state. A single az call can take up to 60 seconds, and POWER_PLATFORM_SKILLS_AZ_TIMEOUT_MS (1000–900000) raises that ceiling.

What it helps with

  • scaffold a Dataverse app from a written brief
  • generate a React page bound to your entities
  • ship security roles along with the app and sitemap
  • check a deployed page in the browser
  • enable a feature flag for one run only

Example prompts for the agent

  • Build a model-driven app for tracking support tickets, with forms and a sitemap
  • Generate a page that lists orders and filters them by status
  • Run node scripts/lib/feature-flags.js --list and tell me which flags are on

How to install model-apps

Plugin marketplace

/plugin marketplace add microsoft/power-platform-skills
/plugin install model-apps@power-platform-skills

Step by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own

Questions about model-apps

How do I install model-apps in Claude Code?

Add the marketplace with /plugin marketplace add microsoft/power-platform-skills, then install the plugin: /plugin install model-apps@power-platform-skills.

What does model-apps do?

/app-builder builds a model-driven Power Apps app from a description in plain language, while /genpage produces generative pages in React, TypeScript and Fluent and deploys them through the bundled SDK.

Why does page deployment need the Azure CLI?

Every Dataverse call authenticates through az, and page writes have no pac route at all. Sign in under the same identity your pac auth list profile uses, or the deploy fails.

Source text

model-apps · MIT
# Model Apps Plugin

Build and deploy generative pages (genux) for Power Apps model-driven apps. This plugin provides a complete workflow — from validating prerequisites and gathering requirements, through generating React + TypeScript + Fluent code, to deploying through the bundled SDK and verifying in the browser.

## Installation

### From the marketplace

```bash
/plugin marketplace add microsoft/power-platform-skills
/plugin install model-apps@power-platform-skills
```

### From a local clone

```bash
copilot --plugin-dir /path/to/power-platform-skills/plugins/model-apps
# or
claude --plugin-dir /path/to/power-platform-skills/plugins/model-apps
```

## Prerequisites

| Prerequisite | Required for | Install |
|---|---|---|
| [Node.js](https://nodejs.org/) (LTS) | All skills | `winget install OpenJS.NodeJS.LTS` |
| [PAC CLI](https://learn.microsoft.com/en-us/power-platform/developer/cli/introduction) > 2.10.0 | Signing in, choosing the environment and reading the CLI version (`pac auth`, `pac org who`, `pac help`); the fallbacks of the connection, connector and deployment-settings scripts; reading a tabular connector's table columns (`scripts/connector.js schema --dataset --table`); and listing a tabular connector's tables, which no script wraps (`pac model genpage list-connector-tables`) | `dotnet tool install -g Microsoft.PowerApps.CLI.Tool` |
| [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) (`az`) | Every Dataverse call — tables, apps, languages, entity creation and generative pages — and the Power Apps service token that reading connections and connector metadata uses | `winget install Microsoft.AzureCLI` |

After installing `az`, run `az login` with the same identity as your active `pac auth list` profile. `az` is what every Dataverse call authenticates with — listing tables, apps and languages, entity creation, and the generative pages themselves, which are written, read and deleted through the bundled SDK, not through `pac model genpage` — and it signs in the Power Apps service token that the connection and connector-metadata reads use. **Deploying a page needs `az`**, and so does detecting the environment's languages: there is no `pac` fallback for either, so a missing or signed-out `az` ends language detection with the reason, never with an English default. `pac` signs you in and chooses the environment, and steps in for the connection, connector and deployment-settings scripts only where the SDK has no route or refuses (`connectionsSource` or `source` says which answered; `connectionsFallback` or `fallback` says why the SDK did not). It also lists a tabular connector's tables (`pac model genpage list-connector-tables`; no script wraps it), and `scripts/connector.js schema --dataset --table` reads a table's columns through `pac`: the plugin cannot build the client the SDK reads a connector's tables with. The type generator, the page listing and download, and putting a page in an app, taking it out and deleting it are the SDK's too (`scripts/genpage.js`), so they need `az` and no `pac`.

Each Azure CLI call (a token, `az account show`) may take up to **60 seconds** — a busy machine can
take most of that just to start `az`. A call that runs out of time is reported as a timeout (the
pre-flight's `az_timeout`), never as a missing or signed-out CLI. To allow longer, set
`POWER_PLATFORM_SKILLS_AZ_TIMEOUT_MS` in milliseconds (1000–900000), for example `120000`.

A page write whose outcome is unknown (the connection dropped before the answer) is never sent again blindly: the page is read first, and
what it holds decides whether the write landed — the message says what to check when that cannot be told. There is no `pac` call, and so
no timeout setting, for pages.

## Feature flags (defaults and overrides)

Some capabilities ship **OFF by default** while their cross-repo dependencies roll
out to production: custom telemetry and built-in Dataverse operation authoring are OFF.
Flags are catalogued (with lifecycle status) in `scripts/lib/feature-flags.js`; their on/off
value lives in `feature-flags.json` at the plugin root.

| Flag | Status | Default | Enables | Depends on |
|---|---|---|---|---|
| `custom-telemetry` | in-progress | OFF | A generated page reporting its own events, metrics, traces and exceptions to your Application Insights resource via `props.appInsights` | the page telemetry facade in the UCI host runtime, the GenUX authoring control, the AIBuilder telemetry prompt, and the `GenUxEnableCustomTelemetry` setting — all live in PROD |
| `dataverse-operations` | experimental | OFF | Offering two reviewed built-in Dataverse Functions, WhoAmI and RetrieveVersion, as explicitly selected, button-only page calls (`executeFunction`); `scripts/list-dataverse-operations.js` lists them without contacting the environment | a host runtime that implements `executeFunction`, the page `actionBindings` the plugin writes, and the `GenUxPluginActionAllowList` setting; the environment, the page player and the signed-in user's permissions are not checked — see [the built-in operations reference](references/dataverse-operations.md) |

Connector authoring is in **public preview** and no longer has a feature flag. Connector discovery, binding, deploy, and ALM packaging are always available when the required PAC and host capabilities are present.

Custom API support has no feature flag either: calling a supported public Dataverse Custom API
Action or Function from a generated page (`executeAction` / `executeFunction` /
`listBoundActions`) is always available. `GENPAGE_ENABLE_CUSTOM_API` is ignored — `0` no longer
turns Custom API discovery off, and there is nothing to turn on. The host runtimes,
revision-bound `actionBindings`, environment governance and the signed-in user's privileges
still apply.

**See the current state** (status, whether each flag is on, and why):

```bash
node scripts/lib/feature-flags.js --list
```

**Turn a flag on for a single run** via an environment variable (highest precedence):

```powershell
# Windows (PowerShell)
$env:GENPAGE_ENABLE_DATAVERSE_OPERATIONS = "1"
```

```bash
# macOS / Linux (bash)
export GENPAGE_ENABLE_DATAVERSE_OPERATIONS=1
```

**Turn it on persistently** by changing its committed value in `feature-flags.json`:

```json
{ "dataverse-operations": true }
```

Precedence is **env var → `feature-flags.json` → default OFF** for missing/unset
configuration (fail-closed). Host capabilities and server governance still apply; turning a
flag on grants no new privileges.
The env var name is always `GENPAGE_ENABLE_` plus the flag name in upper case, with
`-` turned into `_` (`dataverse-operations` → `GENPAGE_ENABLE_DATAVERSE_OPERATIONS`), and unknown
flags stay disabled even if a matching env var is set.

Custom API discovery omits private APIs and APIs with Entity/EntityCollection inputs or outputs.
Lookup input names stay available to the author separately from the primitive-only wire
`parameterKinds`; see [the Custom API contract](references/custom-api.md).

## Model selection

Use a general-purpose coding model or an advanced reasoning model. Lightweight models optimized
primarily for fast, simple tasks aren't recommended for `/app-builder` or `/genpage` because both
skills require multistep planning, tool use, code generation, and validation.

## Skills

PCF code components ship in the separate preview [pcf plugin](../pcf/README.md).

The plugin provides two authoring skills: `/app-builder` builds a whole model-driven app, and
`/genpage` builds standalone generative pages for an existing app. **They are independent — you can
use either on its own, and neither requires the other.**

| Skill | Status | Use it when |
|---|---|---|
| [`/app-builder`](#app-builder) | Stable | You want a whole app — tables, relationships, forms, views, charts, security roles, app + sitemap |
| [`/genpage`](#genpage) | Stable | You want one or more generative pages added to an app that already exists |

Already have an app and just want to add a page? Use `/genpage` — you never need to run
`/app-builder` first. Building from scratch? `/app-builder` authors its own generative pages as part
of the build, so you don't need to run `/genpage` afterwards.

### `/app-builder`

> Review the dry-run plan before approving, and use `teardown-model-app.js --apply` to clean up
> probes. `--changed-only` (partial apply) is still experimental and off by default. Report issues
> with `/report-issue`.

Builds and edits a whole model-driven Power App from a natural-language intent, via the headless
vendored `cds-maker-sdk`. It runs an interactive, multi-turn authoring flow and a narrated build:

1. **Select environment** — resolves the target Dataverse org and confirms auth
2. **Author the App Spec** (design-only) — tables, columns, relationships, adaptive forms with
   sub-grids, views, Choice-column charts, dashboards, generative **page intents**, personas, and the
   app shell + sitemap, with two consent levels and previews you approve before anything is written
3. **Guardrail lint** — `spec-lint` + `validateAppSpec` gate the spec before any live call
4. **Plan approval** — a phase-grouped dry-run plan is shown in plan mode for your go-ahead
5. **Generate pages** — dispatches parallel page-builder workers to write each page's `.tsx`
6. **Build** — applies the spec idempotently phase by phase, then optionally `--verify` reconciles
   the deployed app against the spec
7. **Edit** — downloads a deployed app back into an editable App Spec so you can change and rebuild it

**Usage:** Invoke directly with `/app-builder`, or use any of the keywords below:

- `Build an app for tracking service requests`
- `Create a model-driven app to manage suppliers and contracts`
- `Make me an app to manage job candidates and interviews`
- `Edit my app — add a table for invoices and put it on the nav`

### `/genpage`

Creates, updates, and deploys generative pages for model-driven Power Apps. Handles the complete workflow in a single session:

1. **Validate prerequisites** — checks Node.js and PAC CLI version
2. **Authenticate** — verifies PAC CLI auth and `az` (entity creation and page deployment both sign in through `az`)
3. **Gather requirements** — asks about page type, data source, and specific features
4. **Create entities** (optional) — uses the plugin's Node.js Web API scripts to create Dataverse tables, columns, relationships, and choice columns when the requested entities don't exist. Asks which solution to land them in
5. **Choose the app** — lists the environment's apps (`scripts/apps.js list`); when no model-driven app is targeted, the app is created in step 8, from the first page deployed (`scripts/apps.js create`), because an app opens on its pages
6. **Generate schema** — runs `scripts/genpage.js types` (the SDK's type generator) for Dataverse entity pages
7. **Generate code** — produces a complete single-file `.tsx` component (parallel page-builders for multi-page requests)
8. **Deploy** — writes the page through the bundled SDK (`scripts/genpage-upload.js`); a page needs no app, and is added to an app's navigation only when the upload names the app (`--app-id`) and asks for the placement (`--add-to-sitemap`) — `--app-id` alone only pins the default views of the page's tables in the app. For a new app the first page is deployed first, then the app is created from it, then the other pages are added
9. **Verify** — optionally opens the page in Playwright for interactive testing

**Usage:** Invoke directly with `/genpage`, or use any of the keywords below to trigger the skill automatically:

- `Build a data grid page for my model-driven app`
- `Build a sortable contact dashboard with charts for my Power App`
- `I need a genux page to display account records with sorting and filtering`
- `Generate a CRUD page for managing custom entities in Power Apps`
- `Add a new page to my model-driven app that shows opportunity records as cards`

## Running Without Interruption

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(pac *)' --allow-tool 'shell(node *)' --allow-tool 'shell(powershell *)' --allow-tool 'shell(az *)'
```

**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(pac *)",
      "Bash(node *)",
      "Bash(powershell *)",
      "Bash(az *)"
    ]
  }
}
```

**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 hooks
are scoped so they don't interfere with unrelated projects: the write-safety guard
only **flags** (never blocks) and only during an active model-apps authoring session,
and the icon validator only fires on generated-page output. At most, the icon
validator blocks a single tool call (the agent reworks it) — never the whole skill.

| Hook | When | What it does |
|---|---|---|
| Write-safety | before Write/Edit/MultiEdit | **Flags (non-blocking)** writes outside the cwd — only during a model-apps authoring session (a `genpage-plan.md`, `app-spec.json`, or `model-app-plan.md` at/under cwd, so it covers both `/genpage` and `/app-builder`). Never blocks; silent in unrelated projects. |
| Icon validator | after a generated `.tsx` write | Blocks `@fluentui/react-icons` imports that aren't in the verified list. Fires for both skills (gated on the `export default GeneratedComponent` marker, or a sibling `genpage-plan.md` / `model-app-plan.md`). |
| Skill validator | after a skill runs | Runs the skill's `validate*.js` if it has one. |
| Telemetry | on skill start / prompt | Emits `skill_started` usage telemetry (see [Telemetry](#telemetry)). |

**Escape hatches** (environment variables — set to `1` or `true`):

| Variable | Effect |
|---|---|
| `MODEL_APPS_DISABLE_HOOKS` | Disables **all** model-apps hooks (validators + telemetry emit). |
| `MODEL_APPS_SKIP_WRITE_GUARD` | Disables **only** the write-safety guard (keeps the others). |

```powershell
# Windows (PowerShell)
$env:MODEL_APPS_DISABLE_HOOKS = "1"
```

```bash
# macOS / Linux (bash)
export MODEL_APPS_DISABLE_HOOKS=1
```

## Telemetry

model-apps ships opt-out usage telemetry (1DS). It is **on by default** (you opt
out). Events go to the collector for your environment's cloud — the US or EU data
boundary for a public-cloud org, or the matching sovereign collector (GCC, GCC High,
DoD, China); an unrecognized cloud sends nothing. Then:

- **What's collected:** skill name, plugin/PAC/agent versions, OS/Node versions,
  session/correlation IDs, and Dataverse organization and Entra tenant GUIDs when
  PAC is signed in. Model Apps excludes the signed-in user's Entra object ID.
  Events do not include file paths, prompts, tool inputs, entity/table names, URLs,
  credentials, usernames, or hostnames.
- **Local diagnostic mirror:** every event is also written to
  `~/.power-platform-skills/telemetry/model-apps/sessions/<id>/events.jsonl` (even
  when you've opted out of transmission) and retains the same event fields.
  Hand over that one file when filing an issue.
- **Opt out** per-user with `/model-apps:telemetry off` (re-enable with `on`, check
  with `status`), or for CI/automation set
  `POWER_PLATFORM_SKILLS_TELEMETRY_MODEL_APPS_OPTOUT=1` (highest precedence).

## Technology Stack

- **React 17 + TypeScript** — all generated page code
- **Fluent UI V9** — `@fluentui/react-components` for styling and components
- **Single file architecture** — each page is one `.tsx` file with `export default GeneratedComponent`
- **DataAPI** — typed CRUD operations against Dataverse tables via `props.dataApi`
- **PAC CLI** — sign-in and environment choice, the fallbacks of the connection, connector and deployment-settings scripts, and a tabular connector's tables and columns (`pac model genpage list-connector-tables`, `scripts/connector.js schema --dataset --table`); pages, their schema and their listing, download and removal go through the bundled SDK
- **Playwright** — optional browser verification after deployment

## Documentation

- [Build Model-Driven Apps with External Tools](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/model-driven-app-external-tools)
- [Generative Pages with External Tools](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/generative-page-external-tools)
- [Generative Pages Overview](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/generative-pages)
- [Power Apps Model-Driven Apps](https://learn.microsoft.com/en-us/power-apps/maker/model-driven-apps/model-driven-app-overview)
- [PAC CLI Reference](https://learn.microsoft.com/en-us/power-platform/developer/cli/reference/model)

## License

[MIT](../../LICENSE)

© Microsoft · MIT · microsoft/power-platform-skills

Similar plugins

All plugins for Cloud: AWS, Azure, GCP →

From the same set157

The whole set →
power-automate Connects Claude Code to Power Automate cloud flows via the bundled FlowAgent MCP engine. Useful for editing flow actions, diagnosing run failures, and copying flows across environments. ★ 1,167repo stars power-apps-mobile-extension power-apps-mobile-extension is a Claude Code plugin for designing and building native Power Apps Mobile controls as .ppmplugin bundles, with matching PCF controls for Canvas apps. ★ 1,167repo stars mobile-app A Claude skill that scaffolds a Power Apps mobile app on Expo and React Native, covering screens, native features and Power Platform connectors. ★ 1,167repo stars code-apps-preview code-apps-preview is a Claude Code plugin for scaffolding, building, and deploying Power Apps with React, Vite, and Power Platform connectors. ★ 1,167repo stars canvas-apps canvas-apps is a Claude Code plugin that connects the agent to an app open in Power Apps Studio, where it can build or edit screens, controls, and formulas. ★ 1,167repo stars mcp-apps mcp-apps writes the server runtime for a codeful MCP tool, its JSON registration sidecar, and an HTML widget that shows the results — with or without CDN libraries. ★ 1,167repo stars pcf Build, test, deploy, and audit PCF components for Power Apps. Assists with controls for model-driven, canvas, and Power Pages projects. ★ 1,167repo stars power-pages A Microsoft plugin that carries a Power Pages site from scaffold to live URL: templates, local edits, deploy, activation and browser tests. ★ 1,167repo stars

Project sponsors

Companies that keep this analytics open