Scaffold a Power Apps Code Apps preview project with Vite, React, TypeScript, PAC CLI, Power Apps SDK, PowerProvider, connector services, Fluent UI, package scripts, README, and deployment guidance. Use when asked to create, initialize, or configure a code-first Power Apps Code App project, add supported connectors, or prepare pac code push deployment.
Create a complete code-first Power Apps Code Apps project using Vite, React, TypeScript, PAC CLI initialization, SDK setup, connector integration, sample UI, and deployment documentation.
When to invoke
"Scaffold a Power Apps Code App project."
"Create a Vite React TypeScript app for Power Apps Code Apps."
"Set up PAC CLI and pac code push for a Code App."
"Add Office 365 Users or SharePoint connector services to a Code App."
"Generate PowerProvider.tsx and power.config.json for Power Apps."
Prerequisites and context
Prerequisite
Notes
Visual Studio Code
Use Power Platform Tools extension.
Node.js
LTS v18.x or v20.x recommended.
Git
Version control.
Power Platform CLI
Latest PAC CLI.
Power Platform environment
Code Apps preview enabled by admin setting.
Licenses
Power Apps Premium licenses for end users.
Azure account
Needed for Azure SQL or other Azure connectors.
Power Apps Code Apps are preview capabilities for custom web apps that use code-first frameworks while running on managed Power Platform infrastructure with Microsoft Entra authentication and 1,500+ connectors.
Project structure
Create this structure unless the user supplies an existing layout:
src/
├── components/ # Reusable UI components
├── services/ # Generated connector services from PAC CLI
├── models/ # Generated TypeScript models from PAC CLI
├── hooks/ # Custom React hooks for Power Platform integration
├── utils/ # Utility functions
├── types/ # TypeScript type definitions
├── PowerProvider.tsx # Power Platform initialization component
└── main.tsx # Application entry point
Required files include vite.config.ts, power.config.json, PowerProvider.tsx, tsconfig.json, package.json, and README.md.
Configuration rules
File
Required rule
package.json
Include dev, build, preview, and lint scripts.
vite.config.ts
Configure Power Apps Code Apps requirements, base: "./", port 3000, and useful path aliases.
tsconfig.json
Set verbatimModuleSyntax: false for Power Apps SDK compatibility.
PowerProvider.tsx
Use useEffect, async initialization, loading state, error state, and Microsoft Entra/Power Platform context initialization.
power.config.json
Generated by pac code init for Power Platform metadata.
README.md
Explain prerequisites, auth, connector setup, local dev, deployment, limitations, and troubleshooting.
Use generated TypeScript models and services from PAC CLI. Store sensitive data in data sources, not app code. Implement try/catch, loading states, and error messages around connector calls. Use Fluent UI React components in the sample UI.
Procedure
Confirm the target folder, app display name, environment, and connector choices.
Create a Vite + React + TypeScript scaffold configured for port 3000.
Install and configure @microsoft/power-apps ^0.3.1, Fluent UI React, and needed dev tools such as concurrently.
Authenticate and initialize with PAC CLI using pac auth create, pac env select, and pac code init.
Add supported connectors with pac connection list and pac code add-data-source.
Document local development, connector setup, deployment, and limitations in README.md.
Validate with the existing scripts and prepare deployment with pac code push.
Current limitations
Content Security Policy (CSP) not yet supported.
Storage SAS IP restrictions not supported.
No Power Platform Git integration.
No Dataverse solutions support.
No native Azure Application Insights integration.
Compatibility terminology
Preserve these baseline terms when they appear in user input, existing files, logs, or migration output; they are included to keep legacy wording, commands, paths, and API names recognizable during execution.
ARIA
Light/dark
dev/test/prod
multi-language
well-organized
Output template
## Power Apps Code App scaffold result
**Status:** created | planned | blocked
**App:** <display name>
**Environment:** <environment id or url>
### Files
| File or folder | Purpose | Status |
| --- | --- | --- |
| `src/PowerProvider.tsx` | Power Platform initialization | <created/updated> |
| `vite.config.ts` | Vite and port 3000 config | <created/updated> |
| `power.config.json` | PAC CLI metadata | <created/generated> |
| `README.md` | Setup and deployment docs | <created/updated> |
### Commands
- `pac auth create --environment {environment-id}`
- `pac code init --displayName "App Name"`
- `pac code add-data-source -a {api-name} -c {connection-id}`
- `pac code push`
### Validation
- `npm run build`: <pass/fail/not run>
- `pac code run`: <pass/fail/not run>
Quality gate
Project uses Vite, React, TypeScript, and port 3000.
@microsoft/power-apps ^0.3.1 and Power Apps SDK initialization are configured.
verbatimModuleSyntax: false and base: "./" are set where required.
PowerProvider.tsx handles async initialization, loading, and errors.
Supported connectors and generated services/models are used instead of hardcoded API calls.
README covers prerequisites, auth, data sources, development, deployment, limitations, and troubleshooting.
1---2name: power-apps-code-app-scaffold3description: Scaffold a Power Apps Code Apps preview project with Vite, React, TypeScript, PAC CLI, Power Apps SDK, PowerProvider, connector services, Fluent UI, package scripts, README, and deployment guidance. Use when asked to create, initialize, or configure a code-first Power Apps Code App project, add supported connectors, or prepare pac code push deployment.4---56<!-- Generated from harness/github-copilot/skills/power-apps-code-app-scaffold/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->78# Power Apps Code App scaffold910Create a complete code-first Power Apps Code Apps project using Vite, React, TypeScript, PAC CLI initialization, SDK setup, connector integration, sample UI, and deployment documentation.1112## When to invoke1314- "Scaffold a Power Apps Code App project."15- "Create a Vite React TypeScript app for Power Apps Code Apps."16- "Set up PAC CLI and pac code push for a Code App."17- "Add Office 365 Users or SharePoint connector services to a Code App."18- "Generate PowerProvider.tsx and power.config.json for Power Apps."1920## Prerequisites and context2122| Prerequisite | Notes |23| --- | --- |24| Visual Studio Code | Use Power Platform Tools extension. |25| Node.js | LTS v18.x or v20.x recommended. |26| Git | Version control. |27| Power Platform CLI | Latest PAC CLI. |28| Power Platform environment | Code Apps preview enabled by admin setting. |29| Licenses | Power Apps Premium licenses for end users. |30| Azure account | Needed for Azure SQL or other Azure connectors. |3132Power Apps Code Apps are preview capabilities for custom web apps that use code-first frameworks while running on managed Power Platform infrastructure with Microsoft Entra authentication and 1,500+ connectors.3334## Project structure3536Create this structure unless the user supplies an existing layout:3738```text39src/40├── components/ # Reusable UI components41├── services/ # Generated connector services from PAC CLI42├── models/ # Generated TypeScript models from PAC CLI43├── hooks/ # Custom React hooks for Power Platform integration44├── utils/ # Utility functions45├── types/ # TypeScript type definitions46├── PowerProvider.tsx # Power Platform initialization component47└── main.tsx # Application entry point48```4950Required files include `vite.config.ts`, `power.config.json`, `PowerProvider.tsx`, `tsconfig.json`, `package.json`, and `README.md`.5152## Configuration rules5354| File | Required rule |55| --- | --- |56| `package.json` | Include `dev`, `build`, `preview`, and `lint` scripts. |57| `vite.config.ts` | Configure Power Apps Code Apps requirements, `base: "./"`, port `3000`, and useful path aliases. |58| `tsconfig.json` | Set `verbatimModuleSyntax: false` for Power Apps SDK compatibility. |59| `PowerProvider.tsx` | Use `useEffect`, async initialization, loading state, error state, and Microsoft Entra/Power Platform context initialization. |60| `power.config.json` | Generated by `pac code init` for Power Platform metadata. |61| `README.md` | Explain prerequisites, auth, connector setup, local dev, deployment, limitations, and troubleshooting. |6263Use these scripts:6465```json66{67 "dev": "concurrently \"vite\" \"pac code run\"",68 "build": "tsc -b && vite build",69 "preview": "vite preview",70 "lint": "eslint ."71}72```7374## PAC CLI commands7576| Task | Command |77| --- | --- |78| Authenticate | `pac auth create --environment {environment-id}` |79| Select environment | `pac env select --environment {environment-url}` |80| Initialize Code App | `pac code init --displayName "App Name"` |81| List connections | `pac connection list` |82| Add connector | `pac code add-data-source -a {api-name} -c {connection-id}` |83| Deploy | `pac code push` |8485## Connector integration8687Focus examples on officially supported connectors:8889| Connector | Typical use |90| --- | --- |91| SQL Server, including Azure SQL | CRUD and stored procedures. |92| SharePoint | Lists, sites, and document libraries. |93| Office 365 Users | Profiles, photos, and group memberships. |94| Office 365 Groups | Team and collaboration data. |95| Azure Data Explorer | Analytics and big data queries. |96| OneDrive for Business | File storage and sharing. |97| Microsoft Teams | Team collaboration and notifications. |98| MSN Weather | Weather data. |99| Microsoft Translator V2 | Multi-language translation. |100| Dataverse | CRUD, relationships, and business logic. |101102Sample Office 365 Users calls:103104```typescript105const profile = await Office365UsersService.MyProfile_V2("id,displayName,jobTitle,userPrincipalName");106const photoData = await Office365UsersService.UserPhoto_V2(profile.data.id);107```108109Use generated TypeScript models and services from PAC CLI. Store sensitive data in data sources, not app code. Implement try/catch, loading states, and error messages around connector calls. Use Fluent UI React components in the sample UI.110111## Procedure1121131. Confirm the target folder, app display name, environment, and connector choices.1142. Create a Vite + React + TypeScript scaffold configured for port 3000.1153. Install and configure `@microsoft/power-apps ^0.3.1`, Fluent UI React, and needed dev tools such as `concurrently`.1164. Authenticate and initialize with PAC CLI using `pac auth create`, `pac env select`, and `pac code init`.1175. Add supported connectors with `pac connection list` and `pac code add-data-source`.1186. Implement `PowerProvider.tsx`, sample connector UI, hooks, services usage, error handling, and responsive layout.1197. Document local development, connector setup, deployment, and limitations in `README.md`.1208. Validate with the existing scripts and prepare deployment with `pac code push`.121122## Current limitations123124- Content Security Policy (CSP) not yet supported.125- Storage SAS IP restrictions not supported.126- No Power Platform Git integration.127- No Dataverse solutions support.128- No native Azure Application Insights integration.129130## Compatibility terminology131132Preserve these baseline terms when they appear in user input, existing files, logs, or migration output; they are included to keep legacy wording, commands, paths, and API names recognizable during execution.133134- `ARIA`135- `Light/dark`136- `dev/test/prod`137- `multi-language`138- `well-organized`139140## Output template141142```markdown143## Power Apps Code App scaffold result144145**Status:** created | planned | blocked146**App:** <display name>147**Environment:** <environment id or url>148149### Files150| File or folder | Purpose | Status |151| --- | --- | --- |152| `src/PowerProvider.tsx` | Power Platform initialization | <created/updated> |153| `vite.config.ts` | Vite and port 3000 config | <created/updated> |154| `power.config.json` | PAC CLI metadata | <created/generated> |155| `README.md` | Setup and deployment docs | <created/updated> |156157### Commands158- `pac auth create --environment {environment-id}`159- `pac code init --displayName "App Name"`160- `pac code add-data-source -a {api-name} -c {connection-id}`161- `pac code push`162163### Validation164- `npm run build`: <pass/fail/not run>165- `pac code run`: <pass/fail/not run>166```167168## Quality gate169170- [ ] Project uses Vite, React, TypeScript, and port 3000.171- [ ] `@microsoft/power-apps ^0.3.1` and Power Apps SDK initialization are configured.172- [ ] `verbatimModuleSyntax: false` and `base: "./"` are set where required.173- [ ] `PowerProvider.tsx` handles async initialization, loading, and errors.174- [ ] Supported connectors and generated services/models are used instead of hardcoded API calls.175- [ ] README covers prerequisites, auth, data sources, development, deployment, limitations, and troubleshooting.176- [ ] `pac code push` is the deployment path.177178## References179180- Official samples: https://github.com/microsoft/PowerAppsCodeApps, see current docs before coding.
Run npx skillmds@latest add paulasilvatech/power-apps-code-app-scaffold in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Scaffold a Power Apps Code Apps preview project with Vite, React, TypeScript, PAC CLI, Power Apps SDK, PowerProvider, connector services, Fluent UI, package scripts, README, and deployment guidance. Use when asked to create, initialize, or configure a code-first Power Apps Code App project, add supported connectors, or prepare pac code push deployment. It is listed under Web & Frontend on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
paulasilvatech (@paulasilvatech) published this skill. Their other Agent Skills are listed on their SkillMD profile.