Skip to content

Commit f877278

Browse files
committed
Fix mobile app public README and refresh template
1 parent bd1a22a commit f877278

5 files changed

Lines changed: 33 additions & 107 deletions

File tree

plugins/mobile-apps/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This file provides guidance to AI Agents when working with the **mobile-app** pl
88

99
A plugin for building and deploying **Power Apps code apps that run as native mobile + web apps** using Expo + React Native + TypeScript. Connects to Power Platform via connectors using the standard `npx power-apps add-data-source` workflow.
1010

11-
The Expo template snapshot is synced from [`pa-wrap-tools/templates/expo-app-standalone`](https://microsoft.ghe.com/bic/pa-wrap-tools/tree/main/templates/expo-app-standalone) and distributed with this plugin under `template/`. `/create-mobile-app` runs in fresh-template working-directory mode: the user starts in an installed template folder, then the skill validates and prepares it.
11+
The Expo template snapshot is distributed with this plugin under `template/` and published from [`plugins/mobile-apps/template`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template). `/create-mobile-app` runs in fresh-template working-directory mode: the user starts in an installed template folder, then the skill validates and prepares it.
1212

1313
## Local Development
1414

plugins/mobile-apps/README.md

Lines changed: 24 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
Claude Code / Copilot plugin for building **Power Apps code apps for mobile** using Expo + React Native + TypeScript.
44

5-
> **Marketplace:** `power-platform-skills`, plugin `mobile-app`, stored in `plugins/mobile-apps`. This was migrated from the standalone `rn-app-skils` / `mobile-app-skills` preview repo; the plugin name remains `mobile-app` so existing agent namespaces keep working.
6-
>
7-
> **What:** Build mobile Power Apps with Expo + RN + TS (iOS & Android).
8-
> **Who:** Microsoft-internal teams currently — requires Azure Artifacts feed access (see Prerequisites §2).
9-
> **Status:** preview / v0.
5+
> **Marketplace:** `power-platform-skills`, plugin `mobile-app`, stored in `plugins/mobile-apps`.
6+
> **What:** Build mobile Power Apps with Expo + RN + TS (iOS & Android).
7+
> **Status:** public preview / v0.
108
119
---
1210

@@ -100,7 +98,7 @@ claude plugin install mobile-app@power-platform-skills --scope user
10098

10199
Use this only if the installer cannot find or configure your Claude CLI. You can also add it to your global plugin config manually — see the [Claude Code plugin docs](https://docs.anthropic.com/claude/docs/claude-code-plugins).
102100

103-
**Step 3 — Prepare a fresh template folder** (next section). Use `degit` to materialize `pa-wrap-tools/templates/expo-app-standalone`, run `npm install` in that folder, then open that folder and run `/create-mobile-app` there.
101+
**Step 3 — Prepare a fresh template folder** (next section). Use `degit` to materialize the public template from this repository, run `npm install` in that folder, then open that folder and run `/create-mobile-app` there.
104102

105103
### GitHub Copilot (VS Code) fallback
106104

@@ -130,108 +128,39 @@ Add the extracted folder to VS Code's `settings.json`:
130128

131129
> **Note:** `EnterPlanMode` / `ExitPlanMode` are Claude Code-only directives. Copilot approximates plan mode by restricting itself to read-only operations during the planning phase — the workflow still proceeds correctly.
132130
133-
That's it. The Expo template is prepared before invoking `/create-mobile-app`:
131+
Create a new app from the template and install dependencies before invoking `/create-mobile-app`:
134132

135133
```bash
136-
npx degit microsoft.ghe.com/bic/pa-wrap-tools/templates/expo-app-standalone my-mobile-app
134+
npx degit https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template#main my-mobile-app
137135
cd my-mobile-app
138136
npm install
139137
```
140138

141-
Then open `my-mobile-app` and run `/create-mobile-app` there. A local `template/` copy exists in the plugin for reference and local testing only.
139+
Then open `my-mobile-app` and run `/create-mobile-app` there. The skill assumes the current working directory is this fresh installed template folder.
140+
141+
Install the mobile-app skill from the Power Platform Skills plugin:
142+
143+
```text
144+
https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/.plugin/plugin.json
145+
```
142146

143147
---
144148

145149
## Prerequisites — what you must set up before `/create-mobile-app`
146150

147151
The skill checks these in Step 1 (Prerequisites) and stops with a clear error if any are missing. Get them ready up front to avoid mid-flow blocks.
148152

149-
### ⚠️ Two identities, two auth mechanisms (read this first)
150-
151-
This skill talks to two different Microsoft systems with two different identities. Mixing them up is the #1 cause of failed runs.
152-
153-
| What | Identity | Auth mechanism | Why separate |
154-
|---|---|---|---|
155-
| `npm install` from private feed | **Your corp `@microsoft.com` account** | **`az login --tenant <corp>`** (browser) — falls back to PAT for headless | Feed ACL is on your corp identity, not your test-tenant admin. |
156-
| Everything else (`npx power-apps init`, Dataverse, deploy, push) | **Power Platform tenant identity** (often a test-tenant admin, NOT your corp account) | `npx power-apps` browser auth + `az login --tenant <env-tenant>` for Dataverse helper scripts | Power Platform has its own AAD context, often a different tenant entirely. |
157-
158-
Configure npm access to the Azure Artifacts feed before `npm install`. PAT setup remains a headless / CI fallback only. `npx power-apps` uses its own browser auth cache, separate from Azure CLI.
159-
160153
### 1. Tooling versions
161154

162155
| Tool | Min version | How to install / check |
163156
|---|---|---|
164157
| Node.js | **22.x** | `node -v` — install via [nvm](https://github.com/nvm-sh/nvm) (`nvm install 22 && nvm use 22`) |
165-
| `az` (Azure CLI) | **2.60+** | `az --version` — needed for ADO npm token setup and advanced `/set-app-registration-native` scenarios. Install via Homebrew: `brew install azure-cli` |
158+
| `az` (Azure CLI) | **2.60+** | `az --version` — needed for Dataverse helper scripts and advanced `/set-app-registration-native` scenarios. Install via Homebrew: `brew install azure-cli` |
166159
| `git` | any recent | required for upstream template clone |
167160

168161
Detailed matrix (and Xcode/Android Studio notes if you want local native builds): [`shared/version-check.md`](shared/version-check.md).
169162

170-
### 2. Azure Artifacts npm token (private feed) ⚠️
171-
172-
The Expo template's `package.json` depends on `@microsoft/power-apps-native-host` and sibling Microsoft packages hosted on a **private Azure Artifacts feed**`mobile-codegen-expo` under the `msazure / OneAgile` org. Without a valid feed credential, `npm install` fails with `E401 Unauthorized`. This is the most common blocker.
173-
174-
**Recommended: `az login` browser flow.** Sign in with the identity that has feed Reader access, then make sure your npm auth configuration can access the Azure Artifacts feed before `npm install`. No copy-paste, no PAT rotation, identity is auditable in `az account show`.
175-
176-
**Step A — Get Reader access to the feed:**
177-
178-
Before any auth flow works, your Azure DevOps account needs **Reader** access to the `mobile-codegen-expo` feed:
179-
180-
1. Go to <https://msazure.visualstudio.com/OneAgile/_artifacts/feed/mobile-codegen-expo>
181-
2. If you see `403 Forbidden` or the feed doesn't load, request Reader membership from the team's Teams channel or feed owners
182-
3. Once you can view the feed page, proceed to Step B
183-
184-
**Step B — Sign in with `az login` (one-time):**
185-
186-
```bash
187-
# Sign in to your Microsoft corp tenant. This opens a browser; pick your @microsoft.com account.
188-
az login --allow-no-subscriptions
189-
# Browser opens — sign in and pick the tenant that owns the msazure Azure DevOps org
190-
# (for Microsoft FTEs that's your corp @microsoft.com account).
191-
# If you're on SSH/WSL/headless, add --use-device-code to get a paste-the-code prompt instead.
192-
193-
# Verify the right identity is active
194-
az account show --query user.name -o tsv
195-
# Should print your @microsoft.com address (NOT the Power Platform test-tenant admin)
196-
```
197-
198-
If you have multiple accounts, you can switch any time with `az account set --subscription <sub-id>` or re-run `az login`.
199-
200-
**Step C — Verify the feed is reachable:**
201-
202-
```bash
203-
TOKEN=$(az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv)
204-
curl -s -o /dev/null -w 'HTTP %{http_code}\n' -u ":$TOKEN" \
205-
"https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/mobile-codegen-expo/npm/registry/power-apps-native-host"
206-
# Expected: HTTP 200. If 401 → re-run `az login`. If 403 → re-do Step A (no Reader access).
207-
```
208-
209-
**Headless / CI fallback (advanced):** If you can't run a browser (CI runners, locked-down hosts), set `AZURE_DEVOPS_NPM_TOKEN` to a PAT instead. Create one at <https://dev.azure.com/msazure/_usersSettings/tokens> with `Packaging: Read` scope (90-day max), then:
210-
211-
```bash
212-
export AZURE_DEVOPS_NPM_TOKEN=<paste-the-PAT-here>
213-
# Persist by appending to ~/.zshrc
214-
```
215-
216-
For local setup, prefer active `az` identity-backed npm auth. For headless setups, set `AZURE_DEVOPS_NPM_TOKEN` before running `npm install`.
217-
218-
**Step D — Verify (skip if you ran Step C):**
219-
220-
```bash
221-
# Confirm the env var is set
222-
echo "$AZURE_DEVOPS_NPM_TOKEN" | head -c 6 && echo# should print the first 6 chars + …
223-
224-
# Confirm the PAT actually works against the feed before running npm install
225-
curl -s -o /dev/null -w 'HTTP %{http_code}\n' -u ":${AZURE_DEVOPS_NPM_TOKEN}" \
226-
"https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/mobile-codegen-expo/npm/registry/power-apps-native-host"
227-
# Expected: HTTP 200. If 401 → bad PAT, redo Step B. If 403 → redo Step A (no Reader access).
228-
```
229-
230-
**If `npm install` fails with `E401`:** Your token is missing or expired. Re-run Step B.
231-
232-
**If `npm install` fails with `E403`:** Your token is valid but your account doesn't have feed access. Go back to Step A and request Reader membership.
233-
234-
### 3. Power Platform environment
163+
### 2. Power Platform environment
235164

236165
You'll need an environment to deploy into. `/create-mobile-app` runs `npx power-apps init`, then reads the generated `power.config.json`, resolves the Dataverse URL and tenant through `resolve-environment.js`, and continues. The resolver calls the BAP admin environments endpoint (`api.bap.microsoft.com/providers/Microsoft.BusinessAppPlatform/scopes/admin/environments/<environment-id>`). If the signed-in Azure CLI account cannot read that environment through BAP, provide the Dataverse environment URL directly.
237166

@@ -245,23 +174,22 @@ Requirements:
245174

246175
If environment resolution cannot get a Dataverse token during the skill, run `az login --tenant <env-tenant>` and retry.
247176

248-
### 4. (Optional) Companion plugins
177+
### 3. (Optional) Companion plugins
249178

250179
- **`expo/skills`** — see the next section. Strongly recommended for native UI patterns.
251180

252181
### Quick sanity check
253182

254-
Before you run `/create-mobile-app`, paste this one-liner — it touches every prereq AND verifies the PAT works against the feed. Exits 0 only if all are good:
183+
Before you run `/create-mobile-app`, paste this one-liner from the fresh template folder. It touches the required local tooling and verifies the template dependencies are installed:
255184

256185
```bash
257186
node -v && \
258187
npx --yes degit --help >/dev/null && \
259-
[ -n "$AZURE_DEVOPS_NPM_TOKEN" ] && \
260-
[ "$(curl -s -o /dev/null -w '%{http_code}' -u ":${AZURE_DEVOPS_NPM_TOKEN}" 'https://pkgs.dev.azure.com/msazure/OneAgile/_packaging/mobile-codegen-expo/npm/registry/power-apps-native-host')" = "200" ] && \
188+
npm install --package-lock-only --ignore-scripts && \
261189
echo "✅ all prereqs OK"
262190
```
263191

264-
If any line fails, fix that one before starting the skill. Most common failure is the curl line returning 401 (bad PAT) or 403 (no feed Reader access) — see Section 2.
192+
If any line fails, fix that one before starting the skill. The most common failures are an older Node.js version or running the command outside the fresh template folder.
265193

266194
---
267195

@@ -289,7 +217,7 @@ After deploy, use `/open-wrap-url --app-id <app-id> --env-id <env-id>` to jump s
289217

290218
## What you get
291219

292-
- **Expo standalone template** prepared with `degit` from [`pa-wrap-tools/templates/expo-app-standalone`](https://microsoft.ghe.com/bic/pa-wrap-tools/tree/main/templates/expo-app-standalone) (internal). The plugin bundles the latest template snapshot under `template/`, while `/create-mobile-app` expects the user to run from a fresh installed template working directory and applies the app identity / connector preparation edits there.
220+
- **Expo standalone template** prepared with `degit` from [`plugins/mobile-apps/template`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template). The plugin bundles the latest template snapshot under `template/`, while `/create-mobile-app` expects the user to run from a fresh installed template working directory and applies the app identity / connector preparation edits there.
293221
- **Same `npx power-apps add-data-source` workflow** across this plugin's skills — generated services in `src/generated/services/` work consistently
294222
- **Auth pre-wired** via the Power Apps CLI first-party Entra app — no custom Azure registration required
295223
- **Two platforms** in one codebase: iOS, Android
@@ -466,10 +394,9 @@ At Step 6.75 of `/create-mobile-app`, the `/design-system` skill offers a cost p
466394

467395
## Known blockers
468396

469-
1. **Fresh template preparation.** `/create-mobile-app` expects a fresh installed `expo-app-standalone` template working directory. Use `degit` to materialize `pa-wrap-tools/templates/expo-app-standalone`, then run `npm install` in that template folder before invoking the skill there.
470-
2. **Azure Artifacts npm token.** The template depends on `@microsoft/power-apps-native-host` from a private Azure DevOps feed. Without a valid feed token, `npm install` fails with `E401 Unauthorized`. See [Prerequisites § 2](#2-azure-artifacts-npm-token-private-feed-).
471-
3. ~~**Sub-agent slash-command limitation.**~~**Resolved**`/design-system` (Step 6.75) now runs as a top-level skill invocation by the orchestrator, not inside a sub-agent. The old `DESIGN_VIBE_REQUESTED:` handoff signal is no longer needed.
472-
4. ~~**Connector usage requires the player runtime.**~~**Resolved**`PowerAppsHostProvider` in `app/_layout.tsx` (from `power-apps-native-host`) handles all connector routing, connection resolution, disambiguation, and OAuth consent automatically. No separate executor or provider wiring needed.
397+
1. **Fresh template preparation.** `/create-mobile-app` expects a fresh installed `expo-app-standalone` template working directory. Use `degit` to materialize [`plugins/mobile-apps/template`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template), then run `npm install` in that template folder before invoking the skill there.
398+
2. ~~**Sub-agent slash-command limitation.**~~**Resolved**`/design-system` (Step 6.75) now runs as a top-level skill invocation by the orchestrator, not inside a sub-agent. The old `DESIGN_VIBE_REQUESTED:` handoff signal is no longer needed.
399+
3. ~~**Connector usage requires the player runtime.**~~**Resolved**`PowerAppsHostProvider` in `app/_layout.tsx` (from `power-apps-native-host`) handles all connector routing, connection resolution, disambiguation, and OAuth consent automatically. No separate executor or provider wiring needed.
473400

474401
## Local Zip Install
475402

@@ -484,7 +411,6 @@ To install only this plugin, register the repository root as a marketplace and i
484411

485412
## See also
486413

487-
- [`pa-wrap-tools/templates/expo-app-standalone`](https://microsoft.ghe.com/bic/pa-wrap-tools/tree/main/templates/expo-app-standalone) (internal) — upstream template source for the bundled `template/` snapshot and fresh-template working directory
488-
- [`pa-wrap-tools/native-app.md`](https://microsoft.ghe.com/bic/pa-wrap-tools) (internal) — full architecture spec
414+
- [`plugins/mobile-apps/template`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template) — bundled Expo standalone template and fresh-template working directory source
489415
- [Expo docs](https://docs.expo.dev/)
490416
- [Power Apps developer docs](https://learn.microsoft.com/en-us/power-apps/developer/)

plugins/mobile-apps/shared/version-check.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ If the user asks how to run on a real device or simulator: point them at the Exp
6666

6767
## Required SDKs (in `package.json`)
6868

69-
These are pinned in the upstream template at [`pa-wrap-tools/templates/expo-app-standalone/package.json`](https://microsoft.ghe.com/bic/pa-wrap-tools/blob/main/templates/expo-app-standalone/package.json) and mirrored in this plugin's bundled `template/package.json`. If a skill upgrades one, file an upstream PR — do NOT patch the generated app copy in-project. Note: under Expo SDK 55, **all `expo-*` packages share the `55.x.y` version line** — that's how Expo guarantees compatibility. Don't list `expo-router`/`expo-auth-session`/`expo-secure-store` as if they're independently versioned.
69+
These are pinned in the bundled template at [`plugins/mobile-apps/template/package.json`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template/package.json). If a skill upgrades one, update the bundled template first — do NOT patch the generated app copy in-project. Note: under Expo SDK 55, **all `expo-*` packages share the `55.x.y` version line** — that's how Expo guarantees compatibility. Don't list `expo-router`/`expo-auth-session`/`expo-secure-store` as if they're independently versioned.
7070

7171
| Package | Pinned version | Notes |
7272
|---|---|---|
7373
| `expo` | `55.0.26` | SDK 55 |
7474
| `react-native` | `0.83.6` | matched to Expo SDK 55 |
7575
| All `expo-*` packages | `55.x.y` | router, auth-session, secure-store, dev-client, etc. — version line tied to SDK |
76-
| `@microsoft/power-apps` | `1.2.2` | resolved from the Azure Artifacts registry configured for npm |
77-
| `@microsoft/power-apps-native-host` | `^0.2.20` | native runtime host, resolved from the Azure Artifacts registry |
78-
| `@microsoft/power-apps-native-offline` | `^0.1.7` | offline runtime package, resolved from the Azure Artifacts registry |
76+
| `@microsoft/power-apps` | `1.2.2` | Power Apps code app SDK |
77+
| `@microsoft/power-apps-native-host` | `^0.2.20` | native runtime host |
78+
| `@microsoft/power-apps-native-offline` | `^0.1.7` | offline runtime package |
7979
| `@expo/fingerprint` | `0.16.7` | runtime fingerprint support used by `app.config.js` |
8080
| `@microsoft/power-apps-cli` | `0.9.1` | provides local schema/runtime helper commands such as `generate-connector-schemas` and `native-runtime` |
8181
| `tamagui`, `@tamagui/*` | `1.144.4` | design system primitives, all `@tamagui/*` packages tracked together |
@@ -93,7 +93,7 @@ Most skills only need the always-required tier. Copy this into Step 1.
9393
node --version # expect v22+
9494

9595
# Conditionally required — only if THIS skill needs it
96-
# az account show # for ADO npm token setup, /add-dataverse, advanced /set-app-registration-native
96+
# az account show # for /add-dataverse and advanced /set-app-registration-native
9797

9898
# Project-local (only if inside a project)
9999
test -f power.config.json && echo "OK: code app project"
@@ -115,6 +115,6 @@ node -e "console.log(JSON.stringify(require('./app.json').expo, null, 2))" 2>/de
115115
## When to update this file
116116

117117
- New skill needs a tool not listed → add it here, then reference from the skill (don't hard-code in the skill).
118-
- An SDK pin changes in [`pa-wrap-tools/templates/expo-app-standalone/package.json`](https://microsoft.ghe.com/bic/pa-wrap-tools/blob/main/templates/expo-app-standalone/package.json) → update the SDK table here.
118+
- An SDK pin changes in [`plugins/mobile-apps/template/package.json`](https://github.com/microsoft/power-platform-skills/tree/main/plugins/mobile-apps/template/package.json) → update the SDK table here.
119119
- A new Power Platform CLI feature requires a newer minimum → bump the table, surface a one-line warning in the affected skills.
120120

0 commit comments

Comments
 (0)