From code-apps-preview
Adds Dataverse tables to Power Apps code apps with generated TypeScript models and services. Creates new tables via API. Use for connecting to Dataverse, schema design, or querying data.
npx claudepluginhub microsoft/power-platform-skills --plugin code-apps-previewThis skill is limited to using the following tools:
**๐ Shared Instructions: [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns.
Populates Dataverse tables with sample records via OData API for testing and demoing Power Pages sites. Handles prerequisites, table discovery from manifest or API, and ordered insertions.
Creates React and Vite code apps for Power Apps. Scaffolds projects, checks prerequisites like Node.js and pac CLI, authenticates, builds, and deploys to Power Platform.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Share bugs, ideas, or general feedback.
๐ Shared Instructions: shared-instructions.md - Cross-cutting concerns.
References:
Two paths: existing tables (skip to Step 5) or new tables (full workflow).
Check memory bank for project context. Ask the user:
account, contact, cr123_customentity)If tables already exist: Skip to Step 5.
If creating new tables:
contact for people, account for organizations)EnterPlanMode, present ER model with tables, columns, relationships, and creation orderExitPlanModeSee api-authentication-reference.md for full details.
az account show # Verify Azure CLI logged in
pwsh -NoProfile -Command "pac org who" # Get environment URL
$api = Initialize-DataverseApi -EnvironmentUrl "https://<org>.crm.dynamics.com"
$headers = $api.Headers
$baseUrl = $api.BaseUrl
$publisherPrefix = $api.PublisherPrefix
Requires System Administrator or System Customizer security role.
Always query existing tables first before creating:
$existingTables = Invoke-RestMethod -Uri "$baseUrl/EntityDefinitions?`$filter=IsCustomEntity eq true&`$select=SchemaName,LogicalName,DisplayName" -Headers $headers
See table-management-reference.md for Find-SimilarTables, Compare-TableSchemas, and Build-TableNameMapping functions.
Present findings to user with AskUserQuestion:
Get explicit confirmation before creating. Create in dependency order:
Use safe functions from table-management-reference.md:
New-DataverseTableIfNotExistsAdd-DataverseColumnIfNotExistsAdd-DataverseLookupIfNotExists (from data-architecture-reference.md)For each table:
pwsh -NoProfile -Command "pac code add-data-source -a dataverse -t <table-logical-name>"
Can add multiple tables by running the command for each one.
The command generates:
src/generated/models/{Table}Model.ts -- TypeScript interfacessrc/generated/services/{Table}Service.ts -- CRUD methods (create, get, getAll, update, delete)Show the user a usage example:
import { AccountsService } from "../generated/services/AccountsService";
const result = await AccountsService.getAll({
select: ["name", "accountnumber"],
filter: "statecode eq 0",
orderBy: ["name asc"],
top: 50
});
const accounts = result.data || [];
Key rules:
AccountsService.getAll()), not fetch/axiosresult.data for actual datanpm run build
Fix TypeScript errors before proceeding. Do NOT deploy yet.
Record which tables were added (or created), generated files, and any schema notes.