A plugin marketplace for GitHub Copilot and other AI agents that provides Power Platform development plugins, including reusable skills, agents, and commands for building and deploying solutions.
JavaScript claude-code-pluginclaude-code-skillscode-appsgithub-copilot-pluginpower-appspower-pagespower-platform
Support on-demand JavaScript dependencies in mobile apps (#358)
Shubham Agarwale15145ae8fb5
diff --git a/plugins/mobile-apps/AGENTS.md b/plugins/mobile-apps/AGENTS.mdindex a3aeecdb7..115b2b662 100644--- a/plugins/mobile-apps/AGENTS.md+++ b/plugins/mobile-apps/AGENTS.md@@ -48,7 +48,7 @@ Do not add preparation rewrites for `scheme`, `package`, `bundleIdentifier`, `sr## Guiding Principles1. **Connector-first for data** — All Power Platform data access goes through connectors and generated services in `src/generated/`. No direct Graph / Azure REST calls.-2. **Native APIs via Expo modules + RN libraries — allowlist-bounded.** Native capabilities backed by Expo modules and any RN UI/runtime libraries with native assumptions are limited to modules actually shipped by `template/package.json` from the synced `pa-wrap-tools` main template. The rewrap binary is built from a pre-built base, so the runtime knows ONLY about modules the upstream template includes. Do not propose, install, or import modules absent from that package list (notably `expo-notifications` and RN native libraries not already present). Calendar management views may use `react-native-calendars` only when it is present in the template/project `package.json`; otherwise planner/builders must fall back to timeline/list UI or block with a template-update request. `expo-haptics` remains runtime-banned even if it appears in a future template (see [`agents/screen-builder.md`](agents/screen-builder.md) HARD RULE). The canonical list and reconciliation rule are in [`skills/add-native/SKILL.md`](skills/add-native/SKILL.md).+2. **Native code is allowlist-bounded; pure JavaScript is app-scoped.** Expo modules and packages that ship native source, a podspec, codegen configuration, an Expo module/config plugin, or platform projects must already exist in `template/package.json`. The rewrap binary is built from a pre-built base, so adding those packages to an app cannot add their native code. Do not classify a package from its name alone: a `react-native-*` package can still be pure JavaScript. For an explicit library request or an approved use case that benefits from an established library, the planner may select a compatible pure-JavaScript package, pin it in the app's `package.json`, and install it before builders use it; no Android/iOS rebuild is required. Do not bundle optional libraries such as `react-native-calendars` in the base template. Follow [`shared/references/javascript-dependency-planning.md`](shared/references/javascript-dependency-planning.md). `expo-haptics` remains runtime-banned even if it appears in a future template (see [`agents/screen-builder.md`](agents/screen-builder.md) HARD RULE). The native boundary and reconciliation rule are in [`skills/add-native/SKILL.md`](skills/add-native/SKILL.md).3. **Fresh-template mode** — `/create-mobile-app` validates and prepares an existing fresh Expo standalone template working directory. Do not silently copy the bundled `template/` snapshot over the user's folder.4. **Safety guardrails** — Confirm before deploys, before global installs, before edits outside the project root.5. **Memory bank** — Persist `memory-bank.md` in the project root.diff --git a/plugins/mobile-apps/agents/native-app-planner.md b/plugins/mobile-apps/agents/native-app-planner.mdindex 2ac39dfac..94ca48083 100644--- a/plugins/mobile-apps/agents/native-app-planner.md+++ b/plugins/mobile-apps/agents/native-app-planner.md@@ -61,16 +61,17 @@ The orchestrator's Step 3 has a documented inline-gate fallback for exactly thisRead these references once before doing anything else:- `${PLUGIN_ROOT}/AGENTS.md` — plugin conventions-- `${PLUGIN_ROOT}/template/package.json` — **the native-capability allowlist**. The set of native modules in this file is fixed by the rewrap pipeline; you may NEVER propose a capability whose module is not present here. See Step 3 for how this list is enforced.+- `${PLUGIN_ROOT}/template/package.json` — **the native-code allowlist**. The set of modules with native code/config is fixed by the rewrap pipeline; you may NEVER propose a native capability whose module is not present here. Pure-JavaScript app dependencies are planned separately by `screen-planner` under `## Screens` and need not be bundled in this template.Do NOT attempt to read `app.config.js` from the working directory — scaffolding has not run yet. Reading `template/package.json` from `${PLUGIN_ROOT}` IS allowed and IS required.From the planner prompt extract:- **Target platforms** — iOS + Android by default. If the user picked just one platform, native modules need `Platform.OS` branching notes in the screen plan.- **Native capability hints** — words like "scan", "photo", "camera" -> `expo-camera`; "pick file", "upload PDF", "import document", "attach file" -> `expo-document-picker`; "generate PDF", "export report", "print report", "evidence packet" -> `pdf-report` (`expo-print` plus optional `expo-sharing`); "view PDF", "open PDF", "preview PDF" -> `native-pdf-viewer` for HTTPS URLs or local `file://` URIs with `@microsoft/power-apps-native-pdf-viewer` 0.2.9+; "signature", "sign off", "approval", "pen", "ink", "draw" -> `pen-input` with `@microsoft/power-apps-native-pen-input`; "track location", "background location", "GPS tracking", "follow my route", "breadcrumb", "field worker location" -> `geolocation` with `@microsoft/power-apps-native-bglocation` (continuous/background tracking + Dataverse sync); "where am I", "current location", "one-shot location", "tag this with my coordinates" -> one-shot `location` with `expo-location`; "save token", "credentials" -> `expo-secure-store`; "share / send" -> `expo-sharing`; "save file / download" -> `expo-file-system`. **Capability hints that the template does NOT ship** (including PDF viewer, PDF report, sharing, pen, or geolocation packages when absent) are surfaced to the user as transparency notes per Step 3 - never silently promoted into the plan. If the request is generated-report-shaped and the Power Apps PDF viewer package is absent, fall back to `pdf-report` only when `expo-print` is present; otherwise drop the PDF capability.+- **Pure-JavaScript dependency hints** — pass any explicit JavaScript-library request, or any feature that may benefit from an established JS-only package instead of custom code, to `screen-planner`. These are app dependencies, not native capabilities. The screen planner reuses suitable installed packages first; otherwise it follows the canonical candidate-selection workflow and records the selected package with an exact version under `## Screens → ### JavaScript Dependencies`.- **Industry confirmed** — if the prompt contains a line `Industry confirmed: <slug>`, the orchestrator already ran the industry-confidence check (see Step 3c). Treat that slug as the locked industry for Step 3c — skip detection, skip the confidence check, jump straight to mapping the industry to aesthetic direction / palette / tone.-Capture these for the native capabilities section in Step 4.+Carry each input into its owning planning step: native hints into `## Native Capabilities`, pure-JavaScript dependency hints into the `screen-planner` prompt, and the confirmed industry into design planning.## Step 2 — Spawn `data-model-architect` + inline planning in parallel@@ -112,12 +113,12 @@ Build the native capabilities matrix yourself (this is a small enough surface to### Step 3.0 — Build the allowlist (MANDATORY, before any cap is proposed)-The set of native modules the rewrap pipeline supports is FIXED by `${PLUGIN_ROOT}/template/package.json`. You may NEVER propose a capability whose underlying module is not present there — the customer's binary is built from a pre-built base, not from their `package.json`. Adding a module to the plan that's not shipped means a downstream `/add-native` call WILL stop, and the orchestrator's whole flow stalls at Step 9.+The set of modules with native code/config that the rewrap pipeline supports is FIXED by `${PLUGIN_ROOT}/template/package.json`. You may NEVER propose a native capability whose underlying module is not present there — the customer's binary is built from a pre-built base, not from their `package.json`. Adding a native module to the plan that's not shipped means a downstream `/add-native` call WILL stop, and the orchestrator's whole flow stalls at Step 9. This restriction does not apply to verified pure-JavaScript dependencies; do not infer native code from a package-name prefix.Read the template's `package.json`:```bash-node -e "const p = require('${PLUGIN_ROOT}/template/package.json'); const deps = Object.keys({...p.dependencies, ...p.devDependencies}); console.log(deps.filter(d => d.startsWith('expo-') || d.startsWith('react-native-') || d.startsWith('@react-native-community/') || d.startsWith('@microsoft/extension-') || d === '@microsoft/power-apps-native-bglocation').join('\n'));"+node -e "const p = require('${PLUGIN_ROOT}/template/package.json'); console.log(Object.keys({...p.dependencies, ...p.devDependencies}).sort().join('\n'));"```Map each shipped module to a user-facing capability slug. Use this known mapping table, but still gate every row against the live allowlist output; a listed capability is supported only when its exact package appears in `template/package.json` and is not runtime-banned.@@ -134,7 +135,6 @@ Map each shipped module to a user-facing capability slug. Use this known mapping| `secure-store` | `expo-secure-store` | — || `file-system` | `expo-file-system` | — || `sharing` | `expo-sharing` | — |-| `calendar-management-view` | `react-native-calendars` | — || `location` | `expo-location` | `/add-native location` || `biometrics` / `local-authentication` | `expo-local-authentication` | `/add-native biometrics` || `clipboard` | `expo-clipboard` | `/add-native clipboard` |@@ -169,23 +169,11 @@ PDF/pen inference rules:- `geolocation` means continuous/background GPS tracking with durable storage and inline Dataverse sync via `@microsoft/power-apps-native-bglocation`. Auth is MSAL-only; native uploads each fix to an existing Dataverse table (default entity set `msdyn_locationrecords`). It is distinct from one-shot `location` (`expo-location`). Plan it only for continuous tracking or durable upload, require `/add-native geolocation` to verify the target table exists before use, and never propose the `GeolocationExtension`/HostingSDK path.- The Power Apps extensions are use-case-specific, not generic replacements for Expo modules. For other native needs, choose the relevant Expo module or dependency already present in `template/package.json` and still enforce the allowlist.-**Capabilities not present or runtime-banned** — do not propose: anything whose exact package is absent, `expo-notifications` unless a future template ships it, Bluetooth/NFC/BLE/AR without a shipped package, and `expo-haptics` unless the screen-builder hard rule is explicitly removed.+**Capabilities not present or runtime-banned** — do not propose: anything with required native code/config whose exact package is absent, `expo-notifications` unless a future template ships it, Bluetooth/NFC/BLE/AR without a shipped package, and `expo-haptics` unless the screen-builder hard rule is explicitly removed.-### Calendar management view capability+### Pure-JavaScript dependency handoff-If requirements mention calendar management, scheduling, appointment calendars, personal/team/POS calendar views, month/week/day views, agenda, availability, visits, routes by date, or field-service schedules, propose `calendar-management-view` when `react-native-calendars` is present in `${PLUGIN_ROOT}/template/package.json`. This is a UI library capability, not an Expo permission capability: it needs no `/add-native` wrapper, no `app.config.js` permission changes, and no native skill invocation.--The native-capability matrix row MUST use:--| Field | Required value |-|---|---|-| Capability | `calendar-management-view` |-| Module | `react-native-calendars` |-| Used by screens | every calendar/agenda/schedule screen, such as personal calendar, team calendar, POS calendar, appointment list |-| Justification | render real mobile calendar/agenda surfaces instead of generic FlatList-only date groupings |-| Dedicated skill | blank / `None — UI library, screen-builder imports directly` |--If `react-native-calendars` is absent from the template/package allowlist, do NOT silently plan generic calendar widgets. Add a transparency note: `> Excluded — requirements suggested calendar management views, but this template does not ship react-native-calendars. Update the template/package.json or use timeline/list scheduling screens until the template includes it.`+Do not put JS-only libraries in `## Native Capabilities` and do not route them through `/add-native`. Pass explicit JavaScript package requests and use cases that may benefit from an established library to `screen-planner`, which follows [`shared/references/javascript-dependency-planning.md`](${PLUGIN_ROOT}/shared/references/javascript-dependency-planning.md), chooses a compatible JS-only package, and records an exact approved version under `## Screens → ### JavaScript Dependencies`. `/create-mobile-app` installs that table before screen builders run. Package-specific examples belong in the canonical reference; every library uses the same generic selection gate.If the requirements imply one of these, DROP the capability and add a transparency note to the `## Native Capabilities` section so the user sees what was excluded and why:@@ -454,6 +442,8 @@ Plugin root: ${PLUGIN_ROOT}Expand each screen in the locked graph into a compact delta spec. Do NOT repeat values already present in Shared Conventions, Design Direction, brand/design-system.md, or universal builder rules. Write Standard Imports ONCE near the top. Per-spec Resolved Imports list only entity-specific additions. Cap Open Questions at 3.+Apply the canonical JavaScript dependency workflow for both explicit package requests and use-case-driven needs. Research read-only, emit exact versions plus JS-only evidence, and do not install anything.+Style-picker + preview rules unchanged — honour the same `skip_preview` policy as the legacy single-pass mode (default `skip_preview: true` when `Design vibe opt-in: deferred`).Return per AGENTS.md rule #10.diff --git a/plugins/mobile-apps/agents/screen-builder.md b/plugins/mobile-apps/agents/screen-builder.mdindex ab6b8e630..6afff6200 100644--- a/plugins/mobile-apps/agents/screen-builder.md+++ b/plugins/mobile-apps/agents/screen-builder.md@@ -201,6 +201,8 @@ You will be invoked by `/create-mobile-app` Step 11 or `/edit-app` screen-rebuil- **Native capabilities: use `src/native/` wrappers, NOT raw Expo modules.** `/add-native` creates typed wrappers under `src/native/` (e.g., `camera.ts`, `cameraUpload.ts`, `secureStore.ts`, `documentPicker.ts`, `pdfReport.ts`, `pdfViewer.ts`, `penInput.ts`, `geolocation.ts`). For non-Dataverse native workflows, always import from these wrappers — never import `expo-camera`, `expo-image-picker`, `expo-document-picker`, `expo-print`, `expo-secure-store`, `expo-file-system`, `expo-sharing`, `@microsoft/power-apps-native-pdf-viewer`, `@microsoft/power-apps-native-pen-input`, or `@microsoft/power-apps-native-bglocation` directly in screen files. The wrappers handle permissions, iOS/Android platform differences, URL validation, and return discriminated-union results (`{ ok: true, ... } | { ok: false, reason }`). If a wrapper doesn't exist yet, write the screen with the expected import path and a `// TODO(native-not-yet-added): run /add-native <capability> to create src/native/<wrapper>.ts` comment. For `camera.ts`, use `/add-native camera`; for `barcodeScanner.tsx`, use `/add-native barcode-scanner`; for `pdfReport.ts`, use `/add-native pdf-report`; for `pdfViewer.ts`, use `/add-native pdf-viewer` or `/add-native @microsoft/power-apps-native-pdf-viewer`; for `penInput.ts`, use `/add-native pen-input` or `/add-native @microsoft/power-apps-native-pen-input`; for `geolocation.ts`, use `/add-native geolocation` or `/add-native @microsoft/power-apps-native-bglocation`. **`expo-notifications` and `expo-haptics` are NOT available** — per AGENTS.md §2 and the HARD RULE below for haptics. If the plan tells you to use an unavailable capability, return `NEEDS_CONTEXT` — do not import it.+- **Planned pure-JavaScript dependencies may be imported directly.** Follow `${PLUGIN_ROOT}/shared/references/javascript-dependency-planning.md`'s Builder Contract. Before importing any non-template package, verify it appears with an exact version in `## Screens → ### JavaScript Dependencies` and in the project's `package.json` `dependencies`, and that `require.resolve('<package>', { paths: [working_dir] })` succeeds. If the plan lists it but installation is missing, return `BLOCKED [<screen_name>]: approved JavaScript dependency <package>@<version> is not installed — orchestrator must install dependencies before builders run.` If it is not in the approved table, return `NEEDS_CONTEXT` instead of adding it yourself. Builders never select packages, edit `package.json`, or run installs. Import and use only the package APIs named by the approved per-screen spec.+- **PDF and pen capability behavior.** Native PDF viewer actions MUST call `openHttpsPdf(url)`, which supports `https://` URLs and local `file://` URIs with viewer 0.2.9+. Reject or disable actions for `content://`, `blob:`, `http://`, or empty inputs. Pen capture cancellation (`USER_CANCELLED`) is not an error; leave the screen state unchanged. Handle `NATIVE_MODULE_MISSING`, `VIEWER_FAILED`, `CAPTURE_FAILED`, `uploadFailed`, and `invalidUrl` with visible inline states rather than silent returns.- **Pen signatures and generated PDFs follow Dataverse artifact boundaries.** Pen input returns `data:image/png;base64,...`; for Image columns, normalize to the generated service payload shape and strip the prefix when raw base64 is required. Generated PDFs and signature PNGs stored in File columns are uploaded only after the parent row exists and the create/update result is successful. If the spec says `Artifact persistence: child Evidence/Attachment table`, create that child row first, then upload File bytes or write the Image payload against the child row ID. Never include File bytes in create/update JSON.@@ -1123,7 +1125,7 @@ Follow these whenever the spec touches navigation, list rows, or modals. RecipesWithout layout animations, new rows appear instantly and deleted rows leave a gap that closes with a jump — the #2 tell that an app isn't native (iOS `UITableView` animates by default). `LinearTransition` makes sibling rows shift smoothly when one is added or removed. Cap `entering` delay at index 5 (rest render instantly — avoids slow initial paint on long lists).-44. **Native date/time pickers — NEVER use a Sheet calendar or plain Input for date fields.** If a form field maps to a `datetime` or `DateOnly` Dataverse column, you MUST use `@react-native-community/datetimepicker` (already in template). The recipe in rule 27 (DateTimePicker component) is the ONLY acceptable pattern. The planner spec may say "date picker Sheet" or "date picker" — both mean the native picker, not a custom Tamagui Sheet with a calendar grid. Specifically forbidden:+44. **Native date/time pickers — NEVER use a Sheet calendar or plain Input for date fields.** If a form field maps to a `datetime` or `DateOnly` Dataverse column, you MUST use `@react-native-community/datetimepicker` (already in template). The recipe in rule 27 (DateTimePicker component) is the ONLY acceptable form-field pattern. This does not prohibit an approved `react-native-calendars` calendar-management screen; that library is for browsing/managing schedules, not editing one Dataverse date field. The planner spec may say "date picker Sheet" or "date picker" — both mean the native picker, not a custom Tamagui Sheet with a calendar grid. Specifically forbidden:- `<Sheet>` containing a custom calendar component- `<Input type="date">` (not a React Native date control)- `<Input>` with manual date string parsingdiff --git a/plugins/mobile-apps/agents/screen-planner.md b/plugins/mobile-apps/agents/screen-planner.mdindex 50eb59353..aa2724c66 100644--- a/plugins/mobile-apps/agents/screen-planner.md+++ b/plugins/mobile-apps/agents/screen-planner.md@@ -8,6 +8,8 @@ tools:- Read- Write- Glob+ - Grep+ - Bash- AskUserQuestion---@@ -54,7 +56,7 @@ The orchestrator splits Gate 4 into two cheaper gates so the user can edit the s- `<working_dir>/app/index.tsx`, `app/login.tsx`, `app/oauth-callback.tsx`, `app/(app)/_layout.tsx`, `app/(app)/home.tsx` — existing routes- `<working_dir>/tamagui.config.ts` — design tokens-- `<working_dir>/package.json` — installed dependencies (use this to confirm a Tamagui component / Expo module is actually available before referencing it in a spec)+- `<working_dir>/package.json` — installed dependencies. Native modules must already be present; a verified pure-JavaScript library may instead be proposed with an exact version under `## Screens → ### JavaScript Dependencies` for the orchestrator to install before screen generation.- `<working_dir>/src/components/`, `src/hooks/`, `src/utils/`, `src/tokens/` — shared code copied by the orchestrator**Hard rule — read-only on the scaffolded files.** You may NEVER write to anything outside this allow-list:@@ -300,10 +302,16 @@ Pick a layout strategy per screen based on target platform:| Theme switching, breakpoints (`useMedia()`) | Scroll insets: `<ScrollView contentInsetAdjustmentBehavior="automatic">` || | Platform branching: `process.env.EXPO_OS`, `useWindowDimensions` || | Capabilities: `expo-camera`, `expo-document-picker`, `expo-print`, `expo-secure-store`, `expo-file-system`, `expo-sharing`, `@microsoft/power-apps-native-pdf-viewer`, `@microsoft/power-apps-native-pen-input`, `@microsoft/power-apps-native-bglocation` when allowlisted by the plan (see AGENTS.md §2) |-| | Calendar management views: `react-native-calendars` (`Calendar`, `CalendarList`, `Agenda`, `ExpandableCalendar`, `AgendaList`) when present in package.json |+| | Calendar management views: `react-native-calendars` (`Calendar`, `CalendarList`, `Agenda`, `ExpandableCalendar`, `AgendaList`) when the approved `JavaScript Dependencies` table includes it |Reference `${PLUGIN_ROOT}/shared/samples/_layout.tsx` for existing navigation layout patterns (tab structure, safe-area, stack options).+### Pure-JavaScript dependency planning++Read and follow `${PLUGIN_ROOT}/shared/references/javascript-dependency-planning.md`. Apply it both when the user explicitly names a JavaScript library and when a screen use case has an established library that materially reduces implementation or accessibility risk. Inspect existing dependencies first; otherwise research at most three candidates with the reference's read-only npm commands, select one compatible JS-only package, and emit the exact-version evidence table in `phase: specs` or legacy mode. Do not install during planning.++Calendar management is one example, not a special ownership path. Full month/week/agenda surfaces trigger candidate selection and normally evaluate `react-native-calendars` first; a lightweight `timeline-day-list` can stay on existing primitives. Other use cases follow the same candidate-selection workflow rather than requiring a hardcoded package map.+## Step 4 — Per-Screen Spec**Print before starting** (this is the longest step — N screens × compact delta specs):@@ -347,7 +355,7 @@ For each screen the user adds, provide this compact shape:- **Row style override** (List screens only, omit if Shared Conventions default applies): one of the row styles from the guide above, not "generic cards"- **Hero type override** (Detail screens only, omit if Shared Conventions default applies): one of the hero types from the guide above- **Operational pattern** (Home or workflow screens only): one of `home-dashboard`, `assignment-dashboard`, `walkaround-stepper`, `wizard-progress-stepper`, `floating-action-menu`, `scan-geofence-gate`, `severity-filtered-queue`, `dispatch-signoff-queue`, `audit-timeline`. Omit only for normal CRUD/business screens without a dashboard or workflow shape. Use `floating-action-menu` when a screen has 2-5 related quick actions behind one Create/New trigger; list the trigger label, menu item labels/icons, and route/action for each item.-- **Calendar pattern** (Calendar/schedule/appointment screens only) — REQUIRED when the screen manages appointments, schedules, visits, availability, personal/team/POS calendars, or date-grouped work. Choose one: `month-agenda` (`Calendar` + agenda rows), `expandable-calendar-agenda` (`CalendarProvider` + `ExpandableCalendar` + `AgendaList`), `calendar-list-range` (`CalendarList` for date-range browsing), or `timeline-day-list` (date chip strip + `FlatList`, only if `react-native-calendars` is unavailable or the plan intentionally avoids a full calendar). For TWEED-like calendar management views, default personal/team/POS calendar screens to `expandable-calendar-agenda` and appointment list screens to `month-agenda`.+- **Calendar pattern** (Calendar/schedule/appointment screens only) — REQUIRED when the screen manages appointments, schedules, visits, availability, personal/team/POS calendars, or date-grouped work. Choose one: `month-agenda` (`Calendar` + agenda rows), `expandable-calendar-agenda` (`CalendarProvider` + `ExpandableCalendar` + `AgendaList`), `calendar-list-range` (`CalendarList` for date-range browsing), or `timeline-day-list` (date chip strip + `FlatList` when the app intentionally wants a lightweight schedule without another dependency). For TWEED-like calendar management views, default personal/team/POS calendar screens to `expandable-calendar-agenda` and appointment list screens to `month-agenda`.- **Control patterns** (emit only for specialized controls) — use `checkbox-field` for boolean or checklist-like toggles, `numeric-stepper` for bounded plus/minus fields, `line-item-stepper-row` for product/order/cart/inventory rows with inline quantity/count adjustment, `searchable-lookup-sheet` for Dataverse lookup/ComboBox fields with many records, `segmented-control` for 2-5 bounded mutually-exclusive options, and `recurrence-rule-editor` for repeating schedules. Include the control-specific contract: checkbox boolean vs multi-select mapping; stepper min/max/step and commit behavior (`local draft until Save/Next` by default); lookup service/search/display fields/pagination and `@odata.bind`; segmented option source, selected state, optional counts, and generated option const mapping; recurrence pattern/start/end/date-time/weekday-mask fields, summary text, and validation rules.- **Archetype** — one of List / Detail / Form / Auth / Tab-root / Modal-Sheet / Empty-onboarding (see Step 2)- **Role** (omit if open to all signed-in users) — only when the screen is role-gated (e.g. `Supervisor only` for sign-off override, `Inspector (edit) / Supervisor (read) / Auditor (read)` for shared records). The builder uses this together with the UX contract to gate visible controls.@@ -407,7 +415,7 @@ For each screen the user adds, provide this compact shape:- **Lookup writes** — for form/edit screens that set a parent reference (Task → Project, Comment → Task, etc.), explicitly list each lookup field with its `@odata.bind` name + entity set, e.g. `'[email protected]': '/cr3e9_projects(<guid>)'`. Without this the screen-builder will guess and silently lose the relationship. Skip for read-only and no-lookup screens.- **Pagination** — `cursor` if the table has no natural record ceiling (visits, inspections, work orders, tickets, any user-created records over time); `none` if the table is a bounded lookup (status types, categories, job types). When `cursor`, include SDK `maxPageSize: 50`, deterministic `orderBy` with a unique key, `select`, `skipToken` continuation support, and server-side `filter` for search in the data spec. Do not imply that `top: 50` alone is pagination.- **Native capabilities** — which native modules/wrappers it uses, and which iOS/Android platforms or permission states need fallback handling. For PDF/pen screens, be precise: `document-picker` (`expo-document-picker`) for user-picked files; `pdf-report` (`expo-print`, plus `expo-sharing` only when present and sharing is required) for generated local PDFs; `native-pdf-viewer` (`@microsoft/power-apps-native-pdf-viewer` 0.2.9+) for HTTPS PDF URLs and local `file://` URIs; `pen-input` (`@microsoft/power-apps-native-pen-input`) for signature/ink capture. For location screens, distinguish `geolocation` (`@microsoft/power-apps-native-bglocation`) — continuous/background tracking with native Dataverse sync, needs start/stop/tracking-status UI plus a permission-denied state — from one-shot `location` (`expo-location`) for a single foreground coordinate read.-- **Calendar library** — REQUIRED for screens with `Calendar pattern` unless the pattern is `timeline-day-list`. Write `react-native-calendars` and name the exact components expected, for example `CalendarProvider`, `ExpandableCalendar`, `AgendaList`, `Calendar`, `CalendarList`, or `Agenda`. The screen-builder imports this library directly; no `/add-native` wrapper is involved.+- **Calendar library** — REQUIRED for screens with `Calendar pattern` unless the pattern is `timeline-day-list`. Write `react-native-calendars` and name the exact components expected, for example `CalendarProvider`, `ExpandableCalendar`, `AgendaList`, `Calendar`, `CalendarList`, or `Agenda`. The package must also appear in `### JavaScript Dependencies`; the screen-builder imports it directly after the orchestrator installs it. No `/add-native` wrapper or native rebuild is involved.- **Navigation** — what links to it / what it links to- **Navigation intent** — for each outgoing action, explicitly name `navigate`, `push`, or `replace` (must match Navigation Contracts `Intent`)- **State delta** — loading/error are inherited; specify only domain-specific empty copy/icon/CTA or non-standard state behavior. Empty state copy must be domain-specific (not "No items yet"). If the screen has filters, include filter-empty copy that names the active filter and recovery action. If the data source can fail independently, name the error action (`retry inspections`, `refresh assignments`) rather than treating failures as empty. For PDF/pen screens, include the specific native/artifact states: `invalidUrl` for malformed or unsupported PDF viewer input, `viewerFailed`, `pdfGenerationFailed`, `uploadFailed`, `signatureCancelled` (non-error), `signatureCaptureFailed`, and `nativeModuleMissing` where applicable. Examples: `empty: calendar-outline, "No inspections scheduled", CTA "Schedule inspection"`; `filterEmpty: "No critical defects", recovery "Clear severity filter"`.@@ -580,6 +588,10 @@ Section format (same in all phases):**Density / motion / surface**- Inherits from `## Design Direction`; per-screen specs emit overrides only.+### JavaScript Dependencies++None.+### Per-Screen Specs#### Home (`/(app)/home`)diff --git a/plugins/mobile-apps/hooks/validate-package-deps.js b/plugins/mobile-apps/hooks/validate-package-deps.jsindex 38ebfd954..40280e4c7 100644--- a/plugins/mobile-apps/hooks/validate-package-deps.js+++ b/plugins/mobile-apps/hooks/validate-package-deps.js@@ -7,8 +7,8 @@* resulting deps include known-bad packages, private vendor packages are* referenced via the npm registry instead of `file:` paths to vendor *.tgz,* OR native/runtime packages are added outside the current package baseline's- * native/runtime allowlist.- * Generic JS-only dependencies remain allowed.+ * native/runtime allowlist. A reviewed exact-version exception may admit an+ * otherwise ambiguous `react-native-*` package that planning verified is JS-only.** Allowed icon library: `@expo/vector-icons` only.*@@ -40,14 +40,14 @@ const FORBIDDEN_DEPS = {// Names that MUST resolve to a vendor *.tgz file: path.const VENDOR_ONLY = [/^expo-msal-intune$/, /^@microsoft\/pa-/];-// Native/runtime packages are fixed by the Expo template baseline. These name-// patterns intentionally catch Expo modules, React Native packages, config-// plugins, and native-flavoured UI/runtime packages. Generic JS-only packages-// like date-fns, zod, uuid, nanoid, or lodash do not match and remain allowed.+// These patterns identify packages known to require native runtime support. The+// broad `react-native-*` namespace is handled separately because it also contains+// pure-JavaScript packages; those stay blocked unless planning passes an exact+// reviewed name/version exception to explicit validation.const NATIVE_PACKAGE_PATTERNS = [/^expo($|-)/,/^@expo\//,- /^react-native($|-)/,+ /^react-native$/,/^@react-native\//,/^@react-native-community\//,/^@shopify\/react-native-/,@@ -72,6 +72,8 @@ const NATIVE_PACKAGE_PATTERNS = [/^@sentry\/react-native$/,];+const AMBIGUOUS_REACT_NATIVE_PACKAGE_PATTERN = /^react-native-/;+const BUNDLED_TEMPLATE_PACKAGE_PATH = path.resolve(__dirname, '..', 'template', 'package.json');function packageDeps(pkg) {@@ -91,6 +93,14 @@ function readPackageDepsFromContent(content) {}}+function readRequiredPackageDeps(packagePath) {+ const deps = readPackageDepsFromContent(fs.readFileSync(packagePath, 'utf8'));+ if (!deps) {+ throw new Error('package manifest is not valid JSON');+ }+ return deps;+}+function readPackageLockDeps(packageJsonPath) {if (typeof packageJsonPath !== 'string') return null;const lockPath = path.join(path.dirname(packageJsonPath), 'package-lock.json');@@ -135,11 +145,10 @@ function reconstructBeforeContent(toolName, toolInput, afterContent) {function getNativeAllowlistDeps(toolName, toolInput, afterContent, packageJsonPath) {if (toolInput.validation_mode === 'explicit-mobile-workflow') {- try {- return readPackageDepsFromContent(fs.readFileSync(BUNDLED_TEMPLATE_PACKAGE_PATH, 'utf8'));- } catch {- return null;- }+ // Explicit mobile validation is the final native-runtime gate. If the bundled+ // template is missing or malformed, allowing the write would silently turn a+ // verification failure into permission to add arbitrary native dependencies.+ return readRequiredPackageDeps(BUNDLED_TEMPLATE_PACKAGE_PATH);}const beforeContent = reconstructBeforeContent(toolName, toolInput, afterContent);@@ -147,8 +156,15 @@ function getNativeAllowlistDeps(toolName, toolInput, afterContent, packageJsonPareturn beforeDeps || readPackageLockDeps(packageJsonPath);}-function isNativeLikePackage(name) {- return NATIVE_PACKAGE_PATTERNS.some((rx) => rx.test(name));+function approvedJsDependencyVersions(toolInput) {+ const approved = new Map();+ if (!Array.isArray(toolInput.approved_js_dependencies)) return approved;+ for (const entry of toolInput.approved_js_dependencies) {+ if (typeof entry?.name === 'string' && typeof entry?.version === 'string') {+ approved.set(entry.name, entry.version);+ }+ }+ return approved;}function isPackageJson(filePath) {@@ -177,7 +193,7 @@ function readResult(toolName, toolInput) {return '';}-function findViolations(content, filePath, nativeAllowlistDeps) {+function findViolations(content, filePath, nativeAllowlistDeps, approvedJsDependencies) {let pkg;try {pkg = JSON.parse(content);@@ -205,12 +221,21 @@ function findViolations(content, filePath, nativeAllowlistDeps) {reason: `\`${name}\` is a private vendor package. Reference must be a \`file:./vendor/<name>-<version>.tgz\` path, not \`${version}\`. Will 404 from npm registry.`,});}- if (!editingBundledTemplatePackage && nativeAllowlistDeps && isNativeLikePackage(name)) {- if (!nativeAllowlistDeps[name]) {+ if (!editingBundledTemplatePackage && nativeAllowlistDeps && !nativeAllowlistDeps[name]) {+ if (NATIVE_PACKAGE_PATTERNS.some((rx) => rx.test(name))) {violations.push({name,version,- reason: `Native/runtime dependency \`${name}\` was not present in this app/template package baseline before the edit. Do not add native libraries from an app branch; start from a template/runtime that already ships it. JS-only packages are still allowed.`,+ reason: `Native/runtime dependency \`${name}\` was not present in this app/template package baseline. Start from a template/runtime that already ships it.`,+ });+ } else if (+ AMBIGUOUS_REACT_NATIVE_PACKAGE_PATTERN.test(name) &&+ approvedJsDependencies.get(name) !== String(version)+ ) {+ violations.push({+ name,+ version,+ reason: `Dependency \`${name}@${version}\` uses the ambiguous \`react-native-*\` namespace and is absent from the app/template baseline. Explicit validation requires the same exact name/version from the user-approved JavaScript Dependencies plan.`,});}}@@ -236,8 +261,17 @@ process.stdin.on('end', () => {const content = readResult(toolName, toolInput);if (!content) process.exit(0);- const nativeAllowlistDeps = getNativeAllowlistDeps(toolName, toolInput, content, fp);- const violations = findViolations(content, fp, nativeAllowlistDeps);+ let nativeAllowlistDeps;+ try {+ nativeAllowlistDeps = getNativeAllowlistDeps(toolName, toolInput, content, fp);+ } catch (error) {+ process.stderr.write(+ `BLOCKED: unable to load native dependency allowlist from ${BUNDLED_TEMPLATE_PACKAGE_PATH}: ${error.message}\n`,+ );+ process.exit(2);+ }+ const approvedJsDependencies = approvedJsDependencyVersions(toolInput);+ const violations = findViolations(content, fp, nativeAllowlistDeps, approvedJsDependencies);if (violations.length === 0) process.exit(0);const rel = path.relative(process.cwd(), fp) || fp;diff --git a/plugins/mobile-apps/scripts/tests/validate-package-deps.test.js b/plugins/mobile-apps/scripts/tests/validate-package-deps.test.jsnew file mode 100644index 000000000..4cd8b1869--- /dev/null+++ b/plugins/mobile-apps/scripts/tests/validate-package-deps.test.js@@ -0,0 +1,131 @@+'use strict';++const test = require('node:test');+const assert = require('node:assert');+const fs = require('node:fs');+const os = require('node:os');+const path = require('node:path');+const { spawnSync } = require('node:child_process');++const DISPATCHER = path.resolve(__dirname, '..', 'validate-mobile-files.js');+const VALIDATOR = path.resolve(__dirname, '..', '..', 'hooks', 'validate-package-deps.js');++function makeProject(packageName, version = '1.0.0') {+ const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'mobile-package-deps-'));+ fs.writeFileSync(+ path.join(projectRoot, 'package.json'),+ JSON.stringify({ name: 'fixture', dependencies: { [packageName]: version } }),+ );+ return projectRoot;+}++function validate(projectRoot, approvedDependencies = []) {+ const args = [+ DISPATCHER,+ '--project-root',+ projectRoot,+ '--file',+ 'package.json',+ ];+ for (const approvedDependency of approvedDependencies) {+ args.push('--approved-js-dependency', approvedDependency);+ }+ return spawnSync(process.execPath, args, {+ cwd: projectRoot,+ encoding: 'utf8',+ });+}++test('blocks a new react-native-prefixed package without plan approval', (t) => {+ const projectRoot = makeProject('react-native-calendars', '1.1314.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot);++ assert.strictEqual(result.status, 2);+ assert.match(result.stderr, /user-approved JavaScript Dependencies plan/);+});++test('allows the exact react-native-prefixed package version approved in the plan', (t) => {+ const projectRoot = makeProject('react-native-calendars', '1.1314.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot, ['[email protected]']);++ assert.strictEqual(result.status, 0, result.stderr);+});++test('blocks an approved package when package.json has a different version', (t) => {+ const projectRoot = makeProject('react-native-calendars', '1.1314.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot, ['[email protected]']);++ assert.strictEqual(result.status, 2);+ assert.match(result.stderr, /react-native-calendars@1\.1314\.0/);+});++test('does not let plan approval bypass a known native package block', (t) => {+ const projectRoot = makeProject('expo-notifications', '1.0.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot, ['[email protected]']);++ assert.strictEqual(result.status, 2);+ assert.match(result.stderr, /Native\/runtime dependency `expo-notifications`/);+});++test('continues to allow ordinary JavaScript packages without an exception', (t) => {+ const projectRoot = makeProject('date-fns', '4.1.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot);++ assert.strictEqual(result.status, 0, result.stderr);+});++test('rejects non-exact approved dependency versions', (t) => {+ const projectRoot = makeProject('react-native-calendars', '1.1314.0');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot, ['react-native-calendars@^1.1314.0']);++ assert.strictEqual(result.status, 1);+ assert.match(result.stderr, /Invalid --approved-js-dependency value/);+});++test('parses scoped exact-version approvals', (t) => {+ const projectRoot = makeProject('@scope/calendar-tools', '2.3.4');+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));++ const result = validate(projectRoot, ['@scope/[email protected]']);++ assert.strictEqual(result.status, 0, result.stderr);+});++test('blocks explicit validation when the template allowlist cannot be loaded', (t) => {+ const projectRoot = makeProject('date-fns', '4.1.0');+ const isolatedPluginRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'mobile-validator-plugin-'));+ const isolatedValidator = path.join(isolatedPluginRoot, 'hooks', 'validate-package-deps.js');+ fs.mkdirSync(path.dirname(isolatedValidator), { recursive: true });+ fs.copyFileSync(VALIDATOR, isolatedValidator);+ t.after(() => fs.rmSync(projectRoot, { recursive: true, force: true }));+ t.after(() => fs.rmSync(isolatedPluginRoot, { recursive: true, force: true }));++ const packageJsonPath = path.join(projectRoot, 'package.json');+ const result = spawnSync(process.execPath, [isolatedValidator], {+ cwd: projectRoot,+ encoding: 'utf8',+ input: JSON.stringify({+ tool_name: 'Write',+ tool_input: {+ content: fs.readFileSync(packageJsonPath, 'utf8'),+ file_path: packageJsonPath,+ validation_mode: 'explicit-mobile-workflow',+ },+ }),+ });++ assert.strictEqual(result.status, 2);+ assert.match(result.stderr, /unable to load native dependency allowlist/);+});diff --git a/plugins/mobile-apps/scripts/validate-mobile-files.js b/plugins/mobile-apps/scripts/validate-mobile-files.jsindex d41ea1fd4..8ecd6e2a7 100644--- a/plugins/mobile-apps/scripts/validate-mobile-files.js+++ b/plugins/mobile-apps/scripts/validate-mobile-files.js@@ -15,14 +15,26 @@ const PLUGIN_ROOT = path.resolve(__dirname, '..');function usage() {return [- 'Usage: node validate-mobile-files.js --project-root <path> --file <path> [--file <path> ...]',+ 'Usage: node validate-mobile-files.js --project-root <path> --file <path> [--file <path> ...] [--approved-js-dependency <name>@<exact-version> ...]','','Paths must be regular files. Relative paths resolve from --project-root.',+ 'Approved JavaScript dependencies must use exact semver versions from the reviewed app plan.',].join('\n');}+function parseApprovedJsDependency(value) {+ if (typeof value !== 'string') return null;+ const separator = value.lastIndexOf('@');+ if (separator <= 0) return null;+ const name = value.slice(0, separator);+ const version = value.slice(separator + 1);+ if (!name || (name.startsWith('@') && !name.includes('/'))) return null;+ if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(version)) return null;+ return { name, version };+}+function parseArgs(argv) {- const parsed = { projectRoot: null, targets: [] };+ const parsed = { approvedJsDependencies: [], errors: [], projectRoot: null, targets: [] };for (let index = 0; index < argv.length; index += 1) {const arg = argv[index];@@ -32,6 +44,14 @@ function parseArgs(argv) {} else if (arg === '--file') {parsed.targets.push(argv[index + 1]);index += 1;+ } else if (arg === '--approved-js-dependency') {+ const approvedDependency = parseApprovedJsDependency(argv[index + 1]);+ if (approvedDependency) {+ parsed.approvedJsDependencies.push(approvedDependency);+ } else {+ parsed.errors.push(`Invalid --approved-js-dependency value: ${argv[index + 1] || '<missing>'}`);+ }+ index += 1;} else if (arg === '--help' || arg === '-h') {parsed.help = true;} else {@@ -47,7 +67,7 @@ function isWithinRoot(filePath, projectRoot) {return relative === '' || (!relative.startsWith(`..${path.sep}`) && relative !== '..' && !path.isAbsolute(relative));}-function runValidator(validatorName, filePath, content, projectRoot) {+function runValidator(validatorName, filePath, content, projectRoot, approvedJsDependencies) {const validatorPath = path.join(PLUGIN_ROOT, 'hooks', validatorName);const payload = JSON.stringify({cwd: projectRoot,@@ -57,6 +77,7 @@ function runValidator(validatorName, filePath, content, projectRoot) {file_path: filePath,filePath,validation_mode: 'explicit-mobile-workflow',+ approved_js_dependencies: approvedJsDependencies,},});@@ -73,11 +94,15 @@ function runValidator(validatorName, filePath, content, projectRoot) {}function main(argv) {- const { help, projectRoot: projectRootArg, targets } = parseArgs(argv);+ const { approvedJsDependencies, errors, help, projectRoot: projectRootArg, targets } = parseArgs(argv);if (help) {process.stdout.write(`${usage()}\n`);return 0;}+ if (errors.length > 0) {+ process.stderr.write(`${errors.join('\n')}\n\n${usage()}\n`);+ return 1;+ }if (!projectRootArg || targets.length === 0 || targets.some((target) => !target)) {process.stderr.write(`${usage()}\n`);return 1;@@ -133,7 +158,13 @@ function main(argv) {for (const validator of VALIDATORS) {if (!validator.appliesTo(filePath)) continue;- const result = runValidator(validator.script, filePath, content, projectRoot);+ const result = runValidator(+ validator.script,+ filePath,+ content,+ projectRoot,+ approvedJsDependencies,+ );if (result.stdout) process.stdout.write(result.stdout);if (result.stderr) process.stderr.write(result.stderr);if (result.error) {@@ -159,4 +190,5 @@ module.exports = {isWithinRoot,main,parseArgs,+ parseApprovedJsDependency,};\ No newline at end of filediff --git a/plugins/mobile-apps/shared/references/javascript-dependency-planning.md b/plugins/mobile-apps/shared/references/javascript-dependency-planning.mdnew file mode 100644index 000000000..c31503832--- /dev/null+++ b/plugins/mobile-apps/shared/references/javascript-dependency-planning.md@@ -0,0 +1,94 @@+# JavaScript Dependency Planning++Canonical policy for selecting and adding app-scoped JavaScript libraries. Used by `screen-planner`, `/create-mobile-app`, `/edit-app`, and `/debug-app`.++## Boundary++The prebuilt mobile runtime limits packages that ship native code or native configuration. It does not limit pure-JavaScript packages.++A package is native-bound when it or a runtime dependency ships any of these:++- `ios/`, `android/`, `windows/`, or `macos/` platform projects+- `*.podspec`+- `codegenConfig`+- `expo-module.config.json`+- `app.plugin.js`, `app.plugin.ts`, or equivalent Expo config plugin+- `react-native.config.js`++Those packages must already be supported by the template/runtime. A package name is not evidence: a `react-native-*` package may still be pure JavaScript.++## When To Select A Library++Run this workflow when either condition is true:++1. The user explicitly asks to add or use a JavaScript package.+2. An approved feature has an established library that materially reduces parsing, rules, state, rendering, or accessibility risk compared with hand-written code.++First check the app's existing `dependencies` and platform APIs. Reuse a suitable installed dependency. Do not add a package for a trivial helper or a UI that existing React Native, Expo, Tamagui, or standard JavaScript APIs can implement clearly.++## Candidate Selection++For an explicit package request, evaluate that package first. For a use-case-driven request, shortlist at most three packages and choose one. Do not present a package picker unless two candidates have materially different product behavior that the user must decide.++Use read-only metadata and package-file checks; never install during planning:++```bash+npm view "<package>" version deprecated license time.modified engines peerDependencies dependencies scripts repository --json+npm pack "<package>@<exact-version>" --dry-run --ignore-scripts --json+```++Evaluate candidates in this order:++1. **Compatibility** - supports the project's React, React Native, Expo, and Node versions; does not require an absent peer dependency.+2. **JavaScript-only** - published files and runtime dependencies have no native markers from the Boundary section.+3. **Safety** - not deprecated; no `preinstall`, `install`, or `postinstall` lifecycle script for an automatically selected runtime package; identifiable license and repository.+4. **Maintenance** - maintained stable release, bundled TypeScript declarations or trustworthy types, and no abandoned replacement warning.+5. **Fit** - smallest focused API that handles the approved use case without duplicating an installed package.++If no candidate passes, use existing primitives when that still meets the requirement. Otherwise return `NEEDS_CONTEXT` or `BLOCKED` with the failed compatibility/native criterion; never install first and hope it works.++## Plan Contract++In `## Screens`, emit `### JavaScript Dependencies` before per-screen specs. Use `None.` when no library is needed. Every selected runtime package uses this table:++| Package | Exact version | Used by | Why selected | JS-only evidence | Native rebuild |+|---|---|---|---|---|---|+| `<package>` | `<x.y.z>` | `<screens/use case>` | `<fit over existing APIs and alternatives>` | `<metadata/file-list evidence>` | `No - pure JavaScript` |++The exact version and rationale are part of the screen-plan approval. Approval authorizes the orchestrator to add that package; it does not authorize different packages or version ranges.++### Calendar example++A full month/week/agenda scheduling surface triggers candidate selection. Evaluate `react-native-calendars` first because it supplies established calendar and agenda primitives and is pure JavaScript; `1.1314.0` is the known-good version for the current template baseline. Confirm current metadata and compatibility before writing the row. A lightweight horizontal date strip plus `FlatList` does not require a new package.++## Installation Contract++Only `/create-mobile-app` or `/edit-app` installs approved rows, before screen builders run:++```bash+npm install --save-exact <package>@<exact-version>+```++Then verify:++- `package.json` records the exact version in `dependencies`+- the lockfile is updated when the project uses one+- `require.resolve('<package>', { paths: [process.cwd()] })` succeeds+- the changed-file dependency validator passes with one exact approval argument for every row currently in `### JavaScript Dependencies`:++ ```bash+ node "${PLUGIN_ROOT}/scripts/validate-mobile-files.js" \+ --project-root "<working_dir>" \+ --file package.json \+ --approved-js-dependency "<package>@<exact-version>" \+ [--approved-js-dependency "<another-package>@<exact-version>" ...]+ ```++ The approval arguments are deterministic exceptions for package names that the baseline conservatively classifies as native-like. They do not classify package contents and cannot override packages known to require native runtime support.+- `npx tsc --noEmit` passes after the consuming code is built++If installed contents reveal native code/config or an incompatible runtime dependency, remove only the newly added package, report the block, and do not let builders import it. Pure-JavaScript additions do not need `/add-native`, `app.config.js`, CocoaPods, Gradle, a native rebuild, or a rewrap-base update.++## Builder Contract++Builders may directly import only packages listed in the approved table and present at the exact version in `package.json`. Builders never select packages, edit manifests, or run installs. A missing approved package is an orchestrator block; an unplanned package is a planning-context error.diff --git a/plugins/mobile-apps/shared/references/screen-templates.md b/plugins/mobile-apps/shared/references/screen-templates.mdindex 999d1e808..1493fc182 100644--- a/plugins/mobile-apps/shared/references/screen-templates.md+++ b/plugins/mobile-apps/shared/references/screen-templates.md@@ -52,14 +52,14 @@ Use these pattern names when the user's app has dashboard or workflow behavior.### Calendar pattern keys (Calendar / schedule / appointment screens)-Calendar management screens should use `react-native-calendars` when the package is present. These keys let the planner specify the expected calendar surface without inlining implementation details into every screen spec.+Calendar management screens should use `react-native-calendars` when the approved screen plan lists it under `JavaScript Dependencies`. It is installed into the individual app on demand rather than bundled in the template. These keys let the planner specify the expected calendar surface without inlining implementation details into every screen spec.| Key | Use when | Required layout pieces ||---|---|---|| `expandable-calendar-agenda` | Personal/team/POS calendar management views where users move between month context and daily agenda | `CalendarProvider`, `ExpandableCalendar`, `AgendaList`, selected-date state, marked dates/count dots, pull-to-refresh agenda rows, empty day state || `month-agenda` | Appointment list screens that need month selection plus rows below | `Calendar` or compact `CalendarList`, marked dates, selected day header, agenda `FlatList`, create/view appointment CTA || `calendar-list-range` | Users browse date ranges across multiple months | `CalendarList`, range or multi-dot marking, sticky selected-range summary, rows filtered by visible date/range |-| `timeline-day-list` | The template does not include `react-native-calendars`, or the app intentionally wants a lightweight schedule timeline | Horizontal date chip strip, date-grouped `FlatList`, today shortcut, empty day state |+| `timeline-day-list` | The app intentionally wants a lightweight schedule timeline without adding a calendar dependency | Horizontal date chip strip, date-grouped `FlatList`, today shortcut, empty day state |For TWEED-style field-sales calendars, use `expandable-calendar-agenda` for Personal, Team, and POS calendar views, and `month-agenda` for appointment lists.diff --git a/plugins/mobile-apps/shared/shared-instructions.md b/plugins/mobile-apps/shared/shared-instructions.mdindex 487468be4..4f9a6ba92 100644--- a/plugins/mobile-apps/shared/shared-instructions.md+++ b/plugins/mobile-apps/shared/shared-instructions.md@@ -111,8 +111,9 @@ Never pass a directory or the whole project. Files with common text extensions (- MUST NOT run platform-native run commands if `npx tsc --noEmit` has not succeeded in the current session.- MUST NOT edit any file under `src/generated/` unless the step explicitly calls for it. These files are regenerated by `npx power-apps add-data-source`.-- MUST NOT install packages with `npm install <pkg>` for Expo modules — use `npx expo install <pkg>` so versions stay Expo-SDK-compatible.-- MUST NOT add native/runtime libraries that are not already in the template `package.json` (`expo-*`, `react-native-*`, `@react-native/*`, config plugins, or packages with native platform code). The wrapped binary only contains the template's native modules. Generic JS-only packages are allowed when a skill explicitly needs them.+- MUST NOT install Expo modules with `npm install <pkg>` — use `npx expo install <pkg>` so versions stay Expo-SDK-compatible.+- MUST NOT add packages with native source, podspecs, codegen configuration, Expo modules/config plugins, or platform projects unless they already exist in the template `package.json`. The wrapped binary only contains the template's native modules.+- A package name is not evidence of native code. For explicit package requests or approved use cases, pure-JavaScript libraries, including JS-only `react-native-*` packages, may be selected and added at an exact version to app runtime `dependencies`; no Android/iOS rebuild is needed. Follow the selection, approval, and install gates in [`references/javascript-dependency-planning.md`](references/javascript-dependency-planning.md).- MUST NOT add browser-based runtime verification steps, React Native Web setup, screen-by-screen runtime checks, route crawling, or direct Metro/localhost HTTP probes to mobile-app skills. Runtime diagnosis, when requested, uses `/debug-app` against the captured Metro terminal output.- MUST NOT add `react-native-reanimated/plugin` anywhere except as the **last** entry in `babel.config.js` `plugins` array. Wrong order silently breaks animations.- MUST NOT modify `app/_layout.tsx`'s provider wrapping order without re-running `npx tsc --noEmit`.@@ -202,7 +203,7 @@ Apply these rules whenever an `az`, `npm`, `npx`, or `expo` command exits non-ze| Error | Action || --- | --- || `TS6133` (unused import) | Remove the unused import and retry once. |-| `TS2305` / `TS2307` (missing export / module not found) | If the missing package is a native/runtime library, STOP unless it already exists in the template `package.json`. For JS-only packages, run `npx expo install <missing-package>` (NOT plain `npm install`) and retry. |+| `TS2305` / `TS2307` (missing export / module not found) | If the missing package ships native code/config, STOP unless it already exists in the template `package.json`. If an approved plan names a pure-JavaScript dependency, run `npm install --save-exact <package>@<approved-version>` and retry. Do not install an unplanned package merely to silence an import error. || Other TS error | Surface the file, line, and full message. STOP. Do not run platform builds. |### `npx power-apps add-data-source` failuresdiff --git a/plugins/mobile-apps/skills/add-native/SKILL.md b/plugins/mobile-apps/skills/add-native/SKILL.mdindex 473eb1451..baeef2906 100644--- a/plugins/mobile-apps/skills/add-native/SKILL.md+++ b/plugins/mobile-apps/skills/add-native/SKILL.md@@ -16,7 +16,7 @@ Generate a one-file typed wrapper under `src/native/` for a native device capabi1. **Never run `npx expo install`, `npm install`, or `yarn add` for a native module.** The set of native modules in `package.json` is fixed by the upstream template. Adding a new one breaks the rewrap pipeline (the customer's binary is built from a pre-built base, not from their `package.json`).2. **Never edit `app.config.js`** — plugins, `ios.infoPlist`, `android.permissions`, or anything else. All native config the template ships is intentional and signed off; arbitrary additions cannot be honored at rewrap time.-3. **Never edit `package.json` `dependencies` for native modules** (anything starting with `expo-`, `react-native-`, or that ships an iOS/Android folder). Generic JS-only libraries (e.g., `date-fns`, `zod`, `@tanstack/react-query`) are not native modules and remain fine to install via `npx expo install <pkg>` from other skills — this rule scopes only to packages with a config plugin or native code.+3. **Never edit `package.json` `dependencies` for native modules.** Native means the package ships platform source/projects, a podspec, codegen, an Expo module/config plugin, or `react-native.config.js`; a package-name prefix alone is not proof. Pure-JavaScript dependencies are out of scope for `/add-native` and are installed from an approved `JavaScript Dependencies` plan by `/create-mobile-app` or `/edit-app`.4. **If the requested module isn't actually present in `package.json` — STOP.** That means the upstream template hasn't shipped it yet; do not work around by installing it.## Routing — `/add-native` is the public entry point@@ -137,7 +137,6 @@ Apply the Native capability gate above. This table is a known capability-to-pack| `secure-store` | `expo-secure-store` | `src/native/secureStore.ts` | || `file-system` | `expo-file-system` | `src/native/fileSystem.ts` | || `sharing` | `expo-sharing` | `src/native/sharing.ts` | |-| `calendar-management-view` | `react-native-calendars` | None | UI library for calendar/agenda screens. No wrapper, no permissions, no `/add-native` execution; screen-builder imports directly when present in `package.json`. || `location` | `expo-location` | `src/native/location.ts` | One-shot/foreground fix only. For continuous background tracking with Dataverse sync, use `geolocation` (`@microsoft/power-apps-native-bglocation`). Use only when the current template package contains `expo-location` || `biometrics`, `local-authentication` | `expo-local-authentication` | `src/native/biometrics.ts` | Use only when the current template package contains `expo-local-authentication` || `clipboard` | `expo-clipboard` | `src/native/clipboard.ts` | Use only when the current template package contains `expo-clipboard` |@@ -149,7 +148,6 @@ Apply the Native capability gate above. This table is a known capability-to-pack| `screen-orientation` | `expo-screen-orientation` | `src/native/screenOrientation.ts` | Use only when package is present; do not edit native config || `device-info` | `expo-device` / `expo-application` / `expo-cellular` | `src/native/deviceInfo.ts` | Read-only device/app/cellular metadata wrappers || `date-time-picker` | `@react-native-community/datetimepicker` | screen-level component usage | Use directly in form screens per screen-builder rules; no `/add-native` wrapper required |-| `calendar-ui` | `react-native-calendars` | screen-level component usage | JS calendar UI only; not a native permissioned capability |### PDF / pen routing rules@@ -195,8 +193,6 @@ When the user asks for "location" or "GPS", disambiguate by intent: continuous/bIf the user names something not in the supported table, apply the Native capability gate: resolve the relevant package from `package.json`, continue only when present and not runtime-banned, otherwise stop with a transparency note.-If the resolved capability is `calendar-management-view`, STOP after verifying `react-native-calendars` is present in `package.json`: no wrapper is generated because it is a UI library, not a device API. The screen-builder owns importing `Calendar`, `CalendarProvider`, `ExpandableCalendar`, `AgendaList`, `Agenda`, or `CalendarList` directly from `react-native-calendars` based on the approved screen spec.-### Step 3 — Route to nested helpers or inline wrappersFor normalized `camera`, `image-picker`, `barcode-scanner`, `qr-scanner`, `pdf-report`, `pdf-viewer`, `pen-input`, or `geolocation`, do not fall through to the generic wrapper flow and do not tell the user to run another slash command. Read the nested helper and follow its steps inside this `/add-native` invocation:@@ -325,4 +321,4 @@ Sample usage:- This skill never modifies `package.json`, `app.config.js`, `src/playerConfig.ts`, `src/generated/`, or any screen file.- For capabilities not in the supported table (`expo-notifications`, Bluetooth, NFC, BLE, AR — until the template adds them), tell the user the template doesn't ship them yet — file a request at the upstream template repo. Do NOT attempt to install or configure anything yourself.-- Generic JS-only libraries (`date-fns`, `zod`, `@tanstack/react-query`, etc.) are out of scope for this skill but remain fine to install via `npx expo install <pkg>` in other contexts — the prohibition above applies only to native modules with a config plugin or platform code.+- Pure-JavaScript libraries are out of scope for this skill. `/create-mobile-app` or `/edit-app` selects and installs them through [`shared/references/javascript-dependency-planning.md`](${CLAUDE_SKILL_DIR}/../../shared/references/javascript-dependency-planning.md); no native wrapper or Android/iOS rebuild is needed. The prohibition above applies only to packages with native source/config.diff --git a/plugins/mobile-apps/skills/create-mobile-app/SKILL.md b/plugins/mobile-apps/skills/create-mobile-app/SKILL.mdindex b1966d79b..06820f4f0 100644--- a/plugins/mobile-apps/skills/create-mobile-app/SKILL.md+++ b/plugins/mobile-apps/skills/create-mobile-app/SKILL.md@@ -14,7 +14,7 @@ Top-level orchestrator. Owns the user-visible flow; delegates planning to the `n## Workflow-0. Resume check + fresh-template gate → 1. Prerequisites → 2. Gather requirements → 2b. Requirements discovery → 2c. Plan preview (rough cost + abort gate) → 3. Plan (planner agent + 4 gates) → 4. Auth & environment → 5. Prepare existing template → 6. `npx power-apps init` → 6.5 verify `npm install` → **6.5b SafeAreaProvider gate (always runs, idempotent)** → 6.6 scaffold `tsc` smoke check → 6.7 seed memory bank → **6.85 Offline profile (always asked)** → 7. Auth config → 8. Apply data model → 9. Apply native capabilities → 9b. Design system → 10. Add connectors → 10b. Wire navigation layout → 11. Build screens (parallel) → 11.4 Stylistic fix sweep → 12. Start Metro (`npx expo start`) → 12.5 Optional debug handoff → 13. Summary+0. Resume check + fresh-template gate → 1. Prerequisites → 2. Gather requirements → 2b. Requirements discovery → 2c. Plan preview (rough cost + abort gate) → 3. Plan (planner agent + 4 gates) → 4. Auth & environment → 5. Prepare existing template → 6. `npx power-apps init` → 6.5 verify `npm install` → **6.5b SafeAreaProvider gate (always runs, idempotent)** → 6.6 scaffold `tsc` smoke check → 6.7 seed memory bank → **6.85 Offline profile (always asked)** → 7. Auth config → 8. Apply data model → 9. Apply native capabilities → 9a. Install planned JavaScript dependencies → 9b. Design system → 10. Add connectors → 10b. Wire navigation layout → 11. Build screens (parallel) → 11.4 Stylistic fix sweep → 12. Start Metro (`npx expo start`) → 12.5 Optional debug handoff → 13. Summary---@@ -1212,7 +1212,13 @@ Arguments:Run sequentially. Each writes a single file under `src/native/` and does not touch `package.json` or `app.config.js`, so they could in principle run in parallel — but sequential keeps the orchestration log readable.-If the plan says "None — this app uses only standard React Native components and Power Platform connectors", skip only the native-capability invocation above and continue to Step 9b. Do NOT skip Step 9b; Tamagui aliases and brand tokens are required for screen quality even when the app has no native capabilities.+If the plan says "None — this app uses only standard React Native components and Power Platform connectors", skip only the native-capability invocation above and continue to Step 9a. Do NOT skip Step 9a or Step 9b; an app can need a pure-JavaScript library without any native capability, and Tamagui aliases/brand tokens are always required.++### Step 9a — Install approved pure-JavaScript dependencies++Read and execute the Installation Contract in [`shared/references/javascript-dependency-planning.md`](${CLAUDE_SKILL_DIR}/../../shared/references/javascript-dependency-planning.md) for every approved row in `## Screens → ### JavaScript Dependencies`. If the subsection is absent or says `None.`, continue without changing dependencies.++Gate 4b approval is consent for exactly the packages and versions in the table. Install them into `<working_dir>` before any skeleton or builder imports them, validate `package.json` and the lockfile, and verify module resolution. Do not substitute another package/version, infer a package from a compiler error, or route a JS-only package through `/add-native`. If final inspection finds native code/config or incompatible runtime dependencies, remove only the newly added package and STOP with the exact failed criterion.### Step 9b — Apply design systemdiff --git a/plugins/mobile-apps/skills/debug-app/SKILL.md b/plugins/mobile-apps/skills/debug-app/SKILL.mdindex a59b6aeec..72a9751f9 100644--- a/plugins/mobile-apps/skills/debug-app/SKILL.md+++ b/plugins/mobile-apps/skills/debug-app/SKILL.md@@ -461,7 +461,7 @@ These recipes apply to errors classified as "Import / Bundle" in Step B. They ar| `SyntaxError: <file>:<line>:<col>` in `app/`, `src/components/`, `src/hooks/`, `src/services/` | The cited line is in editable user code (NOT `src/generated/`, NOT `node_modules/`) | `Read` the file around the cited line (±10 lines), identify the syntactic issue (unclosed JSX tag, missing closing brace/paren, stray comma, missing `from` in import, unterminated string, missing semicolon between statements), apply a single minimal `Edit`. Do NOT reformat surrounding code. || `SyntaxError` in `src/generated/` | Cited file is under `src/generated/` | **Do not edit.** Schema regen produced bad output. Hand-off: tell the user to re-run `npm run generate-schemas`; if the error reproduces, route to `/add-connector` or `/add-dataverse` to re-add the affected datasource. || `Unable to resolve module <name>` from `<importer>` | `<name>` starts with `.` or `..` (relative import) | `Glob` the importer's directory for files matching `<name>` with any extension (`.ts`, `.tsx`, `.js`, `.jsx`, `.json`). If found with a different extension → fix the import to drop the extension OR match the actual one. If found with a typo (Levenshtein ≤ 2) → fix the typo. If not found at all → the file genuinely doesn't exist; surface to user and ask whether to create it or remove the import. |-| `Unable to resolve module <name>` | `<name>` is a bare package (no `.` / `/`) AND not present in `package.json` `dependencies` / `devDependencies` | Tell the user before installing: `> "Bundle requires '<name>' which isn't in package.json. Install it as a runtime dependency? (Y/n)"` On confirm, run `npm install <name>` (or `npm install -D <name>` if it's a known dev-only tool like `@types/*`). Do NOT install without consent — package adds are a supply-chain decision. |+| `Unable to resolve module <name>` | `<name>` is a bare package AND not present in `package.json` `dependencies` / `devDependencies` | Follow [`shared/references/javascript-dependency-planning.md`](${CLAUDE_SKILL_DIR}/../../shared/references/javascript-dependency-planning.md) to classify the published package by contents, not its name. If native-bound and absent from the template, report that a template/runtime update is required. If verified pure JavaScript, ask consent for the exact version, install with `npm install --save-exact`, validate, and retry. Do NOT install without consent. || `Unable to resolve module <name>` | `<name>` IS in `package.json` but the bundle still fails | Likely cache: instruct the user to stop the Metro terminal and re-run with `npx expo start --clear`. Do NOT auto-restart Metro from the skill — it owns Metro's lifecycle (see Constraints). || `transform failed` referencing a babel plugin (e.g., `[BABEL] ... unknown plugin "react-native-reanimated/plugin"`) | Error references `babel.config.js` | **Hand-off.** `babel.config.js` is project config (same constraint that protects `app.config.js`). Print the cited plugin and suggested fix order (e.g., "`react-native-reanimated/plugin` MUST be the LAST plugin in `babel.config.js` `plugins` array"); skip to next issue. || `transform failed` without a babel reference | Generic transform failure (often a TS feature Metro's transformer can't handle) | Read the cited file, look for syntax that requires a specific TS lib (e.g., decorators, top-level await). If the issue is a known-bad pattern, surface and ask before fixing. Otherwise hand-off. |diff --git a/plugins/mobile-apps/skills/edit-app/SKILL.md b/plugins/mobile-apps/skills/edit-app/SKILL.mdindex cd8638837..01ad1200f 100644--- a/plugins/mobile-apps/skills/edit-app/SKILL.md+++ b/plugins/mobile-apps/skills/edit-app/SKILL.md@@ -58,6 +58,7 @@ This is a focused edit workflow, not a lighter quality bar. Reuse `/create-mobil| New screen | Shared scaffold gate, skeleton gate, screen-builder wave gate, style-quality sweep, route check, final `tsc` || Existing screen TSX | Screen edit gate, style-quality sweep, route check when navigation changed, final `tsc` || Native capability | Native allowlist gate, wrapper existence gate, final `tsc` |+| Pure-JavaScript dependency | Approved exact-version dependency table, package-content gate, package validation, final `tsc` || Design/component/density | Design-system gate, affected-screen style sweep, final `tsc`, preview |**When a gate fails:** capture full output once, classify by root cause, repair in a batch, rerun the same gate once. Do not make line-by-line fixes with `tsc` after every tiny edit. Continue only when the gate is clean or record a `BLOCKED:` / `DONE_WITH_CONCERNS:` entry in `memory-bank.md`.@@ -184,6 +185,7 @@ Use this scenario coverage matrix for common follow-ups. The goal is one user pr| Update design to match company branding | Design; Screens only if component grammar/density changes | `/design-system --refresh <dimension>` or `--reskin` | Rebuild affected screens only when tokens alone are insufficient; always preview || Add a form to create a new Dataverse record | Screens; Data Model if table/columns/lookups/create service are missing | `/add-dataverse --skip-planning` when schema/service is missing | Build form route, create payload helper, parent navigation, and focus refresh; verify create/update payloads || Add barcode scanning and use scanned value to search records | Native Capabilities, Screens; Data Model if scan target field is missing | `/add-native barcode-scanner`; `/add-dataverse` only if target field/table is absent | Build scanner/search flow, pause/lock scan callback, search via service filter, preview |+| Add a full calendar, agenda, or scheduling view | Screens → JavaScript Dependencies | Add exact `react-native-calendars` version to the approved table, then `npm install --save-exact` before builders | Build the calendar screen with the approved pattern; no `/add-native` or Android/iOS rebuild || Add a new requirement with a new screen | Usually Screens plus whichever of Data Model, Connector, Native, Design the requirement implies | Decompose into one coherent feature; apply data/connector/native/design first, then screens | Generate/refresh service snapshot, layouts, skeletons/shared code, then build affected screens || Add a new data source but no screen | Connector/Data Source; sometimes Data Model | `/add-datasource` when ambiguous; `/add-sharepoint`, `/add-connector`, or `/add-dataverse` when clear | Refresh generated services and memory bank; no screen rebuild unless the user asked for UI || Add a new table/entity but no screen | Data Model | `mobile-app:data-model-architect` -> `/add-dataverse --skip-planning` | Refresh generated services; optionally seed sample data; no preview unless UI changed |@@ -198,6 +200,7 @@ Loophole checks before continuing:- If the request is ambiguous about Dataverse vs SharePoint vs another connector, route through `/add-datasource` rather than guessing.- If a screen requires a native wrapper, run `/add-native` before screen-builders import `src/native/*`.- If a native capability is not shipped by the template, stop with a clear block; do not install native packages or fake support.+- If a screen requires a pure-JavaScript library, add it with an exact version to `## Screens → ### JavaScript Dependencies`, include it in the mutation preview, and install it before screen builders run. Determine JS-only status from shipped contents, not from a package-name prefix.- If the request changes navigation, update route layouts and navigation contracts before spawning screen-builders.- If the request adds a new screen, generate any needed route folder, generated-service snapshot, shared code, and skeleton before building TSX.- Do not stop after writing `native-app-plan.md`. The plan update is an internal checkpoint; the app mutation and verification are the user-visible result.@@ -283,6 +286,7 @@ Reuse the same planning primitives as `/create-mobile-app`, but only for the aff| Dataverse schema | `data-model-architect` + `/add-dataverse` Step 8 | New/changed tables, columns, lookups, calculated fields, generated services || Connector choice | `/add-datasource`, `/add-sharepoint`, `/add-connector` | New or changed external data/action surface || Native capability | `/add-native` Step 9 | New wrappers/controls needed by edited screens |+| JavaScript dependency | `screen-planner` + `shared/references/javascript-dependency-planning.md` | Explicit package requests or established JS libraries needed by edited screens || Design | `/design-system` Step 9b | Token refresh, reskin, density/component rules || Navigation | `/create-mobile-app` Step 10b | Changed tabs, stacks, route groups, modal/formSheet presentation || Service snapshot | `/create-mobile-app` Step 10.7 | Refresh after any data source/schema change before builders run |@@ -339,7 +343,7 @@ For connector/data-source edits, read and execute `/add-datasource` when the souShow the user a side-by-side diff (or before/after) for every changed plan section. Also show an app mutation preview:-- Edit brief: intent, target screens/routes, data/native/design dependencies, and assumptions+- Edit brief: intent, target screens/routes, data/native/JavaScript/design dependencies, and assumptions- Data/schema operations to run (`/add-dataverse --skip-planning`, connector add, native wrapper add)- Screen files to create, rewrite, rename, or delete- Navigation/layout files to update@@ -380,10 +384,11 @@ Apply sections in dependency order so screens always build against the current d1. **Data Model** — read and execute `/add-dataverse --skip-planning` with the approved Data Model section. It must create/extend Dataverse tables, refresh generated services/models, update `.datamodel-manifest.json`, and leave generated services compiling. After it returns, run `npm run generate-schemas` and `npx tsc --noEmit`; do not continue to screens until clean.2. **Sample Data** — if a new Dataverse table was created and any changed screen will show list/detail data from it, read and execute `/add-sample-data` for the project. If seeding fails, record a concern and continue only if the app handles empty states.3. **Connector/Data Source** — read and execute `/add-datasource` when ambiguous, or `/add-sharepoint` / `/add-connector` for approved connector changes. Regenerate services and record connection notes in `memory-bank.md`.-4. **Native Capabilities** — read and execute `/add-native <capability>` for every new capability. Do not install missing native packages or fake wrappers. If a capability is unsupported by the current template, stop before rebuilding screens that import it, record the block, and tell the user what upstream template support is missing.-5. **Design** — read and execute `/design-system --refresh <dimension>` or `/design-system --reskin` for design edits. Token-only changes usually do not require TSX rewrites; component/density/negative-rule changes may.+4. **Pure-JavaScript Dependencies** — execute the Installation Contract in [`shared/references/javascript-dependency-planning.md`](${CLAUDE_SKILL_DIR}/../../shared/references/javascript-dependency-planning.md) for new or changed rows in the approved `## Screens → ### JavaScript Dependencies` table. Approval is consent for those exact packages and versions. Install and validate before screen work; if final inspection finds native code/config or incompatible runtime dependencies, remove only the newly added package and stop with the exact failed criterion.+5. **Native Capabilities** — read and execute `/add-native <capability>` for every new capability. Do not install missing native packages or fake wrappers. If a capability is unsupported by the current template, stop before rebuilding screens that import it, record the block, and tell the user what upstream template support is missing.+6. **Design** — read and execute `/design-system --refresh <dimension>` or `/design-system --reskin` for design edits. Token-only changes usually do not require TSX rewrites; component/density/negative-rule changes may.-After any Data Model, Connector/Data Source, or Native Capabilities mutation, rerun the generated-service/native-wrapper probe before screen work. Screen prompts must reflect what exists on disk now, not what the earlier plan expected.+After any Data Model, Connector/Data Source, JavaScript Dependency, or Native Capabilities mutation, rerun the generated-service/dependency/native-wrapper probe before screen work. Screen prompts must reflect what exists on disk now, not what the earlier plan expected.#### Step 5.5 — Refresh generated service snapshotdiff --git a/plugins/mobile-apps/template/package.json b/plugins/mobile-apps/template/package.jsonindex dc2a8fe05..b73de4f8b 100644--- a/plugins/mobile-apps/template/package.json+++ b/plugins/mobile-apps/template/package.json@@ -72,7 +72,6 @@"react-dom": "19.2.0","react-hook-form": "7.54.0","react-native": "0.83.6",- "react-native-calendars": "1.1314.0","react-native-gesture-handler": "2.30.1","react-native-get-random-values": "^2.0.0","react-native-reanimated": "4.2.1",