AGENT SKILL

play

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.

License 许可
MIT
最近更新
2026-11-12
Stars
★ 6
Forks
0

01 前言 Front Matter

name
play
description
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.
allowed-tools
Read Grep Bash AskUserQuestion

03 SKILL.md 正文

? Shared Instructions: shared-instructions.md — Cross-cutting concerns.

Play

Opens a Microsoft App in the browser by fetching its cloud play URL and launching it. No local dev server required.

Mode Command What opens
live (default) ms app play The most recently deployed version. A snapshot — does not update until ms app deploy is run again.
preview (main) ms app play --mode preview Built from the main branch on demand — always reflects the latest pushed code, even without a deploy.
preview (commit) ms app play --mode preview --commit <sha> App as of a specific commit SHA — useful for code review or regression testing.

Live vs. preview: Live requires a prior ms app deploy. Preview builds from source on demand — it works without any deployment and always reflects unpublished code.

Workflow

  1. Memory Bank → 2. Verify Project + Env → 3. Resolve Mode → 4. Run → 5. Surface URL

Step 1: Check Memory Bank

Read memory-bank.md per shared-instructions.md for the app's environment/app identifiers, if recorded.

Step 2: Verify Project + Env

test -f ms.config.json || { echo "Not in a Microsoft App workspace."; exit 1; }
BIN=ms
$BIN auth status                                         # must report the expected UPN

--app and --environment-id can be passed explicitly to run from outside a project directory — ms.config.json is only needed for the defaults.

Step 3: Resolve Mode

If not already clear from the user's request, ask:

"Do you want to open the live deployed version, a preview of the latest code on main, or a preview of a specific commit?"

Map intent to mode:

User says Mode
"live", "deployed", no qualifier live (default — no flag needed)
"preview", "latest", "unpublished", "before deploy" --mode preview
"preview at commit X" / specific SHA provided --mode preview --commit <sha>

Step 4: Run

Live (default):

$BIN app play

Preview — latest code on main:

$BIN app play --mode preview

Preview — specific commit:

$BIN app play --mode preview --commit <sha>

Full flag reference:

Flag Alias Default Description
--mode -m live live or preview.
--commit -c HEAD on main Preview only. The commit SHA to open. Ignored for live mode (CLI throws if combined).
--app appId from ms.config.json App name override for running outside the project directory.
--no-browser false Print the URL without opening a browser tab.
--json Emit { success, appName, mode, url, commitHash } instead of human-readable output.

Step 5: Surface URL

Present the URL the CLI printed. For live mode, surface the CLI's built-in warning:

Live URL for 'my-app':
  https://apps.powerapps.com/play/e/<env-id>/app/<guid>

⚠ Live does not auto-update. Run /deploy to publish new code to the live URL.

For preview:

Preview URL for 'my-app' (main):
  https://apps.powerapps.com/play/e/<env-id>/app/<guid>/branch/main

For commit-pinned preview:

Preview URL for 'my-app' (commit abc1234):
  https://apps.powerapps.com/play/e/<env-id>/app/<guid>/commit/abc1234

Edge Cases

Situation Action
No live build available — run 'ms app deploy' first The app has never been deployed. Tell the user to run /deploy, then retry ms app play.
--commit passed with --mode live Hard UsageError from the CLI. Explain that --commit only works with --mode preview.
No appPlayUri for preview mode App record exists but play URI is missing. Surface the error verbatim and stop.
User wants URL without opening a browser Pass --no-browser; the CLI prints the URL and exits without launching a tab.
User is outside a project directory Pass --app <name> and --environment-id <id> explicitly.

04 同仓库更多 Skills

microsoft
microsoft/Copilot-Managed-Runtime

setup-taskmanager

Sets up the Task Manager template for a new owner - copies the sample into its own folder, signs in to the `ms` CLI, creates the app and its platform-managed git repository on Copilot Managed Runtime, adds the Azure DevOps, Teams and Office 365 Users connectors, writes .env.local and admins.json, verifies with npm run check-setup, and commits and pushes to the app's repository. Use when someone has just cloned this template, when `npm run dev` or `npm run build` stops at check-setup, or when ms.config.json is missing.

★ 6
microsoft
microsoft/Copilot-Managed-Runtime

add-data-source

Moves this app's data from browser-local storage to a shared backend (SharePoint lists, Dataverse tables, a REST API, or any other store) by adding a storage provider. Use when the user wants app data shared between people or devices, kept outside the browser, or stored in a specific system.

数据分析师后端与接口
★ 6
microsoft
microsoft/Copilot-Managed-Runtime

setup-taskmanager

Sets up the Task Manager template for a new owner - copies the sample into its own folder, signs in to the `ms` CLI, creates the app and its platform-managed git repository on Copilot Managed Runtime, adds the Azure DevOps, Teams and Office 365 Users connectors, writes .env.local and admins.json, verifies with npm run check-setup, and commits and pushes to the app's repository. Use when someone has just cloned this template, when `npm run dev` or `npm run build` stops at check-setup, or when ms.config.json is missing.

★ 6
microsoft
microsoft/Copilot-Managed-Runtime

add-data-source

Moves this app's data from browser-local storage to a shared backend (SharePoint lists, Dataverse tables, a REST API, or any other store) by adding a storage provider. Use when the user wants app data shared between people or devices, kept outside the browser, or stored in a specific system.

数据分析师后端与接口
★ 6
microsoft
microsoft/Copilot-Managed-Runtime

setup-learninghub

Set up the Learning Hub sample after cloning it - copy it into its own folder, install dependencies, sign in with the ms CLI, create the app and its platform-managed git repository with ms app init (writes ms.config.json), hide the host header, add the Office 365 Users connector, configure .env.local, verify with check-setup, start local development, and commit and push to the app's repository. Use when someone asks to set up, configure, run or deploy this app for the first time, or when `npm run dev`/`npm run build` stops with "Learning Hub is not set up yet".

运维与部署
★ 6
microsoft
microsoft/Copilot-Managed-Runtime

add-data-source

Moves this app's data from browser-local storage to a shared backend (SharePoint lists, Dataverse tables, a REST API, or any other store) by adding a storage provider. Use when the user wants app data shared between people or devices, kept outside the browser, or stored in a specific system.

数据分析师后端与接口
★ 6