[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69BVG9GTKXHJHQA1VB4T34Q":3,"skill-same:01M69BVG9GTKXHJHQA1VB4T34Q":90},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":50,"linkOnly":51,"markdownContent":52,"markdownBody":53,"frontMatter":54,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M69BVG9GTKXHJHQA1VB4T34Q","create-app","React Vite 应用创建","Creates managed apps using React and Vite. Use when scaffolding a new app with `ms app create` and ending on local dev with `ms app dev`.","使用 React 和 Vite 创建托管应用。当需要用 `ms app create` 搭建新应用并以 `ms app dev` 进行本地开发结束时使用。","microsoft\u002Fmanaged-apps","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M69BTSR13CCGCPK40C03N7CN",36,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fcreate-app\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49],"create","create app","app","edit","managed","with","apps","local","scaffolding","ms","vite","use","local dev","write","read","grep","Bash","dev","react","2026-11-10 10:12:30",false,"---\nname: create-app\ndescription: Creates managed apps using React and Vite. Use when scaffolding a new app with `ms app create` and ending on local dev with `ms app dev`.\nallowed-tools: Read Edit Write Grep Glob Bash AskUserQuestion EnterPlanMode ExitPlanMode Skill\n---\n\n**? Shared Instructions: [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md)** — Cross-cutting concerns.\n\n**References:**\n\n- [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) — Node, git, CLI install, allowedPrompts.\n- [troubleshooting.md](.\u002Freferences\u002Ftroubleshooting.md) — First-run Git Credential Manager trap, common `ms app create` failures.\n\n# Create a Microsoft App\n\nThis skill scaffolds a new Microsoft App end-to-end using `@microsoft\u002Fmanaged-apps-cli` (binary `ms`). The default outcome is a **running local dev server**, not a deployed cloud app. Deploying is a separate, explicit user choice via `\u002Fdeploy`.\n\n## Workflow\n\n1. Memory Bank → 2. Prerequisites → 3. Infer App Spec → 4. Plan → 5. Auth → 6. Environment → 7. Scaffold → 8. Add Data Sources → 9. Add Backend (if requested) → 10. Implement App → 11. Local Dev → 12. Summary → 13. Memory Bank Update\n\n**Critical principle:** when this skill ends and the user opens the local URL, they must see a **functional app** — connectors wired when required, screens implemented from the approved plan — not a bare template. Adding required data sources and implementing the UI happen **inside this skill**, before `ms app dev` is started. Do not defer them to \"next steps.\"\n\n---\n\n### Step 1: Check Memory Bank\n\nCheck for `memory-bank.md` per [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md). If found, infer whether to resume or create a new app from the request: resume when it refers to the existing app or incomplete work; create a new sibling project when it clearly describes a different app. State the choice and continue. Ask only when the request genuinely fits both paths and choosing incorrectly could overwrite or modify existing work.\n\n### Step 2: Validate Prerequisites\n\nRun prerequisite checks **first** — no point gathering requirements if the environment isn't ready. Full details in [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md).\n\nThe commands below are shown in bash syntax. If you are running PowerShell on Windows, use the equivalents described in [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md#shell-compatibility) and the PowerShell example in [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) instead of copying the bash snippets literally.\n\n```bash\nnode --version                                                    # Must be v22+\ngit --version                                                     # Required (used by `ms app create` to init the repo)\nms --version 2>\u002Fdev\u002Fnull  # Probe the bin name\n```\n\n- **Missing Node.js or below v22**: Report \"Node.js 22+ is required. Install from https:\u002F\u002Fnodejs.org\u002F or switch with `nvm use 22`.\" STOP.\n- **Missing Git**: Report \"Git is required — `ms app create` initializes a repo. Install from https:\u002F\u002Fgit-scm.com\u002F.\" STOP.\n- **Missing `ms`**: proceed to the global install block below. Confirm with the user before running `npm install -g`.\n- **One of them resolves**: record which binary name resolved (`$BIN`); use it in every subsequent step.\n\n#### Global install of `@microsoft\u002Fmanaged-apps-cli` (only if `ms` is missing)\n\nInstall the CLI **globally** from the public npm registry so the `ms` binary is on PATH.\n\nAsk the user: _\"This will install `@microsoft\u002Fmanaged-apps-cli@latest` globally on your machine. OK to proceed?\"_ Wait for explicit yes.\n\nThen run:\n\n```bash\n# Install globally, pinned to the @latest stable tag.\nnpm install -g @microsoft\u002Fmanaged-apps-cli@latest\n\n# Re-probe the bin name.\nms --version\n```\n\nRecord the resolved bin name as `$BIN`.\n\n#### `@latest` refresh check\n\nIf `ms` was already installed, run the CLI freshness gate in [development-standards.md](..\u002F..\u002Fshared\u002Fdevelopment-standards.md#cli-freshness-gate) now. When npm `@latest` is newer, pause app creation and ask whether to update before proceeding. Never auto-update.\n\n### Step 3: Infer App Spec\n\n**Default to action, not an interview. Ask only when progress is impossible without information that cannot be discovered or safely inferred.**\n\nIf the user has not described what they want to build (i.e., `\u002Fcreate-app` was invoked with no arguments or a vague prompt), start with a single open-ended question:\n\n> \"What would you like to build? Describe it in your own words — what it does, who uses it, and what problem it solves.\"\n\nWait for their answer. Do NOT present a multiple-choice list of app types. Once the app idea is known, infer the rest:\n\n1. **Generate the display name.** If the user already gave a name, use it verbatim. Otherwise derive a short title from the user's prompt (usually 2-5 title-cased words) and use it with `--display-name`. Either way, do not ask the user to name or confirm it. Derive the folder slug from this title.\n2. **Plan the complete requested experience.** Include every capability the user clearly describes. Infer the screens, navigation, interactions, and visual styling needed to make those capabilities usable; use a single responsive screen only when it can support the full request cleanly. Do not ask separate questions about layout, theme, or architecture. Present these decisions in the plan for approval.\n3. **Infer data needs from user intent.** Add built-in app state or the appropriate connector whenever the requested experience clearly depends on user, organizational, shared, persistent, or external data, even if the user does not mention a data source. Use `\u002Fstate` for the app's own typed persisted records when `ms feature status --name state` reports enabled. Use connectors for external systems, tenant data, shared business data, or when the state feature is disabled. Use local sample data only when the experience is genuinely self-contained or the data intent is unclear. Ask one focused question only when choosing incorrectly would materially change the app.\n4. **Discover before asking.** When a connector is needed, infer its api-id and mode from the connector decision guide, and let the CLI discover or create connections where supported. When built-in app state is appropriate, invoke `\u002Fstate` for the detailed schema\u002Fcodegen workflow rather than duplicating it here. Ask one focused question only if a required tenant-specific identifier cannot be discovered (for example, which of several matching SharePoint lists to use) or if the state-vs-connector choice materially changes the app.\n5. **Consolidate assumptions into the plan.** Include the generated name, requested capabilities, inferred UI, and any state schema or connector choice in one complete plan. Do not ask separate questions to confirm each assumption.\n\n**Explicit app backend request:** if the user requests an app backend database\n(including `\u002Fadd-backend` or Rayfin), follow the\n[Rayfin feature gate](..\u002F..\u002Fshared\u002Fshared-instructions.md#rayfin-feature-gate)\nand plan `\u002Fadd-backend` for that requirement instead of substituting state or a\nconnector. Keep the state\u002Fconnector selection above for other data needs.\n\n### Step 4: Plan\n\n1. Enter plan mode with `EnterPlanMode`.\n2. Design the **complete** implementation approach the user will approve in one shot:\n   - Display name (let the CLI resolve the environment automatically; only pass `--environment-id` if the user explicitly provided one).\n   - **Each state collection or data source to be added** (which `\u002Fstate` or `\u002Fadd-*` (but not `\u002Fadd-backend`) skill, schema collections\u002Fproperties, api-id, table\u002Flist\u002Fconnection identifiers). These are invoked by Step 8 of this skill — list them as concrete steps, not as \"next steps.\"\n   - **App backend, when explicitly requested**: `\u002Fadd-backend`, the entities and typed client to implement in Step 9, and UI integration in Step 10. Distinguish preparing backend code from provisioning and verifying persistence.\n   - **App architecture**: components, pages, routing, state management — enough detail that Step 10 can generate the code without re-asking.\n   - Build\u002Fverify steps and the final `ms app dev` hand-off.\n3. Present the complete inferred plan. Include `allowedPrompts` from [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) when the host requires them.\n4. Once the plan is approved, implement it. Additional questions are allowed only when a required value cannot be inferred or discovered, or when mandated by the safety guardrails (for example, global installation or account switching).\n\n### Step 5: Auth\n\n```bash\n$BIN auth status\n```\n\n- **Active UPN is correct**: proceed.\n- **Wrong UPN**: ask the user whether to keep it or switch. To switch:\n  ```bash\n  $BIN auth login   # interactive browser flow\n  ```\n- **Not signed in**: run `$BIN auth login` (interactive).\n\nTreat `auth status` output as the source of truth on every invocation — never assume a cached session is the right account.\n\n### Step 6: Environment\n\nBy default, run `ms app create` with **no** environment flags and let the CLI resolve everything automatically. Do not surface the environment concept to the user.\n\nThe only exception: **if the user explicitly provides an environment ID, pass it through** as `ms app create --environment-id \u003Cenv-id>`. Never discover, infer, or construct an environment ID yourself — if the user hasn't given you one, don't pass the flag.\n\nIf environment routing fails, surface the actual error to the user rather than attempting an environment workaround (see [troubleshooting.md](.\u002Freferences\u002Ftroubleshooting.md)).\n\n### Step 7: Scaffold\n\n**If the user explicitly provided a folder name, use it verbatim** — do not generate one, and skip the inference below. Create it as a child of the current directory, unless the current directory is already named that (then set `FOLDER_NAME=\".\"`). If they gave a full path, use that path as-is. Only fall back to a numbered variant if the target already exists, and say so.\n\nOtherwise, derive a folder slug from the display name (lowercase, hyphens, no spaces — e.g. \"Sample One\" → `sample-one`), then inspect the **current working directory**, including hidden entries, and pick the target:\n\n- **Directory is empty:** set `FOLDER_NAME=\".\"` and scaffold directly into it. Do not ask for a path or app name.\n- **Current directory is a Microsoft App root** (it contains `ms.config.json`): never scaffold inside it — that would nest an app and a Git repository inside another one. Create the new app as a **sibling**, so `FOLDER_NAME` is the slug under the parent directory (e.g. `..\u002Fsample-one`).\n- **Any other non-empty directory:** use the slug as a child folder.\n\nIn both non-empty cases, if the chosen path already exists, select the first available numbered variant (`sample-one-2`, `sample-one-3`, etc.); never overwrite an existing directory. State the chosen location and continue immediately without asking for confirmation, e.g. _\"Found current folder is not empty. I'll create the app in: `\u003CFOLDER_NAME>`.\"_ — or, for the sibling case, _\"This folder is an existing Microsoft App, so I'll create the new app alongside it in: `\u003CFOLDER_NAME>`.\"_\n\n```bash\n$BIN app create \"$FOLDER_NAME\" \\\n  --display-name \"$DISPLAY_NAME\" \\\n  --non-interactive\n# Append --environment-id \"$ENV_ID\" ONLY if the user explicitly provided an environment ID (see Step 6).\n```\n\nAfter the command succeeds, enter the target directory unless it is `.`, then set `PROJECT_ROOT`:\n\n```bash\n[ \"$FOLDER_NAME\" = \".\" ] || cd \"$FOLDER_NAME\"\nPROJECT_ROOT=\"$(pwd)\"\n```\n\nNow that `PROJECT_ROOT` exists, write the approved plan to `$PROJECT_ROOT\u002Fapp_generated_plan.md` per [planning-policy.md](..\u002F..\u002Fshared\u002Fplanning-policy.md) — before any implementation, so it is committed with the rest of the generated app.\n\nCapture from the output: the app GUID, the environment ID\u002Fname resolved by the CLI, and the remote git URL. (The environment ID appears in the App Player URL and is needed for that link — it's an internal detail, not something to surface to the user.)\n\n#### First-run Git Credential Manager recovery\n\nOn the **first ever** `ms app create` for a fresh account (or after the GCM cache expires for the relevant remote), the local-setup step fails with:\n\n```\nfatal: Authentication failed for 'https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002Fappframework\u002Fgit\u002Frepositories\u002F\u003Crepo-guid>\u002F'\nCould not commit and push the initial scaffold. Your app and local scaffold are ready.\n```\n\nThe CLI installed a `[credential ...]` block in `.git\u002Fconfig`, but GCM still needs an interactive browser flow once. The app and scaffold are already created; do **not** delete the app or rerun `ms app create`.\n\n**Recovery sequence** (the app exists in the service but is empty locally):\n\n```bash\ncd \"$PROJECT_ROOT\"\ngit fetch origin # browser opens; approve.\n```\n\nDetect this by matching `Could not commit and push the initial scaffold` together with `Authentication failed for 'https:\u002F\u002F...d.environment.api...'`, or `push.success: false` in `--json` output. Surface `git fetch origin` and continue with the existing app after it succeeds.\n\n### Step 8: Add State and Data Sources\n\nFor every built-in state collection or connector identified in Step 3 \u002F Step 4, invoke the matching skill **now**, in this session, before any UI code is generated:\n\n- `\u002Fstate` when the app needs its own typed persisted records and `ms feature status --name state` reports enabled. If `\u002Fstate` reports that the feature is disabled, update the plan to use an appropriate connector alternative instead.\n- A specific `\u002Fadd-*` (but not `\u002Fadd-backend`) skill when one exists (`\u002Fadd-dataverse`, `\u002Fadd-sharepoint`, `\u002Fadd-excel`, `\u002Fadd-office365`, `\u002Fadd-office365-users`, `\u002Fadd-teams`, `\u002Fadd-onedrive`, `\u002Fadd-azuredevops`, `\u002Fadd-mcscopilot`, `\u002Fadd-workiq`).\n- `\u002Fadd-data-source` (with api-id) for anything else.\n\nFor Work IQ knowledge\u002Fsearch scenarios, prefer `\u002Fadd-workiq` (maps to `shared_a365copilotchatmcp`) over generic `\u002Fadd-data-source`.\n\nRun them sequentially. After each one:\n\n- Confirm the typed services were generated: `\u002Fstate` writes `generated-typescript\u002F` beside the configured state schema; `\u002Fadd-*` (but not `\u002Fadd-backend`) skills generate under `generated\u002F` at the project root.\n- **For implementation guidance**, refer to the specialized skill's documentation:\n  - `\u002Fstate` → Prefer generated state services, validators, and query helpers when codegen covers the scenario\n  - `\u002Fadd-office365` → See \"Office 365 Connector: Method Selection Guide\" for correct import paths, calendar discovery, and API patterns\n  - `\u002Fadd-office365-users` → See \"Office 365 Users: Method Selection Guide\" for profile, reporting relationship, and CSP-safe profile photo patterns\n  - `\u002Fadd-workiq` → See \"Work IQ Integration: MCP Session Pattern\" for session management and response parsing\n  - Other `\u002Fadd-*` (but not `\u002Fadd-backend`) skills have similar guidance\n- Capture the generated service path, and the connection ID when applicable, so Step 10 can import them.\n- **If the sub-skill reports a shared connection** (`sharedConnectionId` in `ms.config.json`), it will defer the `allowedActions` policy rather than prompting — there's no app code to infer from yet. Record it as *shared, policy pending*. After implementation, resolve it before any pack or deploy. This does not block `ms app dev`; carry any pending policy into Step 12's summary. See [allowed-actions.md](..\u002F..\u002Fshared\u002Fallowed-actions.md).\n\n**Forward all captured context to each sub-skill so its own prompts are suppressed.** The `\u002Fstate` skill needs the approved collections\u002Fproperties and the CLI freshness gate outcome. The per-service skills (`\u002Fadd-dataverse`, `\u002Fadd-sharepoint`, etc.) and `\u002Fadd-connector` each have their own prompt sequences (pick connection, pick table\u002Flist\u002Fsite, choose api-id, CLI freshness, etc.). The approved plan and discovery results should contain those answers, so pass them through as `$ARGUMENTS` (or whatever invocation surface is available) when dispatching: state collections\u002Fproperties, api-id, connection ID or name, table\u002Flist\u002Fsite identifiers, environment URL, project root, and the CLI freshness gate outcome plus known versions. A sub-skill receiving the CLI freshness outcome must not check or prompt again. If a sub-skill still needs a required input that cannot be discovered or safely inferred, ask the user one focused question and record the answer as an amendment to the approved plan rather than letting multiple sub-skills ask interactively.\n\nThe intent of this step is no per-connector approval prompts: the approved plan from Step 4 covers them. If a sub-skill fails (auth, missing connection, wrong api-id), surface the error verbatim and stop; do not silently proceed with a half-wired app.\n\nIf Step 3 \u002F Step 4 identified zero state collections or data sources, skip this step. Otherwise, this step must complete before Step 9 starts.\n\n### Step 9: Add Backend (if requested)\n\nSkip this step unless an app backend database was explicitly requested in\nStep 3 \u002F Step 4. Otherwise, invoke `\u002Fadd-backend` in this session for scaffolding,\ndependencies and its [data modeling reference](..\u002Fadd-backend\u002Freferences\u002Frayfin-data-modeling.md).\nForward the approved entities and the feature-check result with its CLI execution\ncontext so the shared reuse policy applies.\n\nVerify the authored entities and the [host-backed client helper](..\u002Fadd-backend\u002Freferences\u002Frayfin-data-modeling.md#step-4-initialize-through-managed-apps)\nexist, and capture their paths for Step 10. Defer UI work to Step 10 and checks to\nStep 11; do not deploy during setup.\n\nFor Rayfin, completion here means scaffolding, dependency installation and\nentity\u002Fclient implementation, not provisioning. An unprovisioned backend does\nnot block Step 10; do not ask for an existing database or connection settings.\nFollow the backend skill's lifecycle guidance.\n\n### Step 10: Implement the App\n\nGenerate the code that delivers the experience described in the approved plan:\n\n- Components, pages, routing, state management.\n- Wire each component to the typed services produced in Step 8. For connectors, avoid raw `fetch` \u002F `axios` \u002F Graph calls and use generated connector services. For `\u002Fstate`, prefer generated state services when codegen covers the scenario while allowing deliberate direct state requests when they are the better fit.\n- For Rayfin, use the client from Step 9 and follow the backend skill's [CRUD UI reference](..\u002Fadd-backend\u002Freferences\u002Frayfin-crud-ui.md).\n- Apply the inferred theme and UI decisions documented in the approved plan.\n- Replace template placeholder content; the user must see *their* app at the local URL, not \"Hello World.\"\n\nWhen the implementation is complete, the next step's `npm run build` is the gate that proves everything compiles end-to-end.\n\n### Step 11: Build and start local dev\n\n```bash\nnpm install            # safe to re-run; idempotent.\nnpm run build          # verifies the scaffolded + connector + custom code all compile.\n$BIN app dev           # starts the dev server (default port 8080) + config server.\n```\n\nIf `npm run build` fails, fix the errors before running `ms app dev`. Don't hand the user a URL that points at a broken build.\n\nFor Rayfin, follow the backend skill's\n[UI\u002Fpersistence checks](..\u002Fadd-backend\u002Freferences\u002Frayfin-crud-ui.md#checklist).\nAttempt host-backed initialization in the App Player before reporting backend\navailability, following the backend skill's guidance. Report actual errors rather\nthan inferring backend absence from missing local configuration.\nDo not deploy just to complete these checks.\n\n`ms app dev` runs two servers and prints an App Player URL like:\n\n```\nReady. You can play your app locally at: https:\u002F\u002Fplay.\u003Ccloud-domain>\u002Fapps\u002Fdev?ms_appUrl=http%3A%2F%2Flocalhost%3A5173%2F&ms_appConfigUrl=http%3A%2F%2Flocalhost%3A\u003Cport>\n```\n\nThe domain varies by cloud\u002Fregion (e.g. `play.preview.managedapps.cloud.microsoft.com`, `play.managedapps.cloud.microsoft.com`, or a sovereign-cloud equivalent). **Always use the exact URL the CLI prints** — do not hardcode or rewrite the host.\n\nHand that URL to the user **as a markdown link** (`[Open app in browser](\u003Curl>)`) **and also print the raw URL on its own line** — markdown links can render as plain label text in some environments (e.g. tables), hiding the actual URL. **Then open the browser automatically** using `Start-Process` (Windows) or `open` (macOS) \u002F `xdg-open` (Linux). **Nothing has been deployed to the cloud at this point** — the app exists in the service catalog but its runtime is local, with the connectors and UI you just built wired up.\n\nThe dev server runs in the foreground. Either:\n- Keep it running and tell the user how to stop it (Ctrl+C) and restart (`ms app dev`).\n- Or, if the user wants to continue iterating in the same Claude\u002FCopilot session, run `ms app dev` in the background (`run_in_background: true`) and monitor for the App Player URL line.\n\n### Step 12: Summary\n\nProvide:\n\n- **App**: display name, app GUID.\n- **Project path**: `$PROJECT_ROOT`.\n- **Git remote URL** (label it \"Git Remote\", not just \"Remote\" — users confuse \"Remote\" with a browser-openable link).\n- **Connectors wired up**: list each one added in Step 8 + which screens use it.\n- **App Player URL** (local dev) as a markdown link **and** the raw URL on its own line — markdown links can render as plain label text in some environments, hiding the actual URL.\n- **Open the browser automatically** after printing the URL — don't wait for the user to copy-paste it.\n- **What this URL is**: a live preview of the running app. Edits made in this chat will hot-reload there in real time — the user does **not** need to restart anything to see changes.\n- **Next steps** (in this exact framing):\n  1. Tell me what to change — I'll edit the code and you'll see it update live in the browser.\n  2. When you're happy with how it looks and behaves, say so. I'll commit + push your changes, run `ms app play --mode preview` to give you a cloud preview URL hosted in your environment, and *then* ask if you want me to `\u002Fdeploy` to the live URL.\n- **Important**: explicitly note that **nothing has been deployed to the cloud yet** — current state is local dev only.\n- **App backend, if requested**: report what was implemented and verified, with actual errors or unrun checks. Do not infer provisioning state from missing local configuration. A local UI preview does not verify database persistence.\n\nWhen the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md) — commit, push, `ms app play --mode preview`, hand off the preview URL, then ask about `\u002Fdeploy`. Do not skip the preview gate.\n\nDo **not** list `\u002Fadd-*` (but not `\u002Fadd-backend`) skills as next steps here; data sources were already wired in Step 8. Do not list `\u002Fadd-backend` as a next step either when it was requested; its code was prepared in Step 9. (If the user later wants an additional connector, they can ask and you'll invoke the right `\u002Fadd-*` (but not `\u002Fadd-backend`) mid-iteration.)\n\n### Step 13: Update Memory Bank\n\nWrite `memory-bank.md` at `$PROJECT_ROOT\u002Fmemory-bank.md` per [memory-bank.md](..\u002F..\u002Fshared\u002Fmemory-bank.md) template. Record the environment ID the CLI resolved for reference (e.g. to reconstruct the App Player URL) — do not use it to re-target a future `ms app create`, and do not surface it to the user.\n\n---\n\n## Example Walkthrough\n\n**User request:**\n\n> \"Build me a hello-world Microsoft App called Sample One.\"\n\n**Commands run (in order, against an account with `ms` already installed and authenticated to the production cluster):**\n\n```bash\n# Step 2: Prerequisites\nnode --version                       # → v22.4.0\ngit --version                        # → 2.45.0\nms --version                         # → 0.3.x\n\n# Step 5: Auth\nms auth status                       # → signed in as alice@contoso.onmicrosoft.com\n\n# Step 7: Scaffold (run from any directory; CLI creates the subfolder)\npwd                                 # → \u002FUsers\u002Falice\u002Fwork\nms app create sample-one \\\n  --display-name \"Sample One\" \\\n  --non-interactive\n# → App created. AppId: 7ea6...\n# → Environment: Default-\u003Cguid> (auto-routed)\n# → Remote: https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002F...\ncd sample-one\n\n# Step 8: Add Data Sources (none in this hello-world example — skipped)\n\n# Step 9: Add Backend (not requested in this hello-world example — skipped)\n\n# Step 10: Implement App (template-only for hello-world; nothing to wire)\n\n# Step 11: Build and start local dev\nnpm install\nnpm run build\nms app dev\n# → Ready. Play locally at: https:\u002F\u002Fplay.\u003Ccloud-domain>\u002Fapps\u002Fdev?ms_appUrl=...\n```\n\n**Final summary (verbatim format):**\n\n```\nSample One is running locally.\n\nApp: Sample One\nApp GUID: 7ea6...\nEnvironment: Default-\u003Cguid> (auto-routed Developer environment)\nCluster: prod\nProject: \u002FUsers\u002Falice\u002Fwork\u002Fsample-one\nGit Remote: https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002F...\nLocal URL: [Open app in browser](\u003CURL from ms app dev output>)\n           \u003CURL from ms app dev output>\n\nNothing has been deployed to the cloud. The app (with its connectors and UI\nalready wired up) runs from your machine via `ms app dev`. The browser tab\nhot-reloads as I make code changes — just tell me what to adjust.\n\nWhen you're happy with it, tell me. I'll commit + push your changes, run\n`ms app play --mode preview` to give you a cloud preview URL in your\nenvironment, and then ask if you want me to \u002Fdeploy.\n```\n","**? Shared Instructions: [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md)** — Cross-cutting concerns.\n\n**References:**\n\n- [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) — Node, git, CLI install, allowedPrompts.\n- [troubleshooting.md](.\u002Freferences\u002Ftroubleshooting.md) — First-run Git Credential Manager trap, common `ms app create` failures.\n\n# Create a Microsoft App\n\nThis skill scaffolds a new Microsoft App end-to-end using `@microsoft\u002Fmanaged-apps-cli` (binary `ms`). The default outcome is a **running local dev server**, not a deployed cloud app. Deploying is a separate, explicit user choice via `\u002Fdeploy`.\n\n## Workflow\n\n1. Memory Bank → 2. Prerequisites → 3. Infer App Spec → 4. Plan → 5. Auth → 6. Environment → 7. Scaffold → 8. Add Data Sources → 9. Add Backend (if requested) → 10. Implement App → 11. Local Dev → 12. Summary → 13. Memory Bank Update\n\n**Critical principle:** when this skill ends and the user opens the local URL, they must see a **functional app** — connectors wired when required, screens implemented from the approved plan — not a bare template. Adding required data sources and implementing the UI happen **inside this skill**, before `ms app dev` is started. Do not defer them to \"next steps.\"\n\n---\n\n### Step 1: Check Memory Bank\n\nCheck for `memory-bank.md` per [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md). If found, infer whether to resume or create a new app from the request: resume when it refers to the existing app or incomplete work; create a new sibling project when it clearly describes a different app. State the choice and continue. Ask only when the request genuinely fits both paths and choosing incorrectly could overwrite or modify existing work.\n\n### Step 2: Validate Prerequisites\n\nRun prerequisite checks **first** — no point gathering requirements if the environment isn't ready. Full details in [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md).\n\nThe commands below are shown in bash syntax. If you are running PowerShell on Windows, use the equivalents described in [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md#shell-compatibility) and the PowerShell example in [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) instead of copying the bash snippets literally.\n\n```bash\nnode --version                                                    # Must be v22+\ngit --version                                                     # Required (used by `ms app create` to init the repo)\nms --version 2>\u002Fdev\u002Fnull  # Probe the bin name\n```\n\n- **Missing Node.js or below v22**: Report \"Node.js 22+ is required. Install from https:\u002F\u002Fnodejs.org\u002F or switch with `nvm use 22`.\" STOP.\n- **Missing Git**: Report \"Git is required — `ms app create` initializes a repo. Install from https:\u002F\u002Fgit-scm.com\u002F.\" STOP.\n- **Missing `ms`**: proceed to the global install block below. Confirm with the user before running `npm install -g`.\n- **One of them resolves**: record which binary name resolved (`$BIN`); use it in every subsequent step.\n\n#### Global install of `@microsoft\u002Fmanaged-apps-cli` (only if `ms` is missing)\n\nInstall the CLI **globally** from the public npm registry so the `ms` binary is on PATH.\n\nAsk the user: _\"This will install `@microsoft\u002Fmanaged-apps-cli@latest` globally on your machine. OK to proceed?\"_ Wait for explicit yes.\n\nThen run:\n\n```bash\n# Install globally, pinned to the @latest stable tag.\nnpm install -g @microsoft\u002Fmanaged-apps-cli@latest\n\n# Re-probe the bin name.\nms --version\n```\n\nRecord the resolved bin name as `$BIN`.\n\n#### `@latest` refresh check\n\nIf `ms` was already installed, run the CLI freshness gate in [development-standards.md](..\u002F..\u002Fshared\u002Fdevelopment-standards.md#cli-freshness-gate) now. When npm `@latest` is newer, pause app creation and ask whether to update before proceeding. Never auto-update.\n\n### Step 3: Infer App Spec\n\n**Default to action, not an interview. Ask only when progress is impossible without information that cannot be discovered or safely inferred.**\n\nIf the user has not described what they want to build (i.e., `\u002Fcreate-app` was invoked with no arguments or a vague prompt), start with a single open-ended question:\n\n> \"What would you like to build? Describe it in your own words — what it does, who uses it, and what problem it solves.\"\n\nWait for their answer. Do NOT present a multiple-choice list of app types. Once the app idea is known, infer the rest:\n\n1. **Generate the display name.** If the user already gave a name, use it verbatim. Otherwise derive a short title from the user's prompt (usually 2-5 title-cased words) and use it with `--display-name`. Either way, do not ask the user to name or confirm it. Derive the folder slug from this title.\n2. **Plan the complete requested experience.** Include every capability the user clearly describes. Infer the screens, navigation, interactions, and visual styling needed to make those capabilities usable; use a single responsive screen only when it can support the full request cleanly. Do not ask separate questions about layout, theme, or architecture. Present these decisions in the plan for approval.\n3. **Infer data needs from user intent.** Add built-in app state or the appropriate connector whenever the requested experience clearly depends on user, organizational, shared, persistent, or external data, even if the user does not mention a data source. Use `\u002Fstate` for the app's own typed persisted records when `ms feature status --name state` reports enabled. Use connectors for external systems, tenant data, shared business data, or when the state feature is disabled. Use local sample data only when the experience is genuinely self-contained or the data intent is unclear. Ask one focused question only when choosing incorrectly would materially change the app.\n4. **Discover before asking.** When a connector is needed, infer its api-id and mode from the connector decision guide, and let the CLI discover or create connections where supported. When built-in app state is appropriate, invoke `\u002Fstate` for the detailed schema\u002Fcodegen workflow rather than duplicating it here. Ask one focused question only if a required tenant-specific identifier cannot be discovered (for example, which of several matching SharePoint lists to use) or if the state-vs-connector choice materially changes the app.\n5. **Consolidate assumptions into the plan.** Include the generated name, requested capabilities, inferred UI, and any state schema or connector choice in one complete plan. Do not ask separate questions to confirm each assumption.\n\n**Explicit app backend request:** if the user requests an app backend database\n(including `\u002Fadd-backend` or Rayfin), follow the\n[Rayfin feature gate](..\u002F..\u002Fshared\u002Fshared-instructions.md#rayfin-feature-gate)\nand plan `\u002Fadd-backend` for that requirement instead of substituting state or a\nconnector. Keep the state\u002Fconnector selection above for other data needs.\n\n### Step 4: Plan\n\n1. Enter plan mode with `EnterPlanMode`.\n2. Design the **complete** implementation approach the user will approve in one shot:\n   - Display name (let the CLI resolve the environment automatically; only pass `--environment-id` if the user explicitly provided one).\n   - **Each state collection or data source to be added** (which `\u002Fstate` or `\u002Fadd-*` (but not `\u002Fadd-backend`) skill, schema collections\u002Fproperties, api-id, table\u002Flist\u002Fconnection identifiers). These are invoked by Step 8 of this skill — list them as concrete steps, not as \"next steps.\"\n   - **App backend, when explicitly requested**: `\u002Fadd-backend`, the entities and typed client to implement in Step 9, and UI integration in Step 10. Distinguish preparing backend code from provisioning and verifying persistence.\n   - **App architecture**: components, pages, routing, state management — enough detail that Step 10 can generate the code without re-asking.\n   - Build\u002Fverify steps and the final `ms app dev` hand-off.\n3. Present the complete inferred plan. Include `allowedPrompts` from [prerequisites-reference.md](.\u002Freferences\u002Fprerequisites-reference.md) when the host requires them.\n4. Once the plan is approved, implement it. Additional questions are allowed only when a required value cannot be inferred or discovered, or when mandated by the safety guardrails (for example, global installation or account switching).\n\n### Step 5: Auth\n\n```bash\n$BIN auth status\n```\n\n- **Active UPN is correct**: proceed.\n- **Wrong UPN**: ask the user whether to keep it or switch. To switch:\n  ```bash\n  $BIN auth login   # interactive browser flow\n  ```\n- **Not signed in**: run `$BIN auth login` (interactive).\n\nTreat `auth status` output as the source of truth on every invocation — never assume a cached session is the right account.\n\n### Step 6: Environment\n\nBy default, run `ms app create` with **no** environment flags and let the CLI resolve everything automatically. Do not surface the environment concept to the user.\n\nThe only exception: **if the user explicitly provides an environment ID, pass it through** as `ms app create --environment-id \u003Cenv-id>`. Never discover, infer, or construct an environment ID yourself — if the user hasn't given you one, don't pass the flag.\n\nIf environment routing fails, surface the actual error to the user rather than attempting an environment workaround (see [troubleshooting.md](.\u002Freferences\u002Ftroubleshooting.md)).\n\n### Step 7: Scaffold\n\n**If the user explicitly provided a folder name, use it verbatim** — do not generate one, and skip the inference below. Create it as a child of the current directory, unless the current directory is already named that (then set `FOLDER_NAME=\".\"`). If they gave a full path, use that path as-is. Only fall back to a numbered variant if the target already exists, and say so.\n\nOtherwise, derive a folder slug from the display name (lowercase, hyphens, no spaces — e.g. \"Sample One\" → `sample-one`), then inspect the **current working directory**, including hidden entries, and pick the target:\n\n- **Directory is empty:** set `FOLDER_NAME=\".\"` and scaffold directly into it. Do not ask for a path or app name.\n- **Current directory is a Microsoft App root** (it contains `ms.config.json`): never scaffold inside it — that would nest an app and a Git repository inside another one. Create the new app as a **sibling**, so `FOLDER_NAME` is the slug under the parent directory (e.g. `..\u002Fsample-one`).\n- **Any other non-empty directory:** use the slug as a child folder.\n\nIn both non-empty cases, if the chosen path already exists, select the first available numbered variant (`sample-one-2`, `sample-one-3`, etc.); never overwrite an existing directory. State the chosen location and continue immediately without asking for confirmation, e.g. _\"Found current folder is not empty. I'll create the app in: `\u003CFOLDER_NAME>`.\"_ — or, for the sibling case, _\"This folder is an existing Microsoft App, so I'll create the new app alongside it in: `\u003CFOLDER_NAME>`.\"_\n\n```bash\n$BIN app create \"$FOLDER_NAME\" \\\n  --display-name \"$DISPLAY_NAME\" \\\n  --non-interactive\n# Append --environment-id \"$ENV_ID\" ONLY if the user explicitly provided an environment ID (see Step 6).\n```\n\nAfter the command succeeds, enter the target directory unless it is `.`, then set `PROJECT_ROOT`:\n\n```bash\n[ \"$FOLDER_NAME\" = \".\" ] || cd \"$FOLDER_NAME\"\nPROJECT_ROOT=\"$(pwd)\"\n```\n\nNow that `PROJECT_ROOT` exists, write the approved plan to `$PROJECT_ROOT\u002Fapp_generated_plan.md` per [planning-policy.md](..\u002F..\u002Fshared\u002Fplanning-policy.md) — before any implementation, so it is committed with the rest of the generated app.\n\nCapture from the output: the app GUID, the environment ID\u002Fname resolved by the CLI, and the remote git URL. (The environment ID appears in the App Player URL and is needed for that link — it's an internal detail, not something to surface to the user.)\n\n#### First-run Git Credential Manager recovery\n\nOn the **first ever** `ms app create` for a fresh account (or after the GCM cache expires for the relevant remote), the local-setup step fails with:\n\n```\nfatal: Authentication failed for 'https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002Fappframework\u002Fgit\u002Frepositories\u002F\u003Crepo-guid>\u002F'\nCould not commit and push the initial scaffold. Your app and local scaffold are ready.\n```\n\nThe CLI installed a `[credential ...]` block in `.git\u002Fconfig`, but GCM still needs an interactive browser flow once. The app and scaffold are already created; do **not** delete the app or rerun `ms app create`.\n\n**Recovery sequence** (the app exists in the service but is empty locally):\n\n```bash\ncd \"$PROJECT_ROOT\"\ngit fetch origin # browser opens; approve.\n```\n\nDetect this by matching `Could not commit and push the initial scaffold` together with `Authentication failed for 'https:\u002F\u002F...d.environment.api...'`, or `push.success: false` in `--json` output. Surface `git fetch origin` and continue with the existing app after it succeeds.\n\n### Step 8: Add State and Data Sources\n\nFor every built-in state collection or connector identified in Step 3 \u002F Step 4, invoke the matching skill **now**, in this session, before any UI code is generated:\n\n- `\u002Fstate` when the app needs its own typed persisted records and `ms feature status --name state` reports enabled. If `\u002Fstate` reports that the feature is disabled, update the plan to use an appropriate connector alternative instead.\n- A specific `\u002Fadd-*` (but not `\u002Fadd-backend`) skill when one exists (`\u002Fadd-dataverse`, `\u002Fadd-sharepoint`, `\u002Fadd-excel`, `\u002Fadd-office365`, `\u002Fadd-office365-users`, `\u002Fadd-teams`, `\u002Fadd-onedrive`, `\u002Fadd-azuredevops`, `\u002Fadd-mcscopilot`, `\u002Fadd-workiq`).\n- `\u002Fadd-data-source` (with api-id) for anything else.\n\nFor Work IQ knowledge\u002Fsearch scenarios, prefer `\u002Fadd-workiq` (maps to `shared_a365copilotchatmcp`) over generic `\u002Fadd-data-source`.\n\nRun them sequentially. After each one:\n\n- Confirm the typed services were generated: `\u002Fstate` writes `generated-typescript\u002F` beside the configured state schema; `\u002Fadd-*` (but not `\u002Fadd-backend`) skills generate under `generated\u002F` at the project root.\n- **For implementation guidance**, refer to the specialized skill's documentation:\n  - `\u002Fstate` → Prefer generated state services, validators, and query helpers when codegen covers the scenario\n  - `\u002Fadd-office365` → See \"Office 365 Connector: Method Selection Guide\" for correct import paths, calendar discovery, and API patterns\n  - `\u002Fadd-office365-users` → See \"Office 365 Users: Method Selection Guide\" for profile, reporting relationship, and CSP-safe profile photo patterns\n  - `\u002Fadd-workiq` → See \"Work IQ Integration: MCP Session Pattern\" for session management and response parsing\n  - Other `\u002Fadd-*` (but not `\u002Fadd-backend`) skills have similar guidance\n- Capture the generated service path, and the connection ID when applicable, so Step 10 can import them.\n- **If the sub-skill reports a shared connection** (`sharedConnectionId` in `ms.config.json`), it will defer the `allowedActions` policy rather than prompting — there's no app code to infer from yet. Record it as *shared, policy pending*. After implementation, resolve it before any pack or deploy. This does not block `ms app dev`; carry any pending policy into Step 12's summary. See [allowed-actions.md](..\u002F..\u002Fshared\u002Fallowed-actions.md).\n\n**Forward all captured context to each sub-skill so its own prompts are suppressed.** The `\u002Fstate` skill needs the approved collections\u002Fproperties and the CLI freshness gate outcome. The per-service skills (`\u002Fadd-dataverse`, `\u002Fadd-sharepoint`, etc.) and `\u002Fadd-connector` each have their own prompt sequences (pick connection, pick table\u002Flist\u002Fsite, choose api-id, CLI freshness, etc.). The approved plan and discovery results should contain those answers, so pass them through as `$ARGUMENTS` (or whatever invocation surface is available) when dispatching: state collections\u002Fproperties, api-id, connection ID or name, table\u002Flist\u002Fsite identifiers, environment URL, project root, and the CLI freshness gate outcome plus known versions. A sub-skill receiving the CLI freshness outcome must not check or prompt again. If a sub-skill still needs a required input that cannot be discovered or safely inferred, ask the user one focused question and record the answer as an amendment to the approved plan rather than letting multiple sub-skills ask interactively.\n\nThe intent of this step is no per-connector approval prompts: the approved plan from Step 4 covers them. If a sub-skill fails (auth, missing connection, wrong api-id), surface the error verbatim and stop; do not silently proceed with a half-wired app.\n\nIf Step 3 \u002F Step 4 identified zero state collections or data sources, skip this step. Otherwise, this step must complete before Step 9 starts.\n\n### Step 9: Add Backend (if requested)\n\nSkip this step unless an app backend database was explicitly requested in\nStep 3 \u002F Step 4. Otherwise, invoke `\u002Fadd-backend` in this session for scaffolding,\ndependencies and its [data modeling reference](..\u002Fadd-backend\u002Freferences\u002Frayfin-data-modeling.md).\nForward the approved entities and the feature-check result with its CLI execution\ncontext so the shared reuse policy applies.\n\nVerify the authored entities and the [host-backed client helper](..\u002Fadd-backend\u002Freferences\u002Frayfin-data-modeling.md#step-4-initialize-through-managed-apps)\nexist, and capture their paths for Step 10. Defer UI work to Step 10 and checks to\nStep 11; do not deploy during setup.\n\nFor Rayfin, completion here means scaffolding, dependency installation and\nentity\u002Fclient implementation, not provisioning. An unprovisioned backend does\nnot block Step 10; do not ask for an existing database or connection settings.\nFollow the backend skill's lifecycle guidance.\n\n### Step 10: Implement the App\n\nGenerate the code that delivers the experience described in the approved plan:\n\n- Components, pages, routing, state management.\n- Wire each component to the typed services produced in Step 8. For connectors, avoid raw `fetch` \u002F `axios` \u002F Graph calls and use generated connector services. For `\u002Fstate`, prefer generated state services when codegen covers the scenario while allowing deliberate direct state requests when they are the better fit.\n- For Rayfin, use the client from Step 9 and follow the backend skill's [CRUD UI reference](..\u002Fadd-backend\u002Freferences\u002Frayfin-crud-ui.md).\n- Apply the inferred theme and UI decisions documented in the approved plan.\n- Replace template placeholder content; the user must see *their* app at the local URL, not \"Hello World.\"\n\nWhen the implementation is complete, the next step's `npm run build` is the gate that proves everything compiles end-to-end.\n\n### Step 11: Build and start local dev\n\n```bash\nnpm install            # safe to re-run; idempotent.\nnpm run build          # verifies the scaffolded + connector + custom code all compile.\n$BIN app dev           # starts the dev server (default port 8080) + config server.\n```\n\nIf `npm run build` fails, fix the errors before running `ms app dev`. Don't hand the user a URL that points at a broken build.\n\nFor Rayfin, follow the backend skill's\n[UI\u002Fpersistence checks](..\u002Fadd-backend\u002Freferences\u002Frayfin-crud-ui.md#checklist).\nAttempt host-backed initialization in the App Player before reporting backend\navailability, following the backend skill's guidance. Report actual errors rather\nthan inferring backend absence from missing local configuration.\nDo not deploy just to complete these checks.\n\n`ms app dev` runs two servers and prints an App Player URL like:\n\n```\nReady. You can play your app locally at: https:\u002F\u002Fplay.\u003Ccloud-domain>\u002Fapps\u002Fdev?ms_appUrl=http%3A%2F%2Flocalhost%3A5173%2F&ms_appConfigUrl=http%3A%2F%2Flocalhost%3A\u003Cport>\n```\n\nThe domain varies by cloud\u002Fregion (e.g. `play.preview.managedapps.cloud.microsoft.com`, `play.managedapps.cloud.microsoft.com`, or a sovereign-cloud equivalent). **Always use the exact URL the CLI prints** — do not hardcode or rewrite the host.\n\nHand that URL to the user **as a markdown link** (`[Open app in browser](\u003Curl>)`) **and also print the raw URL on its own line** — markdown links can render as plain label text in some environments (e.g. tables), hiding the actual URL. **Then open the browser automatically** using `Start-Process` (Windows) or `open` (macOS) \u002F `xdg-open` (Linux). **Nothing has been deployed to the cloud at this point** — the app exists in the service catalog but its runtime is local, with the connectors and UI you just built wired up.\n\nThe dev server runs in the foreground. Either:\n- Keep it running and tell the user how to stop it (Ctrl+C) and restart (`ms app dev`).\n- Or, if the user wants to continue iterating in the same Claude\u002FCopilot session, run `ms app dev` in the background (`run_in_background: true`) and monitor for the App Player URL line.\n\n### Step 12: Summary\n\nProvide:\n\n- **App**: display name, app GUID.\n- **Project path**: `$PROJECT_ROOT`.\n- **Git remote URL** (label it \"Git Remote\", not just \"Remote\" — users confuse \"Remote\" with a browser-openable link).\n- **Connectors wired up**: list each one added in Step 8 + which screens use it.\n- **App Player URL** (local dev) as a markdown link **and** the raw URL on its own line — markdown links can render as plain label text in some environments, hiding the actual URL.\n- **Open the browser automatically** after printing the URL — don't wait for the user to copy-paste it.\n- **What this URL is**: a live preview of the running app. Edits made in this chat will hot-reload there in real time — the user does **not** need to restart anything to see changes.\n- **Next steps** (in this exact framing):\n  1. Tell me what to change — I'll edit the code and you'll see it update live in the browser.\n  2. When you're happy with how it looks and behaves, say so. I'll commit + push your changes, run `ms app play --mode preview` to give you a cloud preview URL hosted in your environment, and *then* ask if you want me to `\u002Fdeploy` to the live URL.\n- **Important**: explicitly note that **nothing has been deployed to the cloud yet** — current state is local dev only.\n- **App backend, if requested**: report what was implemented and verified, with actual errors or unrun checks. Do not infer provisioning state from missing local configuration. A local UI preview does not verify database persistence.\n\nWhen the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](..\u002F..\u002Fshared\u002Fshared-instructions.md) — commit, push, `ms app play --mode preview`, hand off the preview URL, then ask about `\u002Fdeploy`. Do not skip the preview gate.\n\nDo **not** list `\u002Fadd-*` (but not `\u002Fadd-backend`) skills as next steps here; data sources were already wired in Step 8. Do not list `\u002Fadd-backend` as a next step either when it was requested; its code was prepared in Step 9. (If the user later wants an additional connector, they can ask and you'll invoke the right `\u002Fadd-*` (but not `\u002Fadd-backend`) mid-iteration.)\n\n### Step 13: Update Memory Bank\n\nWrite `memory-bank.md` at `$PROJECT_ROOT\u002Fmemory-bank.md` per [memory-bank.md](..\u002F..\u002Fshared\u002Fmemory-bank.md) template. Record the environment ID the CLI resolved for reference (e.g. to reconstruct the App Player URL) — do not use it to re-target a future `ms app create`, and do not surface it to the user.\n\n---\n\n## Example Walkthrough\n\n**User request:**\n\n> \"Build me a hello-world Microsoft App called Sample One.\"\n\n**Commands run (in order, against an account with `ms` already installed and authenticated to the production cluster):**\n\n```bash\n# Step 2: Prerequisites\nnode --version                       # → v22.4.0\ngit --version                        # → 2.45.0\nms --version                         # → 0.3.x\n\n# Step 5: Auth\nms auth status                       # → signed in as alice@contoso.onmicrosoft.com\n\n# Step 7: Scaffold (run from any directory; CLI creates the subfolder)\npwd                                 # → \u002FUsers\u002Falice\u002Fwork\nms app create sample-one \\\n  --display-name \"Sample One\" \\\n  --non-interactive\n# → App created. AppId: 7ea6...\n# → Environment: Default-\u003Cguid> (auto-routed)\n# → Remote: https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002F...\ncd sample-one\n\n# Step 8: Add Data Sources (none in this hello-world example — skipped)\n\n# Step 9: Add Backend (not requested in this hello-world example — skipped)\n\n# Step 10: Implement App (template-only for hello-world; nothing to wire)\n\n# Step 11: Build and start local dev\nnpm install\nnpm run build\nms app dev\n# → Ready. Play locally at: https:\u002F\u002Fplay.\u003Ccloud-domain>\u002Fapps\u002Fdev?ms_appUrl=...\n```\n\n**Final summary (verbatim format):**\n\n```\nSample One is running locally.\n\nApp: Sample One\nApp GUID: 7ea6...\nEnvironment: Default-\u003Cguid> (auto-routed Developer environment)\nCluster: prod\nProject: \u002FUsers\u002Falice\u002Fwork\u002Fsample-one\nGit Remote: https:\u002F\u002F\u003Cenv-id>.d.environment.api.powerplatform.com\u002F...\nLocal URL: [Open app in browser](\u003CURL from ms app dev output>)\n           \u003CURL from ms app dev output>\n\nNothing has been deployed to the cloud. The app (with its connectors and UI\nalready wired up) runs from your machine via `ms app dev`. The browser tab\nhot-reloads as I make code changes — just tell me what to adjust.\n\nWhen you're happy with it, tell me. I'll commit + push your changes, run\n`ms app play --mode preview` to give you a cloud preview URL in your\nenvironment, and then ask if you want me to \u002Fdeploy.\n```\n",{"name":5,"description":7,"allowed-tools":55},"Read Edit Write Grep Glob Bash AskUserQuestion EnterPlanMode ExitPlanMode Skill","main","530af9898bed3071d08b862030da202bc7b41257","plugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fcreate-app",12,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FCopilot-Managed-Runtime","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-06 04:02:23",{"source":9,"skillName":5,"commands":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add microsoft\u002Fmanaged-apps --skill create-app",{"tool":72,"command":73},"bunx","bunx skills add microsoft\u002Fmanaged-apps --skill create-app",{"tool":75,"command":76},"pnpm","pnpm dlx skills add microsoft\u002Fmanaged-apps --skill create-app","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fcreate-app\u002FSKILL.md",true,[80,86],{"path":81,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":84,"sourceHtmlUrl":85},"references\u002Fprerequisites-reference.md","REFERENCE","参考文档",3658,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fcreate-app\u002Freferences\u002Fprerequisites-reference.md",{"path":87,"resourceType":82,"resourceTypeDesc":83,"sizeBytes":88,"sourceHtmlUrl":89},"references\u002Ftroubleshooting.md",6587,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fcreate-app\u002Freferences\u002Ftroubleshooting.md",[91,117,137,157,177,199],{"skillNo":92,"name":93,"nameZh":94,"description":95,"descriptionZh":96,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":97,"categories":98,"keywords":103,"publishedAt":50},"01M69BW0D2HDW3YFJJX4QEYJF2","state","Microsoft 托管应用状态与附件管理","Store and query a Microsoft Managed App's built-in state and file attachments with `ms project state` CLI schema commands and generated TypeScript clients. First, with the user signed in to the CLI, run `ms feature status --name state --json`; if `feature.enabled` is not `true`, recommend an alternative connector or data source.","使用 `ms project state` CLI schema 命令和生成的 TypeScript 客户端，存储与查询 Microsoft 托管应用的内置状态和文件附件。首先，在用户登录 CLI 后运行 `ms feature status --name state --json`；如果 `feature.enabled` 不为 `true`，则推荐替代的连接器或数据源。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fstate\u002FSKILL.md",[99,100],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":101,"categoryName":102,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[93,104,105,106,107,33,40,108,109,110,47,111,45,44,34,112,113,114,115,116],"status","cli","run","typescript","project","generated","query","Connector","recommend","commands","data","source","feature",{"skillNo":118,"name":119,"nameZh":120,"description":121,"descriptionZh":122,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":123,"categories":124,"keywords":131,"publishedAt":50},"01M69BVYVZ0YYRMDY1WPVJ98VV","share","Microsoft 应用共享与访问控制","Shares (or unshares) a Microsoft App with users via `ms app share` \u002F `ms app unshare`. Use when updating app access control.","通过 `ms app share` \u002F `ms app unshare` 与用户共享（或取消共享）Microsoft 应用。在需要更新应用访问控制时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fshare\u002FSKILL.md",[125,128],{"categoryNo":126,"categoryName":127,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BTFDX7M21YT75733H52N36","身份与访问管理",{"categoryNo":129,"categoryName":130,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8C6RQ852C9AEJFCBGG1YA7S","IT 管理员",[119,10,33,132,40,42,133,47,134,36,135,136,45,46],"Access Control","access","users","control","via",{"skillNo":138,"name":139,"nameZh":140,"description":141,"descriptionZh":142,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":143,"categories":144,"keywords":147,"publishedAt":50},"01M69BVX6TTS1A17ZA2BDP13KP","share-link","Microsoft App 共享链接管理","Manages tenant-wide share links for a Microsoft App via `ms app share link create`, `ms app share link list`, and `ms app share link revoke`. Use when you want to distribute app access via a URL instead of named principals.","通过 `ms app share link create`、`ms app share link list` 和 `ms app share link revoke` 管理 Microsoft App 的租户级共享链接。适用于希望通过 URL（而非指定主体）来分发应用访问权限的场景。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fshare-link\u002FSKILL.md",[145,146],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":126,"categoryName":127,"taxonomyType":28,"taxonomyTypeDesc":29},[148,119,149,31,10,33,150,40,151,42,133,152,153,47,136,154,45,46,155,156],"share link","link","links","for","URL","you","distribute","wide","list",{"skillNo":158,"name":159,"nameZh":160,"description":161,"descriptionZh":162,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":163,"categories":164,"keywords":169,"publishedAt":50},"01M69BVVFK3WFDMJW2R5CYCRD4","play","Microsoft App 浏览器预览","Opens a Microsoft App in the browser via `ms app play`. Use when opening the live deployed version or a cloud-hosted preview (main branch or specific commit SHA) without starting a local dev server.","通过 `ms app play` 在浏览器中打开 Microsoft App。适用于打开已部署的线上版本或云端托管的预览版本（主分支或特定提交 SHA），而无需启动本地开发服务器。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Fplay\u002FSKILL.md",[165,166],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":167,"categoryName":168,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理",[159,48,170,10,43,33,171,40,38,56,42,172,47,173,174,175,176,136,45,46],"commit","branch","version","preview","local dev server","browser","server",{"skillNo":178,"name":179,"nameZh":180,"description":181,"descriptionZh":182,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":183,"categories":184,"keywords":189,"publishedAt":50},"01M69BVSSESTPDA4Z5WP8WEN01","list-connectors","可用连接器列表查询","Lists connectors available in the active environment — including whether each is allowed or blocked by your organization's policy — plus the connection-bound data sources already wired into a Microsoft App. Use when discovering connectors and their operations before adding data sources.","列出当前活动环境中可用的连接器——包括每个连接器是被组织策略允许还是阻止——以及已接入 Microsoft App 的连接绑定数据源。适用于在添加数据源之前发现可用的连接器及其操作。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Flist-connectors\u002FSKILL.md",[185,186],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":187,"categoryName":188,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BWDNFEHJCBZX47YY896K05","应用连接器集成",[190,191,156,10,192,33,193,194,42,47,195,196,197,45,114,198],"list connectors","connectors","policy","sources","environment","organization","operations","active","connection",{"skillNo":200,"name":201,"nameZh":202,"description":203,"descriptionZh":204,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":205,"categories":206,"keywords":211,"publishedAt":50},"01M69BVRDCYENNS8XXM1E5RBYQ","list-apps","Microsoft 应用列表查询","Discovers managed apps in the active environment via `ms app list --json` and optional `ms app show --json`. Use when listing or locating apps.","通过 `ms app list --json` 以及可选的 `ms app show --json` 发现活动环境中的受管理应用。在列出或定位应用时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fmanaged-apps\u002Fblob\u002Fmain\u002Fplugins\u002Fmicrosoft-managed-apps\u002Fskills\u002Flist-apps\u002FSKILL.md",[207,208],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":209,"categoryName":210,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C6RHQSB2BGY8CHB7AN49N9","Microsoft 应用生命周期管理",[212,37,156,33,213,40,194,42,47,136,197,214,45,46],"list apps","show","json"]