npx skills add ...
npx skills add microsoft/power-platform-skills --skill create-code-app
Creates Power Apps code apps using React and Vite. Use when building code apps, scaffolding projects, or deploying to Power Platform.
npx skills add microsoft/power-platform-skills --skill create-code-app
📋 Shared Instructions: shared-instructions.md - Cross-cutting concerns.
References:
Check for memory-bank.md per shared-instructions.md. Skip completed steps.
Run prerequisite checks first -- no point gathering requirements if the environment isn't ready. See prerequisites-reference.md for details.
Check Node.js and Git (runs natively in bash):
nvm use 22." and STOP.Skip questions the user already answered in their initial instruction.
If the user has not described what they want to build (i.e., /create-code-app was invoked with no arguments or a vague prompt), start with a single open-ended question before asking anything else:
"What would you like to build? Describe it in your own words — what it does, who uses it, and what problem it solves."
Wait for their answer. Use it to frame all follow-up questions. Do NOT present a multiple-choice list of app types before the user has described their idea.
Once you have their description:
/add-dataverse)/add-workiq)EnterPlanMode/add-* skills to run for data sourcesallowedPrompts from prerequisites-reference.mdExitPlanMode when approvedAsk the user for a folder name. Default to powerapps-{app-name-slugified}-{timestamp} if they don't have a preference.
IMPORTANT: Use npx degit to download the template. Do NOT use git clone, do NOT manually create files, do NOT download from GitHub UI. degit downloads the template without git history.
Notes:
--force to overwrite if the directory already has files (e.g., .claude from a planning session). as the folder name: npx degit microsoft/PowerAppsCodeApps/templates/vite . --forcenpx degit fails (network issues, npm not found), retry once, then ask the user to run manuallyVerify: package.json exists, node_modules/ created.
Resolve the CLI first (see cli-binary.md): run as
$PA app init …(npx --no-install pa …), never a barepa. Onpower-apps-only projects, translate topower-apps init …(theinitverb and its-n/-eflags are unchanged on both binaries).
Finding the environment ID: It's the GUID in the make.powerapps.com URL: https://make.powerapps.com/environments/<env-id>/home. If you don't pass -e, the CLI will prompt for it interactively.
Authentication: On first run, a browser window opens for Microsoft sign-in. Complete the login and the command continues. No separate auth setup is needed.
See preferred-environment.md for environment selection details.
pa app init failure:
pa app init command failed: [error text]. Please check that environment ID 32a51012-... is correct and that you have maker permissions in that environment."Critical: Read power.config.json after init and verify environmentId is set correctly.
Pre-approved: This baseline deploy is part of the scaffold flow and does not require a separate confirmation prompt.
Build and deploy the bare template to verify the pipeline works before adding data sources.
Verify dist/ folder created with index.html and assets/.
Deploy via the resolved CLI:
$PA app pushonpa, orpower-apps pushonpower-apps-only projects (see cli-binary.md).
Capture app URL from output: https://apps.powerapps.com/play/e/{env-id}/app/{app-id}
Common deploy errors: See troubleshooting.md.
Create or update memory-bank.md in the project root now -- don't wait until the end. Include:
This ensures progress is saved even if the session ends unexpectedly.
Invoke the /add-* skills identified in the plan (Step 3). Run each in sequence. Pass context as arguments so sub-skills skip redundant questions (project path, connector name, etc.):
| App needs to... | Invoke |
|---|---|
| Store/manage custom business data | /add-dataverse |
| Track work items, bugs, pipelines | /add-azuredevops |
| Send or read Teams messages | /add-teams |
| Read/write Excel spreadsheet data | /add-excel |
| Upload, download, or manage files | /add-onedrive |
| Work with SharePoint lists or docs | /add-sharepoint |
| Send emails, read inbox, manage calendar | /add-office365 |
| Invoke a Copilot Studio agent | /add-mcscopilot |
| Search M365 data or get AI-powered answers | /add-workiq |
| Connect to another service | /add-connector |
Each /add-* skill runs npm run build to catch errors. Do NOT deploy yet.
If no data sources needed: Skip to Step 8.
This is the core step. Build the actual app features described in the plan from Step 3.
Grep to find methods in generated service files (they can be very large -- see connector-reference.md). Do NOT read entire generated files.*Service.getAll(), *Service.create(), etc.)Key rules:
src/generated/ unless fixing known issuesFix any TypeScript errors. Verify dist/ contains the updated app.
Ask the user: "Ready to deploy to [environment name]? This will update the live app." Wait for explicit confirmation before proceeding.
Provide:
npm run build && pa app push), how to add more data sources/add-datasource -- add another data source (describe what you need, and the plugin will recommend the best approach)/add-dataverse -- store and manage custom business data/add-azuredevops -- track work items, bugs, and pipelines/add-teams -- send and read Teams messages/add-sharepoint -- work with SharePoint lists or documents/add-office365 -- send emails, manage calendar/add-workiq -- search M365 data or get AI-powered answers about company info/add-connector -- connect to any other serviceUpdate the memory bank (created in Step 6) with final state:
These walkthroughs show the full sequence from user request to final output — commands run, files changed, and the verbatim summary format the assistant should use.
User request:
"Build me a simple task tracker that stores tasks in Dataverse. I want to add tasks, mark them complete, and see a list."
Commands run (in order):
Files changed:
| File | Change |
|---|---|
power.config.json | Created by pa app init — contains environmentId |
src/generated/models/Cr123_taskModel.ts | Generated by pa app add data-source |
src/generated/services/Cr123_taskService.ts | Generated by pa app add data-source |
src/components/TaskList.tsx | Created — renders task list with status filter |
src/components/AddTaskForm.tsx | Created — form to add new tasks |
src/App.tsx | Updated — wires components to Cr123_taskService |
memory-bank.md | Created in Step 7, updated in Step 11 |
Final assistant summary (verbatim format):
What to record in memory-bank.md:
User request:
"My app already exists. Add SharePoint so I can read items from a list called 'Project Milestones'."
Commands run (in order):
Files changed:
| File | Change |
|---|---|
src/generated/services/SharePointOnlineService.ts | Generated — contains GetItems, PostItem, etc. |
src/generated/models/SharePointOnlineModel.ts | Generated — TypeScript interfaces |
.power/schemas/sharepointonline/ | Generated schema files |
memory-bank.md | Updated — connector recorded |
Final assistant summary (verbatim format):