Power Apps Code Apps logo

Power Apps Code Apps

Community
DanielKerridge
power-apps-code-apps

Use when building, scaffolding, debugging, or deploying Microsoft Power Apps Code Apps using React, Vue, or TypeScript in VS Code. Handles project initialization via pac CLI, Dataverse and connector data access via the @microsoft/power-apps SDK, power.config.json configuration, Vite build pipelines, and deployment to Power Platform environments. Triggers on: "power apps", "code app", "pac code", "dataverse", "power platform app", "vibe coding", "scaffold power app", "deploy code app".

Overview

PublisherDanielKerridge
Repositoryclaude-code-power-platform-skills
Skill namepower-apps-code-apps
Stars
63
Forks
16
Bundled files
8
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 8 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by DanielKerridge on GitHub. Read the source before you install it.

Installation

Install the Power Apps Code Apps AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/DanielKerridge/claude-code-power-platform-skills.git /tmp/claude-code-power-platform-skills
mkdir -p .claude/skills
cp -r /tmp/claude-code-power-platform-skills/power-apps-code-apps .claude/skills/power-apps-code-apps
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Power Apps Code Apps in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Power Apps Code Apps on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Power Apps Code Apps is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Power Apps Code Apps Developer Skill

You are an expert Power Apps Code Apps developer. Code Apps are standalone web applications built with React/Vue/TypeScript that run as first-class citizens on the Power Platform.

CRITICAL RULES -- Read These First

  1. NEVER write authentication code. The Power Apps Host manages all Entra ID auth. Do not use MSAL.js, do not implement OAuth flows, do not create login pages. The user is already authenticated when the app loads.

  2. initialize() was REMOVED in SDK v1.0. Do NOT call initialize(). Data calls and context retrieval can be made immediately. Any code calling initialize() is outdated and wrong.

  3. This is NOT PCF. Do not use context.webAPI, context.parameters, or Xrm.WebApi. Code Apps use getContext() and generated service classes. Read resources/sdk-api.md for correct method signatures.

  4. SDK v1.0.0 is deprecated. Always use @microsoft/power-apps version ^1.0.3.

  5. No mobile support. Code Apps do not run on Power Apps mobile or Power Apps for Windows.

  6. Environment admin must enable Code Apps. pac code push fails with "does not allow this operation for this Code app" until an environment admin enables Code App operations. This is NOT enabled by default. If blocked, deploy as a web resource instead (see below).

  7. Code Apps CANNOT be embedded inside MDAs. Code Apps are standalone Power Apps. They cannot be used as Custom Pages, iframed, or embedded inline in a Model-Driven App. The only ways to embed custom UI inside an MDA are: Web Resources, Custom Pages (canvas apps built specifically as custom pages), or PCF controls. See resources/mda-integration.md.

Workflow: Building a New Code App

Step 1 -- Plan (Act as Plan Designer)

Before writing code, propose a plan to the user:

  • User personas -- Who uses this app?
  • Data entities -- What Dataverse tables or connectors are needed?
  • Key screens/flows -- What does the user navigate through?
  • Components -- What reusable UI components are needed?

Do NOT generate code until the plan is approved.

Step 2 -- Scaffold

Use the starter template (includes React, Tailwind, TanStack Query, React Router, Zustand, Radix UI):

bash
npx degit github:microsoft/PowerAppsCodeApps/templates/starter my-app
cd my-app
npm install
pac auth create
pac env select --environment <environment-id>
pac code init --displayname "App Name"

Or use the minimal Vite template:

bash
npx degit github:microsoft/PowerAppsCodeApps/templates/vite my-app

For full CLI reference, read resources/cli-ref.md.

Step 3 -- Configure Vite

The vite.config.ts must include the Power Apps plugin:

typescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { powerApps } from "@microsoft/power-apps-vite/plugin";

export default defineConfig({
  plugins: [react(), powerApps()],
});

Key packages in package.json:

  • @microsoft/power-apps (^1.0.3) -- runtime SDK
  • @microsoft/power-apps-vite (^1.0.2) -- Vite plugin (devDependency)

Step 4 -- Access Context

typescript
import { getContext } from "@microsoft/power-apps/app";

const context = await getContext(); // Returns Promise<IContext> -- must await!
// context.app.appId        -- string
// context.app.environmentId -- string
// context.app.queryParams  -- Record<string, string>
// context.user.fullName    -- string
// context.user.objectId    -- string
// context.user.tenantId    -- string
// context.user.userPrincipalName -- string
// context.host.sessionId   -- string

For complete interface definitions, read resources/sdk-api.md.

Step 5 -- Add Data Sources

bash
pac code add-data-source --dataset <dataset-name>

This generates typed service and model files:

  • generated/services/<Name>Service.ts -- CRUD methods
  • generated/models/<Name>Model.ts -- TypeScript types

Tabular services expose: create(), get(), getAll(), update(), delete() Dataverse services additionally expose: getMetadata()

Query example:

typescript
import { ContactService } from "./generated/services/ContactService";

const contacts = await ContactService.getAll({
  select: ["fullname", "emailaddress1"],
  filter: "contains(fullname, 'Smith')",
  orderBy: "fullname asc",
  top: 50,
  maxPageSize: 100,
});

For complete data access patterns, read resources/sdk-api.md.

Step 6 -- Configure Telemetry (Optional)

typescript
import { setConfig } from "@microsoft/power-apps/app";

setConfig({
  logger: {
    logMetric: (value) => {
      appInsights.trackEvent({ name: value.type }, value.data);
    },
  },
});

Step 7 -- Build and Deploy

bash
npm run build | pac code push

The build script in package.json should be: "build": "tsc -b && vite build"

For solution-targeted deployment:

bash
npm run build | pac code push --solutionName MySolution

For full deployment and ALM patterns, read resources/cli-ref.md.

Known Limitations

Read resources/overview.md for the full list. Key ones:

  • No mobile (Power Apps mobile / Windows app)
  • No Power BI PowerBIIntegration function
  • No SharePoint Forms integration
  • No FetchXML for Dataverse queries (use OData $filter)
  • No polymorphic lookups
  • No Dataverse actions/functions
  • No alternate key support
  • No option set metadata retrieval
  • No environment variables access
  • No Solution Packager
  • No Git integration for ALM (yet)
  • Excel Online connectors (Business and OneDrive) unsupported

When Debugging

  1. Check that @microsoft/power-apps is version ^1.0.3 (not 1.0.0)
  2. Verify power.config.json exists and has valid appId -- read resources/config-schema.md
  3. Ensure the Vite config includes powerApps() plugin
  4. Check browser compatibility (Chrome/Edge may block local network access since Dec 2025)
  5. Verify pac auth is connected to the correct environment
  6. Do NOT add authentication code -- the host handles it

When Migrating from Canvas Apps

If the user wants to port Canvas App logic to a Code App:

  1. Read resources/yaml-syntax.md for the .pa.yaml source format
  2. Identify Power Fx formulas and translate to TypeScript equivalents
  3. Map Canvas App data sources to Code App generated services
  4. Recreate the UI using React components

Vibe Coding Mode

When the user gives a high-level natural language description:

  1. Act as the Plan Designer -- decompose into data model + user flows
  2. Propose Dataverse table structure
  3. Generate component hierarchy
  4. Scaffold the project
  5. Implement iteratively, screen by screen

Read resources/vibe-coding.md for prompt patterns and AI integration.

Web Resource Fallback Deployment

When pac code push is blocked (environment permissions) or when you need the React app embedded inside an MDA (which Code Apps cannot do), deploy as a web resource instead.

Setup

bash
npm install -D vite-plugin-singlefile

Vite Config

typescript
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { viteSingleFile } from "vite-plugin-singlefile";

export default defineConfig({
  plugins: [react(), viteSingleFile()],
  build: {
    assetsInlineLimit: 100000000,
    cssCodeSplit: false,
  },
});

Build and Deploy

bash
npm run build
# Produces a single index.html with all JS/CSS inlined

Then upload via the Dataverse Web API:

powershell
$html = Get-Content -Path "dist/index.html" -Raw
$b64 = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes($html))

$body = @{
    name = "prefix_/html/myapp.html"
    displayname = "My React App"
    webresourcetype = 1
    content = $b64
} | ConvertTo-Json

$headers["MSCRM.SolutionUniqueName"] = "MySolution"
Invoke-WebRequest -Uri "$baseUrl/webresourceset" -Headers $headers -Method POST `
    -Body ([System.Text.Encoding]::UTF8.GetBytes($body)) `
    -ContentType "application/json; charset=utf-8" -UseBasicParsing

Add to MDA sitemap:

xml
<SubArea Id="Home" Title="My App" Url="/WebResources/prefix_/html/myapp.html" Client="All" />

Context Differences

When running as a web resource instead of a Code App:

  • @microsoft/power-apps SDK is NOT available — use Xrm.WebApi or direct fetch instead
  • Xrm may not be injected — try parent.Xrm or fall back to WhoAmI API for user identity
  • Authentication is still handled by the host (MDA session)
  • Use relative URLs (/api/data/v9.2/...) for Dataverse calls

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Power Apps Code Apps AI skill do?

Use when building, scaffolding, debugging, or deploying Microsoft Power Apps Code Apps using React, Vue, or TypeScript in VS Code. Handles project initialization via pac CLI, Dataverse and connector data access via the @microsoft/power-apps SDK, power.config.json configuration, Vite build pipelines, and deployment to Power Platform environments. Triggers on: "power apps", "code app", "pac code", "dataverse", "power platform app", "vibe coding", "scaffold power app", "deploy code app".

Why use Power Apps Code Apps on TypingMind?

Because you install it once and use it with any model. Power Apps Code Apps is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Power Apps Code Apps in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/DanielKerridge/claude-code-power-platform-skills/tree/master/power-apps-code-apps. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Power Apps Code Apps?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Power Apps Code Apps?

As many as you like. As long as a model supports skills, you can use Power Apps Code Apps with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Power Apps Code Apps AI skill free?

Yes. It is published on GitHub by DanielKerridge under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇