plugins/code-apps/skills/create-code-app/SKILL.md
Creates Power Apps code apps using React and Vite. Use when building code apps, scaffolding projects, or deploying to Power Platform.
npx skillsauth add microsoft/power-platform-skills create-code-appInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
📋 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):
node --version # Must be v22+
git --version # Optional but recommended
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)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.
npx degit microsoft/PowerAppsCodeApps/templates/vite {folder} --force
cd {folder}
npm install
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.
npx power-apps init -n '{user-provided-app-name}' -e <environment-id>
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.
npx power-apps init failure:
npx power-apps 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.
npm run build
Verify dist/ folder created with index.html and assets/.
npx power-apps push
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 |
| 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 issuesnpm run build
Fix 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.
npx power-apps push
Provide:
npm run build && npx power-apps 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-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):
# Step 1: Prerequisites
node --version # → v22.4.0
# Step 4: Scaffold
npx degit microsoft/PowerAppsCodeApps/templates/vite powerapps-task-tracker-20260302 --force
cd powerapps-task-tracker-20260302
npm install
# Step 5: Initialize (browser login prompt on first run; CLI prompts for env ID if -e omitted)
npx power-apps init -n 'Task Tracker' -e <environment-id>
# Step 6: Baseline deploy (pre-approved as part of scaffold flow)
npm run build
npx power-apps push
# → App URL: https://apps.powerapps.com/play/e/32a51012-.../app/<app-id>
# Step 7: Add Dataverse (via /add-dataverse)
npx power-apps add-data-source -a dataverse -t cr123_task
npm run build # verify connector — no deploy yet
# Step 9: Final deploy (requires user confirmation)
npm run build
npx power-apps push
Files changed:
| File | Change |
| --------------------------------------------- | ----------------------------------------------------- |
| power.config.json | Created by npx power-apps init — contains environmentId |
| src/generated/models/Cr123_taskModel.ts | Generated by npx power-apps add-data-source |
| src/generated/services/Cr123_taskService.ts | Generated by npx power-apps 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):
Task Tracker is live.
App: Task Tracker
Environment: <your-environment-name> (<environment-id>)
URL: https://apps.powerapps.com/play/e/<environment-id>/app/<app-id>
Project: ~/powerapps-task-tracker-20260302/
What was built:
- Task list view with Active / Completed filter
- Add task form (title, description, due date)
- Mark complete / delete actions
- Dataverse table `cr123_task` (Title, Description, DueDate, IsComplete)
To redeploy: npm run build && npx power-apps push (from the project folder)
What you can add next:
- /add-teams — post task updates to a Teams channel
- /add-office365 — send email notifications on completion
What to record in memory-bank.md:
# Task Tracker — Memory Bank
## Project
- Path: ~/powerapps-task-tracker-20260302/
- App name: Task Tracker
- Environment: <your-environment-name> (<environment-id>)
- App URL: https://apps.powerapps.com/play/e/<environment-id>/app/<app-id>
## Completed Steps
- [x] Step 1: Prerequisites validated
- [x] Step 4: Scaffold (npx degit)
- [x] Step 5: Initialize (npx power-apps init)
- [x] Step 6: Baseline deploy
- [x] Step 7: Add Dataverse (cr123_task)
- [x] Step 8: Implement app (TaskList, AddTaskForm)
- [x] Step 9: Final deploy
## Data Sources
- Dataverse: cr123_task (Title, Description, DueDate, IsComplete)
## Components
- TaskList.tsx — filtered list, mark complete, delete
- AddTaskForm.tsx — create new tasks
## Next Steps
- Consider /add-teams for task assignment notifications
User request:
"My app already exists. Add SharePoint so I can read items from a list called 'Project Milestones'."
Commands run (in order):
# Step 6: Get connection ID (via /list-connections)
npx power-apps list-connections
# → ConnectionId: conn-sp-xyz789 (SharePoint Online)
# Step 7: Discover sites
npx power-apps list-datasets -a sharepointonline -c conn-sp-xyz789
# → https://contoso.sharepoint.com/sites/Projects
# Step 8: Discover tables
npx power-apps list-tables -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects'
# → Project Milestones, Documents, Team Wiki
# Step 9: Add connector
npx power-apps add-data-source -a sharepointonline -c conn-sp-xyz789 -d 'https://contoso.sharepoint.com/sites/Projects' -t 'Project Milestones'
# Step 11: Build to verify
npm run build # → success
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):
SharePoint Online connector added.
Connector: SharePoint Online
Site: https://contoso.sharepoint.com/sites/Projects
List: Project Milestones
Build: Passed ✓
Usage:
const result = await SharePointOnlineService.GetItems({
dataset: "https://contoso.sharepoint.com/sites/Projects",
table: "Project Milestones"
});
const milestones = result.data?.value || [];
Next: Implement your UI components using the generated service, then run /deploy when ready.
tools
Configure the Canvas Authoring MCP server for the current coauthoring session. USE WHEN "configure MCP", "set up MCP server", "MCP not working", "connect Canvas Apps MCP", "canvas-authoring not available", "MCP not configured", "set up canvas apps". DO NOT USE WHEN prerequisites are missing — direct the user to install .NET 10 SDK first.
development
Use when the user asks to "set up authentication", "add login", "add logout", "add sign in", "enable auth", "add role-based access", "add authorization", "protect routes", "configure identity provider", "configure Entra ID", "configure Entra External ID", "configure OpenID Connect", "add OIDC", "set up SAML", "set up WS-Federation", "set up local login", "add username password", "add Facebook login", "add Google sign in", "add Microsoft Account", "set up invitation login", or otherwise wants to set up authentication (login/logout) and role-based authorization for their Power Pages code site using any supported identity provider (Microsoft Entra ID, Entra External ID, OpenID Connect, SAML2, WS-Federation, local authentication, Microsoft Account, Facebook, or Google).
development
Creates, updates, and deploys Power Apps generative pages for model-driven apps using React v17, TypeScript, and Fluent UI V9. Orchestrates specialist agents for planning, entity creation, and code generation. Use it when user asks to build, retrieve, or update a page in an existing Microsoft Power Apps model-driven app. Use it when user mentions "generative page", "page in a model-driven", or "genux".
development
Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new Power Pages website or portal.