$npx -y skills add microsoft/power-platform-skills --skill edit-appUse when the user wants to iterate on an existing generated Power Apps mobile app after /create-mobile-app: update the plan, data model, native capabilities, design, screens, generated app code, and preview without restarting the full project flow.
| 1 | **Shared instructions: [shared-instructions.md](../../shared/shared-instructions.md)** — read first. |
| 2 | |
| 3 | # Edit App (`/edit-app`) |
| 4 | |
| 5 | Post-generation editor for an existing mobile app. `native-app-plan.md` remains the source of truth, but the default outcome is a fixed generated app, not a plan-only diff. After the user approves the plan delta, continue into Dataverse/native/design/screen mutations, run verification, update `memory-bank.md`, and regenerate the static preview when UI changed. |
| 6 | |
| 7 | Use `--plan-only` only when the user explicitly asks to update planning docs without changing app code. Normal follow-up prompts in Copilot Chat Agent mode should apply the app change end to end. |
| 8 | |
| 9 | ## When to use |
| 10 | |
| 11 | - "Improve the search screen to make it easier to use on mobile" |
| 12 | - "Add loading, empty, and error states to the list screen" |
| 13 | - "Add a detail screen for the selected record" |
| 14 | - "Update the design to better match the company branding" |
| 15 | - "Add a form to create a new record in Dataverse" |
| 16 | - "Add barcode scanning and use the scanned value to search records" |
| 17 | - "Generate a new static preview of the updated app" |
| 18 | - "Add a `case` table to the data model" |
| 19 | - "Replace the Drawer navigation with Tabs" |
| 20 | - "Add `expo-camera` to the native capabilities" |
| 21 | - "Add signature capture to approvals and store it in Dataverse" |
| 22 | - "Generate an evidence PDF and retain it on the inspection record" |
| 23 | - "Add a View PDF action for an HTTPS report URL" |
| 24 | - "Reorder screens — move profile out of tabs, into a modal from the home header" |
| 25 | |
| 26 | ## When NOT to use |
| 27 | |
| 28 | - Brand-new project → `/create-mobile-app` |
| 29 | - Just adding one connector with no screen changes → `/add-connector` directly |
| 30 | - Just adding a single native wrapper with no screen changes → `/add-native` directly |
| 31 | - The plan file is missing → re-run `/create-mobile-app` (don't try to reconstruct) |
| 32 | |
| 33 | ## Workflow |
| 34 | |
| 35 | 0. Locate app + health/drift probe → 1. Discover intent + inspect existing app → 1.5 Impact preview → 2. Re-plan affected sections → 3. Gate intent, plan + mutation preview → 4. Write plan diff → 5. Apply app mutations → 6. Rebuild affected screens → 7. Verify + quality sweep → 8. Preview + memory-bank update + optional debug handoff |
| 36 | |
| 37 | --- |
| 38 | |
| 39 | ## Edit Quality Gate Policy — no quality compromise |
| 40 | |
| 41 | This is a focused edit workflow, not a lighter quality bar. Reuse `/create-mobile-app` gates at edit scale. |
| 42 | |
| 43 | **Required gates by edit type:** |
| 44 | |
| 45 | | Edit touches | Required gates | |
| 46 | |---|---| |
| 47 | | Any source file | Existing-app health gate, final `npx tsc --noEmit` | |
| 48 | | Dataverse/schema/connector | Environment drift gate, data-source/schema gate, Generated Services snapshot refresh, final `tsc` | |
| 49 | | Navigation/routes | Navigation/layout gate, route contract check, final `tsc` | |
| 50 | | New screen | Shared scaffold gate, skeleton gate, screen-builder wave gate, style-quality sweep, route check, final `tsc` | |
| 51 | | Existing screen TSX | Screen edit gate, style-quality sweep, route check when navigation changed, final `tsc` | |
| 52 | | Native capability | Native allowlist gate, wrapper existence gate, final `tsc` | |
| 53 | | Design/component/density | Design-system gate, affected-screen style sweep, final `tsc`, preview | |
| 54 | |
| 55 | **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`. |
| 56 | |
| 57 | **Hard stops:** |
| 58 | |
| 59 | - Do not run data-source mutations if the app root/environment cannot be identified. |
| 60 | - Do not launch screen-builders from broken generated services, route layouts, shared code, or skeletons. |
| 61 | - Do not import native wrappers in screens before `/add-native` has generated them. |
| 62 | - Do not hide unsupported native capabilities behind mocks or TODOs just to satisfy TypeScript. |
| 63 | - Do not mark an edit successful if changed screens fail TypeScript, route contracts, or required validators. |
| 64 | |
| 65 | ### Step 0 — Locate app + health/drift probe |
| 66 | |
| 67 | ```bash |
| 68 | test -f native-app-plan.md && echo "OK: plan found" || echo "ERROR: no plan" |
| 69 | test -f package.json && echo "OK: package found" || echo "ERROR: no package" |
| 70 | test -d app && echo "OK: app routes found" || echo "ERROR: no app routes" |
| 71 | test -f memory-bank.md && echo "OK: memory bank found" || echo "WARN: no memory bank" |
| 72 | git status --short |
| 73 | ``` |
| 74 | |
| 75 | If `native-app-plan.md` is missing → STOP. Tell the user this skill edits an existing generated app; they should re-run `/create-mobile-app` on a fresh template or manually recreate the plan before using this editor. |
| 76 | |
| 77 | Read if present: |
| 78 | |
| 79 | - `memory-bank.md` — project facts, target envi |