$npx -y skills add microsoft/power-platform-skills --skill create-code-appCreates Power Apps code apps using React and Vite. Use when building code apps, scaffolding projects, or deploying to Power Platform.
| 1 | **📋 Shared Instructions: [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md)** - Cross-cutting concerns. |
| 2 | |
| 3 | **References:** |
| 4 | |
| 5 | - [prerequisites-reference.md](./references/prerequisites-reference.md) - Prerequisites and required permissions |
| 6 | - [troubleshooting.md](./references/troubleshooting.md) - Common issues, npm scripts, resources |
| 7 | |
| 8 | # Create Power Apps Code App |
| 9 | |
| 10 | ## Workflow |
| 11 | |
| 12 | 1. Prerequisites → 2. Gather Requirements → 3. Plan → 4. Scaffold → 5. Initialize → 6. Build & Deploy (baseline) → 7. Add Data Sources → 8. Implement App → 9. Final Build & Deploy → 10. Summary |
| 13 | |
| 14 | --- |
| 15 | |
| 16 | ### Step 0: Check Memory Bank |
| 17 | |
| 18 | Check for `memory-bank.md` per [shared-instructions.md](${PLUGIN_ROOT}/shared/shared-instructions.md). Skip completed steps. |
| 19 | |
| 20 | ### Step 1: Validate Prerequisites |
| 21 | |
| 22 | Run prerequisite checks **first** -- no point gathering requirements if the environment isn't ready. See [prerequisites-reference.md](./references/prerequisites-reference.md) for details. |
| 23 | |
| 24 | Check Node.js and Git (runs natively in bash): |
| 25 | |
| 26 | ```bash |
| 27 | node --version # Must be v22+ |
| 28 | git --version # Optional but recommended |
| 29 | ``` |
| 30 | |
| 31 | - **Missing Node.js**: Report "Install Node.js v22+ from https://nodejs.org/" and STOP. |
| 32 | - **Node.js below v22**: Report "Node.js 22+ is required. Please upgrade or switch with `nvm use 22`." and STOP. |
| 33 | - **Missing Git**: Report "Recommended but optional." Continue if approved. |
| 34 | - **All present**: Report versions and proceed. |
| 35 | |
| 36 | |
| 37 | ### Step 2: Gather Requirements |
| 38 | |
| 39 | **Skip questions the user already answered in their initial instruction.** |
| 40 | |
| 41 | **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: |
| 42 | |
| 43 | > "What would you like to build? Describe it in your own words — what it does, who uses it, and what problem it solves." |
| 44 | |
| 45 | 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. |
| 46 | |
| 47 | Once you have their description: |
| 48 | |
| 49 | 1. Confirm the app name and clarify the purpose if needed |
| 50 | 2. Ask about data -- focus on **what the app needs to do**, not specific technologies: |
| 51 | - "What data does your app need to work with?" (e.g., company emails, project tasks, custom business records) |
| 52 | - "Does your app need to search existing information, manage its own data, or both?" |
| 53 | - Based on their answers, recommend the best approach: |
| 54 | - **Store and manage custom business data** (tables, forms, CRUD) → Dataverse (`/add-dataverse`) |
| 55 | - **Interact with specific services** (send emails, post messages, manage files) → the appropriate connector |
| 56 | - If they mention existing Dataverse tables, SharePoint lists, or connectors by name, use those directly |
| 57 | 3. Ask about UI requirements: key screens, layout, interactions, theme preference |
| 58 | 4. Ask any clarifying questions now -- resolve all ambiguity before entering plan mode |
| 59 | |
| 60 | ### Step 3: Plan |
| 61 | |
| 62 | 1. Enter plan mode with `EnterPlanMode` |
| 63 | 2. Design the full implementation approach: |
| 64 | - Which `/add-*` skills to run for data sources |
| 65 | - App architecture: components, pages, state management |
| 66 | - Feature list with priority order |
| 67 | 3. Present plan for approval, include `allowedPrompts` from [prerequisites-reference.md](./references/prerequisites-reference.md) |
| 68 | 4. Exit plan mode with `ExitPlanMode` when approved |
| 69 | |
| 70 | ### Step 4: Scaffold |
| 71 | |
| 72 | Ask the user for a folder name. Default to `powerapps-{app-name-slugified}-{timestamp}` if they don't have a preference. |
| 73 | |
| 74 | **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.** |
| 75 | |
| 76 | ```bash |
| 77 | npx degit microsoft/PowerAppsCodeApps/templates/vite {folder} --force |
| 78 | cd {folder} |
| 79 | npm install |
| 80 | ``` |
| 81 | |
| 82 | **Notes:** |
| 83 | |
| 84 | - Use `--force` to overwrite if the directory already has files (e.g., `.claude` from a planning session) |
| 85 | - If targeting an existing directory, use `.` as the folder name: `npx degit microsoft/PowerAppsCodeApps/templates/vite . --force` |
| 86 | - If `npx degit` fails (network issues, npm not found), retry once, then ask the user to run manually |
| 87 | |
| 88 | Verify: `package.json` exists, `node_modules/` created. |
| 89 | |
| 90 | ### Step 5: Initialize |
| 91 | |
| 92 | ```bash |
| 93 | npx power-apps init -n '{user-provided-app-name}' -e <environment-id> |
| 94 | ``` |
| 95 | |
| 96 | **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. |
| 97 | |
| 98 | **Authentication:** On first run, a browser window opens for Microsoft si |