diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index af93755..5e2eb80 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -13,7 +13,7 @@ "name": "microsoft-managed-apps", "source": "./plugins/microsoft-managed-apps", "description": "[Preview] Create and manage Microsoft Managed Apps using the @microsoft/managed-apps-cli (ms) toolchain.", - "version": "2.0.1" + "version": "2.0.2" } ] } diff --git a/plugins/microsoft-managed-apps/.claude-plugin/plugin.json b/plugins/microsoft-managed-apps/.claude-plugin/plugin.json index 850b8ce..dec4388 100644 --- a/plugins/microsoft-managed-apps/.claude-plugin/plugin.json +++ b/plugins/microsoft-managed-apps/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "microsoft-managed-apps", - "version": "2.0.1", + "version": "2.0.2", "description": "[Preview] Create and manage Microsoft Managed Apps using the @microsoft/managed-apps-cli (ms) toolchain.", "author": { "name": "Microsoft", diff --git a/plugins/microsoft-managed-apps/shared/shared-instructions.md b/plugins/microsoft-managed-apps/shared/shared-instructions.md index a015d0d..1d186b9 100644 --- a/plugins/microsoft-managed-apps/shared/shared-instructions.md +++ b/plugins/microsoft-managed-apps/shared/shared-instructions.md @@ -302,20 +302,24 @@ Wait for their decision — do not silently switch branches or merge on their be ``` If push fails (e.g., needs upstream), retry with the upstream set explicitly: `git push -u origin main`. Surface auth errors verbatim and stop on failure. -3. **Run the cloud preview.** +3. **If preview is requested, run the cloud preview.** ```bash $BIN app play --mode preview ``` This builds the app from `main` on demand and returns a preview URL hosted in the user's environment — no deploy required. - **If the command fails** (cloud build error, expired auth, region issue, missing env), surface the error verbatim, stop, and **do not proceed to Step 4**. A failed preview means we don't yet have proof the cloud build is healthy, so asking about `/deploy` would be premature. Propose the targeted fix (re-auth, retry) and wait for the user's next signal. + **If the command fails** (cloud build error, expired auth, region issue, missing env), surface the error verbatim, stop, and propose the targeted fix (re-auth, retry). Wait for the user's next signal. On success, hand the URL to the user **as a markdown link**. -4. **Ask whether to deploy** (only after a successful preview URL is in their hands): - > "Preview is live at the URL above — open it and confirm it looks right in the cloud. When you're ready, I can run `/deploy` to publish this to the live URL. Want me to deploy now?" +4. **Ask whether to preview or deploy** (after commit/push and before any live publish): + > "Choose one: + > 1) Keep iterating in local dev (changes load live in the browser). + > 2) Ask to preview (commit + push, then run a cloud preview build in your Microsoft-hosted environment with your IT governance policies). + > 3) Say deploy (commit + push, then explicitly promote a successful build live). + > 4) Say other (stop here with no preview or deploy yet)." - Wait for explicit confirmation. If the user wants more changes first, go back to local-dev iteration; the preview gate will fire again the next time they signal readiness. If they confirm, hand off to `/deploy`. + Wait for explicit confirmation. If they choose local iteration, return to local-dev edits. If they ask to preview, run Step 3 and hand them the preview URL. If they ask to deploy, hand off to `/deploy`. If they say other, stop with no preview/deploy action. This gate lives between local-dev iteration and `/deploy`. Skills that hand off a local URL (`/create-app`, `/dev`) reference this section so users follow the same iterate → preview → deploy loop everywhere. diff --git a/plugins/microsoft-managed-apps/skills/create-app/SKILL.md b/plugins/microsoft-managed-apps/skills/create-app/SKILL.md index a68597d..985ce93 100644 --- a/plugins/microsoft-managed-apps/skills/create-app/SKILL.md +++ b/plugins/microsoft-managed-apps/skills/create-app/SKILL.md @@ -260,10 +260,14 @@ Provide: - **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. - **Next steps** (in this exact framing): 1. Tell me what to change — I'll edit the code and you'll see it update live in the browser. - 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 `/deploy` to the live URL. + 2. Then choose one: + 1) Keep iterating in local dev — changes load live in the browser. + 2) Ask to preview — I'll commit + push, then run a cloud preview build in your Microsoft-hosted environment with your IT governance policies. + 3) Or tell me to deploy — I'll commit + push, then explicitly promote a successful build live. + 4) Say other — I'll stop here with no preview or deploy yet. - **Important**: explicitly note that **nothing has been deployed to the cloud yet** — current state is local dev only. -When the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/shared/shared-instructions.md) — commit, push, `ms app play --mode preview`, hand off the preview URL, then ask about `/deploy`. Do not skip the preview gate. +When the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/shared/shared-instructions.md) — commit, push, then present the 4 options in order: keep iterating locally, preview in Microsoft-hosted environment, deploy live, or stop here. Do not skip the preview gate. Do **not** list `/add-*` skills as next steps here; data sources were already wired in Step 8. (If the user later wants an additional connector, they can ask and you'll invoke the right `/add-*` mid-iteration.) @@ -329,7 +333,9 @@ Nothing has been deployed to the cloud. The app (with its connectors and UI already wired up) runs from your machine via `ms app dev`. The browser tab hot-reloads as I make code changes — just tell me what to adjust. -When you're happy with it, tell me. I'll commit + push your changes, run -`ms app play --mode preview` to give you a cloud preview URL in your -environment, and then ask if you want me to /deploy. +When you're happy with it, tell me. Then choose one: +1) Keep iterating in local dev (changes load live in the browser). +2) Ask to preview (I'll commit + push, then run a cloud preview build in your Microsoft-hosted environment with your IT governance policies). +3) Say deploy (I'll commit + push, then explicitly promote a successful build live). +4) Say other (I'll stop here with no preview or deploy yet). ``` diff --git a/plugins/microsoft-managed-apps/skills/dev/SKILL.md b/plugins/microsoft-managed-apps/skills/dev/SKILL.md index bc54b28..daaef41 100644 --- a/plugins/microsoft-managed-apps/skills/dev/SKILL.md +++ b/plugins/microsoft-managed-apps/skills/dev/SKILL.md @@ -80,9 +80,13 @@ Do **not** show the git remote URL in the dev summary — it's an internal detai Then add a one-liner reminder of the iterate → preview → deploy loop: -> "The browser tab hot-reloads as I edit code — tell me what to change. When you're happy with it, I'll commit + push your changes, run `ms app play --mode preview` for a cloud preview URL in your environment, and then ask if you want me to `/deploy`." +> "The browser tab hot-reloads as I edit code — tell me what to change. Then choose one of these options: +> 1. Keep iterating in local dev (changes load live in the browser). +> 2. Ask to preview (I'll commit + push, then run a cloud preview build in your Microsoft-hosted environment with your IT governance policies). +> 3. Say deploy (I'll commit + push, then explicitly promote a successful build live). +> 4. Say other (I'll stop here with no preview or deploy yet)." -When the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/shared/shared-instructions.md) — commit, push, preview, then ask about `/deploy`. +When the user signals readiness, follow the **Ready-to-Ship Gate** in [shared-instructions.md](${CLAUDE_PLUGIN_ROOT}/shared/shared-instructions.md) — commit, push, then present the same 4 options (keep iterating, preview, deploy, or stop here) in that order. If the dev server prints an error during startup (port conflict, missing `ms.config.json`, expired auth), stop the background task, surface the error verbatim, and propose the targeted fix: