[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699RS0TDEJM5BZBGDJ57YYM":3,"skill-same:01M699RS0TDEJM5BZBGDJ57YYM":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":47,"linkOnly":48,"markdownContent":49,"markdownBody":50,"frontMatter":51,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":58,"repositoryHtmlUrl":59,"repositoryHomepageUrl":60,"ownerHtmlUrl":61,"ownerBlogUrl":62,"ownerDescription":63,"updatedAt":64,"install":65,"resources":77},"01M699RS0TDEJM5BZBGDJ57YYM","setup",null,"Set up Power Automate CLI prerequisites. Use when the user is new, something isn't working, or they need help getting started.","microsoft\u002Fpower-platform-skills","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699JVYJFB75D9JM70BN4H0Q",1149,"MIT","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-automate\u002Fskills\u002Fsetup\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[5,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"preflight","invoke","past","expression","power","fix","context","list","edit","write","read","getting started","MCP","actions","search","update","run","delete","create","scaffold","validate","test","cli","2026-11-10 10:12:30",false,"---\nname: setup\ndescription: Set up Power Automate CLI prerequisites. Use when the user is new, something isn't working, or they need help getting started.\nuser-invocable: true\nallowed-tools: Bash, Read, Write, Glob, Grep, AskUserQuestion, mcp__flowagent__list_environments, mcp__flowagent__set_current_env, mcp__flowagent__get_current_env, mcp__flowagent__resolve_environment, mcp__flowagent__list_flows, mcp__flowagent__get_flow, mcp__flowagent__create_flow, mcp__flowagent__update_flow, mcp__flowagent__edit_flow, mcp__flowagent__copy_flow, mcp__flowagent__publish_flow, mcp__flowagent__disable_flow, mcp__flowagent__delete_flow, mcp__flowagent__run_flow, mcp__flowagent__get_run_history, mcp__flowagent__get_run_details, mcp__flowagent__get_run_actions, mcp__flowagent__get_run_action_repetitions, mcp__flowagent__cancel_run, mcp__flowagent__cancel_all_runs, mcp__flowagent__resubmit_run, mcp__flowagent__diagnose_run, mcp__flowagent__list_connections, mcp__flowagent__list_connectors, mcp__flowagent__get_connector, mcp__flowagent__search_operations, mcp__flowagent__get_operation_details, mcp__flowagent__pick_or_create_connection, mcp__flowagent__resolve_refs, mcp__flowagent__resolve_params, mcp__flowagent__scaffold_flow, mcp__flowagent__list_templates, mcp__flowagent__validate_flow, mcp__flowagent__preflight_flow, mcp__flowagent__smoke_test, mcp__flowagent__get_expression_help, mcp__flowagent__list_desktop_flows, mcp__flowagent__list_machine_groups, mcp__flowagent__run_desktop_flow, mcp__flowagent__get_flow_context, mcp__flowagent__set_current_flow, mcp__flowagent__clear_current_flow, mcp__flowagent__invoke_operation, mcp__flowagent__get_past_trigger_inputs, mcp__flowagent__test_connection, mcp__flowagent__fix_connection, mcp__flowagent__delete_connection, mcp__flowagent__preview_update, mcp__flowagent__get_backup, mcp__flowagent__list_backups, mcp__flowagent__restore_backup, mcp__flowagent__list_trigger_emulators, mcp__flowagent__whoami, mcp__flowagent__doctor, mcp__flowagent__reconnect, mcp__flowagent__list_accounts, mcp__flowagent__switch_account\nmodel: opus\n---\n\n# First-Time Setup Guide\n\nYou are helping a non-technical user get the Power Automate plugin working for the first time. Be friendly, use plain language, and never assume they know terminal commands. Walk them through each step one at a time.\n\n## Step 1: Check Node.js\n\nRun silently:\n```bash\nnode --version 2>&1\n```\n\n- **If it works** (prints something like `v18.x.x` or higher): Tell them \"Node.js is installed\" and move on.\n- **If it fails or version is below 18**: Tell them they need Node.js 18 or newer. Ask what operating system they're on, then give them the simplest install instructions:\n  - **Windows**: \"Go to https:\u002F\u002Fnodejs.org, download the LTS version, and run the installer. Click Next through everything.\"\n  - **Mac**: \"Open Terminal and run: `brew install node`\" (or direct them to nodejs.org)\n  - After they've installed it, re-check with `node --version`.\n\n## Step 2: Check Azure CLI\n\nRun silently:\n```bash\naz --version 2>&1\n```\n\n- **If it works**: Tell them \"Azure CLI is installed\" and move on.\n- **If it fails**: Tell them they need the Azure CLI. Ask their OS:\n  - **Windows**: \"Open PowerShell as administrator and run: `winget install Microsoft.AzureCLI`\" or direct them to https:\u002F\u002Faka.ms\u002Finstallazurecliwindows\n  - **Mac**: \"`brew install azure-cli`\"\n  - After install, re-check with `az --version`.\n\n## Step 3: Azure Login\n\nCheck if they're already logged in:\n```bash\naz account show --output json 2>&1\n```\n\n- **If it works** (shows account info): Tell them who they're logged in as (show the `user.name` field) and ask if that's the right account.\n- **If it fails**: Tell them \"Let's sign you into Azure.\" Then run:\n  ```bash\n  az login\n  ```\n  This will open their browser. Tell them: \"A browser window should open. Sign in with your work account — the one you use for Power Automate.\"\n  After login completes, confirm it worked by running `az account show` again.\n\n**Verify token access** — this catches permission issues early.\n\nFirst find out which Azure cloud they're on, because the Power Automate\nresource URL differs per cloud and the commercial one cannot be assumed\n(GCC High \u002F DoD tenants will fail against it):\n```bash\naz cloud show --query name -o tsv\n```\n\n| `az cloud show` | Power Automate resource |\n|---|---|\n| `AzureCloud` (commercial) | `https:\u002F\u002Fservice.flow.microsoft.com` |\n| `AzureCloud` + GCC tenant | `https:\u002F\u002Fgov.service.flow.microsoft.us` |\n| `AzureUSGovernment` (GCC High) | `https:\u002F\u002Fhigh.service.flow.microsoft.us` |\n| `AzureUSGovernment` (DoD) | Operator-verified `PA_FLOW_RESOURCE` value required; no built-in audience |\n\n`az cloud show` cannot distinguish commercial from GCC, or GCC High from DoD —\nfor those, set `PA_CLOUD=gcc` \u002F `PA_CLOUD=dod` explicitly.\n\nDoD endpoint hosts use `appsplatform.us`, but that does not establish the token\naudience (App ID URI). With `PA_CLOUD=dod`, FlowAgent requires an explicit,\noperator-verified `PA_FLOW_RESOURCE` and fails configuration otherwise. Do not\ncopy a guessed audience from a hostname; obtain the correct value for the tenant.\n\nThen request a token for the matching resource, e.g. for commercial:\n```bash\naz account get-access-token --resource https:\u002F\u002Fservice.flow.microsoft.com --output json 2>&1\n```\nFlowAgent itself auto-detects the cloud the same way; you can override the\ndetection with `PA_CLOUD=commercial|gcc|gcchigh|dod`.\n- **If it works**: Move on.\n- **If it fails with \"AADSTS65002\"** (common in GCC High): the Azure CLI app isn't\n  preauthorized for the Power Automate resource in that cloud. This is not a license\n  problem. Register a public-client app with delegated Power Automate (Flow service)\n  permissions and set `PA_CLIENT_ID=\u003Capp-id>`; flow commands then use that app.\n- **If it fails with any other \"AADSTS\"**: The user's account may not have Power Automate access. Tell them: \"Your Azure account doesn't seem to have access to Power Automate. Check with your IT admin that you have a Power Automate license.\"\n- **If it fails with other errors**: Show the error and suggest they contact IT support.\n- **If they're on a sovereign cloud and connection-management commands fail**: keep\n  the original error and inspect its code. `AADSTS650057` can indicate an invalid\n  resource or missing app authorization; `AADSTS65001` can require admin consent.\n  An app-not-found or consent failure may require an appropriately authorized\n  public-client registration and `PA_CLIENT_ID=\u003Capp-id>`. Network, tenant-selection\n  and expired-session errors need different remediation. Do not infer missing\n  preauthorization from the cloud name or classify every other code as unrelated.\n\n## Signing in to a specific account\n\nConnection management authenticates separately from `az` — it uses its own MSAL\nsession with its own on-disk token cache, so `az login` \u002F `az account set` do\n**not** switch the account it uses.\n\nThree tools cover this:\n\n| Tool | Use it to |\n|---|---|\n| `list_accounts` | See the cached-account inventory, `effectiveConnectivityIdentity`, and `nextSignIn` settings. Inactive tenant caches do not count as identity mismatches. Acquires no token. |\n| `switch_account` | Save a preferred `username`, or omit it to clear the preference. Check `preferencePersisted` and `nextSignIn`: environment overrides still apply. |\n| `whoami` \u002F `doctor` | Compare the effective Connectivity username and tenant with Azure CLI, including different users in the same tenant. |\n\n**When a connection tool fails with `ServiceToServiceEnvironmentNotFound`**,\ncheck identity before assuming the environment is missing. `list_accounts`\ndistinguishes the effective account from historical cached accounts. A different\nusername or tenant on the effective account indicates a mismatch; an unused\ntenant's cache alone does not. `switch_account` clears the cached sign-in and\nrecords the preferred username for reauthentication. It does not prove that\nthe subsequent sign-in succeeded or that environment permissions are correct.\n\n`switch_account` does not change the Azure CLI identity. `az` is yours to set;\nwhere the two disagree, the tool says so rather than silently re-pointing one.\n`reconnect` keeps a recorded preference — it drops credentials, and the\npreference is a stated intent rather than a credential.\nIt waits for pending token acquisition and cache cleanup, then clears in-memory\ntokens for all Azure CLI resources as well as Connectivity. A cleanup failure\nis an error, not a completed switch: fix the cache access problem and retry.\nDo not continue under the assumption that credentials changed when reset failed.\n\nOn interactive sign-in FlowAgent forces the account picker by default, so the\nbrowser's currently-signed-in account is never used silently. Two overrides:\n\n| Variable | Effect |\n|---|---|\n| `PA_LOGIN_HINT=\u003Cupn>` | Pre-select that account. Suppresses the picker, since the account is already targeted. |\n| `PA_NO_ACCOUNT_PICKER=1` | Restore plain browser SSO. For single-account users who don't want the extra click. |\n\nPrecedence, most specific first: `PA_LOGIN_HINT`, then a `switch_account`\npreference, then `PA_NO_ACCOUNT_PICKER`, then the picker.\nFor example, `switch_account` with username B still targets A if\n`PA_LOGIN_HINT=A` is set. Omitting the username clears only the stored preference;\nit does not override `PA_LOGIN_HINT` or `PA_NO_ACCOUNT_PICKER`. The response\nreports the effective settings instead of promising a picker in those cases.\n\n## Step 4: Check the FlowAgent tools are wired\n\nThe plugin talks to Power Automate through the **FlowAgent MCP server**, which is\nregistered as `flowagent` in the plugin's `.mcp.json` and started automatically.\n`.mcp.json` loads the bundled `server\u002Fmcp.mjs` through a small Node bootstrap\nthat resolves the plugin's installation directory (`PLUGIN_ROOT`, else\n`CLAUDE_PLUGIN_ROOT`, else the current directory) and prints an actionable error\nif the bundle can't be found.\n\n- **If `flowagent-*` \u002F `mcp__flowagent__*` tools appear in your tool list**: tell\n  them \"The Power Automate tools are connected\" and move on.\n- **If they're missing**: the MCP server isn't registered. Fix it automatically:\n\n  1. **Locate the installed plugin's MCP bundle.** This only matches a bundle\n     inside a `power-automate` plugin directory, so it can't pick up another\n     plugin's MCP server:\n     ```bash\n     node -e \"const fs=require('fs'),p=require('path'),d=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');const find=(dir)=>{let out=[];for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory()){try{out=out.concat(find(f))}catch{}}else if(e.name==='mcp.mjs'&&p.basename(p.dirname(dir))==='power-automate'){out.push(dir)}}return out};try{const hits=find(d);if(hits.length===1)console.log(JSON.stringify({found:true,serverDir:hits[0],mcpMjs:p.join(hits[0],'mcp.mjs')}));else if(hits.length>1)console.log(JSON.stringify({found:false,reason:'multiple power-automate bundles',candidates:hits}));else console.log(JSON.stringify({found:false}))}catch(e){console.log(JSON.stringify({found:false,error:e.message}))}\"\n     ```\n     If it reports `multiple power-automate bundles`, show the candidates and ask\n     the user which one to register rather than guessing.\n\n  2. **If exactly one was found**, read `~\u002F.copilot\u002Fmcp-config.json`, add the\n     `flowagent` MCP entry, and write it back:\n     ```bash\n     node -e \"const fs=require('fs'),p=require('path');const home=process.env.HOME||process.env.USERPROFILE;const cfgPath=p.join(home,'.copilot','mcp-config.json');let cfg;try{cfg=JSON.parse(fs.readFileSync(cfgPath,'utf8'))}catch{cfg={mcpServers:{}}};if(!cfg.mcpServers)cfg.mcpServers={};if(cfg.mcpServers.flowagent){console.log('already registered');process.exit(0)}const d=p.join(home,'.copilot','installed-plugins');const find=(dir)=>{let out=[];for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory()){try{out=out.concat(find(f))}catch{}}else if(e.name==='mcp.mjs'&&p.basename(p.dirname(dir))==='power-automate'){out.push(dir)}}return out};const hits=find(d);if(hits.length!==1){console.log(hits.length?'ambiguous: '+JSON.stringify(hits):'mcp.mjs not found');process.exit(1)}const mcpPath=p.join(hits[0],'mcp.mjs');cfg.mcpServers.flowagent={command:'node',args:[mcpPath]};fs.writeFileSync(cfgPath,JSON.stringify(cfg,null,2)+'\\n');console.log('registered flowagent MCP at '+mcpPath)\"\n     ```\n\n  3. **Tell the user** to restart the agent (Copilot CLI: `\u002Frestart`, Claude Code:\n     restart the process). After restart, `flowagent-*` tools should appear.\n\n  4. **If not found** (plugin not installed at all): tell them to install the\n     plugin first:\n     ```\n     \u002Fplugin marketplace add microsoft\u002Fpower-platform-skills\n     ```\n     Then select `power-automate` and run `\u002Fsetup` again.\n\n## Step 5: Smoke Test\n\nVerify everything works end-to-end by listing the user's environments:\n\n- **Preferred**: call the `list_environments` tool.\n- **If MCP tools aren't available**: run `node \u003Cpath-to-plugin>\u002Fserver\u002Fmcp.mjs`\n  to confirm the bundled MCP server starts cleanly, then fix the plugin install\n  or `.mcp.json` wiring before retrying.\n\n- **If it returns environments**: Success! Tell them:\n  - \"Everything is working! Here are your Power Automate environments:\"\n  - Show the environments in a simple table (name, location).\n  - If there are multiple, ask which one they mainly use and suggest setting it\n    as the default (the `set_current_env` tool, or ask \"set my default\n    environment to \u003Cname>\").\n  - Tell them about the available skills:\n    - **`\u002Fbrowse-flows`** — Browse your flows\n    - **`\u002Fcreate-flow`** — Create a new flow\n    - **`\u002Fdebug-flow`** — Fix a broken flow\n- **If it fails**: Check the error. Common issues:\n  - Auth error → go back to Step 3\n  - Tools not found → go back to Step 4\n  - Network error → ask if they're behind a corporate proxy\u002FVPN\n\n## Tone Guidelines\n\n- Use \"we\" language: \"Let's check if Node.js is installed\"\n- Celebrate small wins: \"Great, Node.js is ready!\"\n- Don't dump all steps at once — do one at a time and confirm before moving on\n- If something fails, don't panic — explain what went wrong in plain English and what to do\n- Never show raw JSON errors to the user without explaining what they mean\n","# First-Time Setup Guide\n\nYou are helping a non-technical user get the Power Automate plugin working for the first time. Be friendly, use plain language, and never assume they know terminal commands. Walk them through each step one at a time.\n\n## Step 1: Check Node.js\n\nRun silently:\n```bash\nnode --version 2>&1\n```\n\n- **If it works** (prints something like `v18.x.x` or higher): Tell them \"Node.js is installed\" and move on.\n- **If it fails or version is below 18**: Tell them they need Node.js 18 or newer. Ask what operating system they're on, then give them the simplest install instructions:\n  - **Windows**: \"Go to https:\u002F\u002Fnodejs.org, download the LTS version, and run the installer. Click Next through everything.\"\n  - **Mac**: \"Open Terminal and run: `brew install node`\" (or direct them to nodejs.org)\n  - After they've installed it, re-check with `node --version`.\n\n## Step 2: Check Azure CLI\n\nRun silently:\n```bash\naz --version 2>&1\n```\n\n- **If it works**: Tell them \"Azure CLI is installed\" and move on.\n- **If it fails**: Tell them they need the Azure CLI. Ask their OS:\n  - **Windows**: \"Open PowerShell as administrator and run: `winget install Microsoft.AzureCLI`\" or direct them to https:\u002F\u002Faka.ms\u002Finstallazurecliwindows\n  - **Mac**: \"`brew install azure-cli`\"\n  - After install, re-check with `az --version`.\n\n## Step 3: Azure Login\n\nCheck if they're already logged in:\n```bash\naz account show --output json 2>&1\n```\n\n- **If it works** (shows account info): Tell them who they're logged in as (show the `user.name` field) and ask if that's the right account.\n- **If it fails**: Tell them \"Let's sign you into Azure.\" Then run:\n  ```bash\n  az login\n  ```\n  This will open their browser. Tell them: \"A browser window should open. Sign in with your work account — the one you use for Power Automate.\"\n  After login completes, confirm it worked by running `az account show` again.\n\n**Verify token access** — this catches permission issues early.\n\nFirst find out which Azure cloud they're on, because the Power Automate\nresource URL differs per cloud and the commercial one cannot be assumed\n(GCC High \u002F DoD tenants will fail against it):\n```bash\naz cloud show --query name -o tsv\n```\n\n| `az cloud show` | Power Automate resource |\n|---|---|\n| `AzureCloud` (commercial) | `https:\u002F\u002Fservice.flow.microsoft.com` |\n| `AzureCloud` + GCC tenant | `https:\u002F\u002Fgov.service.flow.microsoft.us` |\n| `AzureUSGovernment` (GCC High) | `https:\u002F\u002Fhigh.service.flow.microsoft.us` |\n| `AzureUSGovernment` (DoD) | Operator-verified `PA_FLOW_RESOURCE` value required; no built-in audience |\n\n`az cloud show` cannot distinguish commercial from GCC, or GCC High from DoD —\nfor those, set `PA_CLOUD=gcc` \u002F `PA_CLOUD=dod` explicitly.\n\nDoD endpoint hosts use `appsplatform.us`, but that does not establish the token\naudience (App ID URI). With `PA_CLOUD=dod`, FlowAgent requires an explicit,\noperator-verified `PA_FLOW_RESOURCE` and fails configuration otherwise. Do not\ncopy a guessed audience from a hostname; obtain the correct value for the tenant.\n\nThen request a token for the matching resource, e.g. for commercial:\n```bash\naz account get-access-token --resource https:\u002F\u002Fservice.flow.microsoft.com --output json 2>&1\n```\nFlowAgent itself auto-detects the cloud the same way; you can override the\ndetection with `PA_CLOUD=commercial|gcc|gcchigh|dod`.\n- **If it works**: Move on.\n- **If it fails with \"AADSTS65002\"** (common in GCC High): the Azure CLI app isn't\n  preauthorized for the Power Automate resource in that cloud. This is not a license\n  problem. Register a public-client app with delegated Power Automate (Flow service)\n  permissions and set `PA_CLIENT_ID=\u003Capp-id>`; flow commands then use that app.\n- **If it fails with any other \"AADSTS\"**: The user's account may not have Power Automate access. Tell them: \"Your Azure account doesn't seem to have access to Power Automate. Check with your IT admin that you have a Power Automate license.\"\n- **If it fails with other errors**: Show the error and suggest they contact IT support.\n- **If they're on a sovereign cloud and connection-management commands fail**: keep\n  the original error and inspect its code. `AADSTS650057` can indicate an invalid\n  resource or missing app authorization; `AADSTS65001` can require admin consent.\n  An app-not-found or consent failure may require an appropriately authorized\n  public-client registration and `PA_CLIENT_ID=\u003Capp-id>`. Network, tenant-selection\n  and expired-session errors need different remediation. Do not infer missing\n  preauthorization from the cloud name or classify every other code as unrelated.\n\n## Signing in to a specific account\n\nConnection management authenticates separately from `az` — it uses its own MSAL\nsession with its own on-disk token cache, so `az login` \u002F `az account set` do\n**not** switch the account it uses.\n\nThree tools cover this:\n\n| Tool | Use it to |\n|---|---|\n| `list_accounts` | See the cached-account inventory, `effectiveConnectivityIdentity`, and `nextSignIn` settings. Inactive tenant caches do not count as identity mismatches. Acquires no token. |\n| `switch_account` | Save a preferred `username`, or omit it to clear the preference. Check `preferencePersisted` and `nextSignIn`: environment overrides still apply. |\n| `whoami` \u002F `doctor` | Compare the effective Connectivity username and tenant with Azure CLI, including different users in the same tenant. |\n\n**When a connection tool fails with `ServiceToServiceEnvironmentNotFound`**,\ncheck identity before assuming the environment is missing. `list_accounts`\ndistinguishes the effective account from historical cached accounts. A different\nusername or tenant on the effective account indicates a mismatch; an unused\ntenant's cache alone does not. `switch_account` clears the cached sign-in and\nrecords the preferred username for reauthentication. It does not prove that\nthe subsequent sign-in succeeded or that environment permissions are correct.\n\n`switch_account` does not change the Azure CLI identity. `az` is yours to set;\nwhere the two disagree, the tool says so rather than silently re-pointing one.\n`reconnect` keeps a recorded preference — it drops credentials, and the\npreference is a stated intent rather than a credential.\nIt waits for pending token acquisition and cache cleanup, then clears in-memory\ntokens for all Azure CLI resources as well as Connectivity. A cleanup failure\nis an error, not a completed switch: fix the cache access problem and retry.\nDo not continue under the assumption that credentials changed when reset failed.\n\nOn interactive sign-in FlowAgent forces the account picker by default, so the\nbrowser's currently-signed-in account is never used silently. Two overrides:\n\n| Variable | Effect |\n|---|---|\n| `PA_LOGIN_HINT=\u003Cupn>` | Pre-select that account. Suppresses the picker, since the account is already targeted. |\n| `PA_NO_ACCOUNT_PICKER=1` | Restore plain browser SSO. For single-account users who don't want the extra click. |\n\nPrecedence, most specific first: `PA_LOGIN_HINT`, then a `switch_account`\npreference, then `PA_NO_ACCOUNT_PICKER`, then the picker.\nFor example, `switch_account` with username B still targets A if\n`PA_LOGIN_HINT=A` is set. Omitting the username clears only the stored preference;\nit does not override `PA_LOGIN_HINT` or `PA_NO_ACCOUNT_PICKER`. The response\nreports the effective settings instead of promising a picker in those cases.\n\n## Step 4: Check the FlowAgent tools are wired\n\nThe plugin talks to Power Automate through the **FlowAgent MCP server**, which is\nregistered as `flowagent` in the plugin's `.mcp.json` and started automatically.\n`.mcp.json` loads the bundled `server\u002Fmcp.mjs` through a small Node bootstrap\nthat resolves the plugin's installation directory (`PLUGIN_ROOT`, else\n`CLAUDE_PLUGIN_ROOT`, else the current directory) and prints an actionable error\nif the bundle can't be found.\n\n- **If `flowagent-*` \u002F `mcp__flowagent__*` tools appear in your tool list**: tell\n  them \"The Power Automate tools are connected\" and move on.\n- **If they're missing**: the MCP server isn't registered. Fix it automatically:\n\n  1. **Locate the installed plugin's MCP bundle.** This only matches a bundle\n     inside a `power-automate` plugin directory, so it can't pick up another\n     plugin's MCP server:\n     ```bash\n     node -e \"const fs=require('fs'),p=require('path'),d=p.join(process.env.HOME||process.env.USERPROFILE,'.copilot','installed-plugins');const find=(dir)=>{let out=[];for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory()){try{out=out.concat(find(f))}catch{}}else if(e.name==='mcp.mjs'&&p.basename(p.dirname(dir))==='power-automate'){out.push(dir)}}return out};try{const hits=find(d);if(hits.length===1)console.log(JSON.stringify({found:true,serverDir:hits[0],mcpMjs:p.join(hits[0],'mcp.mjs')}));else if(hits.length>1)console.log(JSON.stringify({found:false,reason:'multiple power-automate bundles',candidates:hits}));else console.log(JSON.stringify({found:false}))}catch(e){console.log(JSON.stringify({found:false,error:e.message}))}\"\n     ```\n     If it reports `multiple power-automate bundles`, show the candidates and ask\n     the user which one to register rather than guessing.\n\n  2. **If exactly one was found**, read `~\u002F.copilot\u002Fmcp-config.json`, add the\n     `flowagent` MCP entry, and write it back:\n     ```bash\n     node -e \"const fs=require('fs'),p=require('path');const home=process.env.HOME||process.env.USERPROFILE;const cfgPath=p.join(home,'.copilot','mcp-config.json');let cfg;try{cfg=JSON.parse(fs.readFileSync(cfgPath,'utf8'))}catch{cfg={mcpServers:{}}};if(!cfg.mcpServers)cfg.mcpServers={};if(cfg.mcpServers.flowagent){console.log('already registered');process.exit(0)}const d=p.join(home,'.copilot','installed-plugins');const find=(dir)=>{let out=[];for(const e of fs.readdirSync(dir,{withFileTypes:true})){const f=p.join(dir,e.name);if(e.isDirectory()){try{out=out.concat(find(f))}catch{}}else if(e.name==='mcp.mjs'&&p.basename(p.dirname(dir))==='power-automate'){out.push(dir)}}return out};const hits=find(d);if(hits.length!==1){console.log(hits.length?'ambiguous: '+JSON.stringify(hits):'mcp.mjs not found');process.exit(1)}const mcpPath=p.join(hits[0],'mcp.mjs');cfg.mcpServers.flowagent={command:'node',args:[mcpPath]};fs.writeFileSync(cfgPath,JSON.stringify(cfg,null,2)+'\\n');console.log('registered flowagent MCP at '+mcpPath)\"\n     ```\n\n  3. **Tell the user** to restart the agent (Copilot CLI: `\u002Frestart`, Claude Code:\n     restart the process). After restart, `flowagent-*` tools should appear.\n\n  4. **If not found** (plugin not installed at all): tell them to install the\n     plugin first:\n     ```\n     \u002Fplugin marketplace add microsoft\u002Fpower-platform-skills\n     ```\n     Then select `power-automate` and run `\u002Fsetup` again.\n\n## Step 5: Smoke Test\n\nVerify everything works end-to-end by listing the user's environments:\n\n- **Preferred**: call the `list_environments` tool.\n- **If MCP tools aren't available**: run `node \u003Cpath-to-plugin>\u002Fserver\u002Fmcp.mjs`\n  to confirm the bundled MCP server starts cleanly, then fix the plugin install\n  or `.mcp.json` wiring before retrying.\n\n- **If it returns environments**: Success! Tell them:\n  - \"Everything is working! Here are your Power Automate environments:\"\n  - Show the environments in a simple table (name, location).\n  - If there are multiple, ask which one they mainly use and suggest setting it\n    as the default (the `set_current_env` tool, or ask \"set my default\n    environment to \u003Cname>\").\n  - Tell them about the available skills:\n    - **`\u002Fbrowse-flows`** — Browse your flows\n    - **`\u002Fcreate-flow`** — Create a new flow\n    - **`\u002Fdebug-flow`** — Fix a broken flow\n- **If it fails**: Check the error. Common issues:\n  - Auth error → go back to Step 3\n  - Tools not found → go back to Step 4\n  - Network error → ask if they're behind a corporate proxy\u002FVPN\n\n## Tone Guidelines\n\n- Use \"we\" language: \"Let's check if Node.js is installed\"\n- Celebrate small wins: \"Great, Node.js is ready!\"\n- Don't dump all steps at once — do one at a time and confirm before moving on\n- If something fails, don't panic — explain what went wrong in plain English and what to do\n- Never show raw JSON errors to the user without explaining what they mean\n",{"name":5,"model":52,"description":7,"allowed-tools":53,"user-invocable":54},"opus","Bash, Read, Write, Glob, Grep, AskUserQuestion, mcp__flowagent__list_environments, mcp__flowagent__set_current_env, mcp__flowagent__get_current_env, mcp__flowagent__resolve_environment, mcp__flowagent__list_flows, mcp__flowagent__get_flow, mcp__flowagent__create_flow, mcp__flowagent__update_flow, mcp__flowagent__edit_flow, mcp__flowagent__copy_flow, mcp__flowagent__publish_flow, mcp__flowagent__disable_flow, mcp__flowagent__delete_flow, mcp__flowagent__run_flow, mcp__flowagent__get_run_history, mcp__flowagent__get_run_details, mcp__flowagent__get_run_actions, mcp__flowagent__get_run_action_repetitions, mcp__flowagent__cancel_run, mcp__flowagent__cancel_all_runs, mcp__flowagent__resubmit_run, mcp__flowagent__diagnose_run, mcp__flowagent__list_connections, mcp__flowagent__list_connectors, mcp__flowagent__get_connector, mcp__flowagent__search_operations, mcp__flowagent__get_operation_details, mcp__flowagent__pick_or_create_connection, mcp__flowagent__resolve_refs, mcp__flowagent__resolve_params, mcp__flowagent__scaffold_flow, mcp__flowagent__list_templates, mcp__flowagent__validate_flow, mcp__flowagent__preflight_flow, mcp__flowagent__smoke_test, mcp__flowagent__get_expression_help, mcp__flowagent__list_desktop_flows, mcp__flowagent__list_machine_groups, mcp__flowagent__run_desktop_flow, mcp__flowagent__get_flow_context, mcp__flowagent__set_current_flow, mcp__flowagent__clear_current_flow, mcp__flowagent__invoke_operation, mcp__flowagent__get_past_trigger_inputs, mcp__flowagent__test_connection, mcp__flowagent__fix_connection, mcp__flowagent__delete_connection, mcp__flowagent__preview_update, mcp__flowagent__get_backup, mcp__flowagent__list_backups, mcp__flowagent__restore_backup, mcp__flowagent__list_trigger_emulators, mcp__flowagent__whoami, mcp__flowagent__doctor, mcp__flowagent__reconnect, mcp__flowagent__list_accounts, mcp__flowagent__switch_account",true,"main","0a55a88fa2855404029d1e5450faf92878baf763","plugins\u002Fpower-automate\u002Fskills\u002Fsetup",232,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills","https:\u002F\u002Fmicrosoft.github.io\u002Fpower-platform-skills\u002F","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-14 21:46:39",{"source":8,"skillName":5,"commands":66,"prompt":76,"zipAvailable":54},[67,70,73],{"tool":68,"command":69},"npx","npx skills add microsoft\u002Fpower-platform-skills --skill setup",{"tool":71,"command":72},"bunx","bunx skills add microsoft\u002Fpower-platform-skills --skill setup",{"tool":74,"command":75},"pnpm","pnpm dlx skills add microsoft\u002Fpower-platform-skills --skill setup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-automate\u002Fskills\u002Fsetup\u002FSKILL.md",[],[79,87,107,130,148,162],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M78JN2BFRRV1J54Q6WKZQ08D","compare-site-configurations","Compare Power Pages site configurations between two environments, such as dev, test and production, or between a local download and the live site, and explain which differences change site behavior. Use when a site works in one environment but not another (for example, works in dev but fails in test), to check configuration drift before promoting or deploying, or to see what changed between two sites. Produces a shareable HTML report and a JSON file that VS Code can import.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fpower-pages\u002Fskills\u002Fcompare-site-configurations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":88,"name":5,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":47},"01M699WVHX0XN59EPBTTPEKYPG","Use when Process Intelligence needs building, explicit cloud\u002Faccount\u002Fenvironment configuration, sign-in, connection diagnostics, or recovery from an authentication error.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fsetup\u002FSKILL.md",[],[5,93,94,95,96,97,98,99,100,101,102,103,104,105,34,106],"configuration","diagnostics","error","environment","cloud","when","connection","authentication","use","Bash","recovery","process","sign","intelligence",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":118,"publishedAt":47},"01M699WSR9EX55YY1WD9J22FEG","report-issue","Use when the user wants a Process Intelligence bug-report draft or support summary for a failed operation.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Freport-issue\u002FSKILL.md",[113],{"categoryNo":114,"categoryName":115,"taxonomyType":116,"taxonomyTypeDesc":117},"01JBSEEDCAT000000000000034","行政与办公人员","PROFESSION","适用职业",[119,120,121,122,101,98,123,124,104,125,106,126,127,128,129],"issue","report","report issue","bug-report","operation","draft","bug","summary","user","for","support",{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":47},"01M699WR26YQ9Q21KE6MJF5B2G","investigate-process","Use when a broad Process Mining business question, observed pattern or competing explanation needs investigation across analytical perspectives.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Finvestigate-process\u002FSKILL.md",[],[137,104,138,139,101,140,141,98,142,143,144,34,145,146,147],"investigate","investigate process","question","process mining","business","across","perspectives","mining","pattern","investigation","analytical",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":47},"01M699WP9SDG5ZR12P8VYNXKTN","derive-metric","Use when a requested measure is missing, a saved custom metric needs reuse, or an ephemeral formula or derived scalar is needed.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fderive-metric\u002FSKILL.md",[],[155,156,157,158,159,160,101,98,161,34],"metric","derive metric","missing","formula","custom","reuse","saved",{"skillNo":163,"name":164,"nameZh":6,"description":165,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":47},"01M699WMG5R8P6SMTDAS1TKF9E","compare-cohorts","Use when comparing process cohorts, departments, periods or before-and-after results under matched definitions.","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fpower-platform-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fprocess-intelligence\u002Fskills\u002Fcompare-cohorts\u002FSKILL.md",[],[169,170,101,98,171,104,34],"compare","compare cohorts","results"]