plugins/power-automate/skills/setup/SKILL.md
Set up Power Automate CLI prerequisites. Use when the user is new, something isn't working, or they need help getting started.
npx skillsauth add microsoft/power-platform-skills setupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You 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.
Run silently:
node --version 2>&1
v18.x.x or higher): Tell them "Node.js is installed" and move on.brew install node" (or direct them to nodejs.org)node --version.Run silently:
az --version 2>&1
winget install Microsoft.AzureCLI" or direct them to https://aka.ms/installazurecliwindowsbrew install azure-cli"az --version.Check if they're already logged in:
az account show --output json 2>&1
user.name field) and ask if that's the right account.az login
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."
After login completes, confirm it worked by running az account show again.Verify token access — this catches permission issues early.
First find out which Azure cloud they're on, because the Power Automate resource URL differs per cloud and the commercial one cannot be assumed (GCC High / DoD tenants will fail against it):
az cloud show --query name -o tsv
| az cloud show | Power Automate resource |
|---|---|
| AzureCloud (commercial) | https://service.flow.microsoft.com |
| AzureCloud + GCC tenant | https://gov.service.flow.microsoft.us |
| AzureUSGovernment (GCC High) | https://high.service.flow.microsoft.us |
| AzureUSGovernment (DoD) | https://dod.service.flow.microsoft.us |
az cloud show cannot distinguish commercial from GCC, or GCC High from DoD —
for those, set PA_CLOUD=gcc / PA_CLOUD=dod explicitly.
Then request a token for the matching resource, e.g. for commercial:
az account get-access-token --resource https://service.flow.microsoft.com --output json 2>&1
FlowAgent itself auto-detects the cloud the same way; you can override the
detection with PA_CLOUD=commercial|gcc|gcchigh|dod.
PA_CLIENT_ID=<app-id>. Flow management (list/create/run) works without it.The plugin talks to Power Automate through the FlowAgent MCP server, which is
registered as flowagent in the plugin's .mcp.json and started automatically.
.mcp.json loads the bundled server/mcp.mjs through a small Node bootstrap
that resolves the plugin's installation directory (PLUGIN_ROOT, else
CLAUDE_PLUGIN_ROOT, else the current directory) and prints an actionable error
if the bundle can't be found.
If flowagent-* / mcp__flowagent__* tools appear in your tool list: tell
them "The Power Automate tools are connected" and move on.
If they're missing: the MCP server isn't registered. Fix it automatically:
Locate the installed plugin's MCP bundle. This only matches a bundle
inside a power-automate plugin directory, so it can't pick up another
plugin's MCP server:
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}))}"
If it reports multiple power-automate bundles, show the candidates and ask
the user which one to register rather than guessing.
If exactly one was found, read ~/.copilot/mcp-config.json, add the
flowagent MCP entry, and write it back:
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)"
Tell the user to restart the agent (Copilot CLI: /restart, Claude Code:
restart the process). After restart, flowagent-* tools should appear.
If not found (plugin not installed at all): tell them to install the plugin first:
/plugin marketplace add microsoft/power-platform-skills
Then select power-automate and run /setup again.
Verify everything works end-to-end by listing the user's environments:
Preferred: call the list_environments tool.
If MCP tools aren't available: run node <path-to-plugin>/server/mcp.mjs
to confirm the bundled MCP server starts cleanly, then fix the plugin install
or .mcp.json wiring before retrying.
If it returns environments: Success! Tell them:
set_current_env tool, or ask "set my default
environment to <name>")./browse-flows — Browse your flows/create-flow — Create a new flow/debug-flow — Fix a broken flowIf it fails: Check the error. Common issues:
development
(Preview) Builds and edits a model-driven Power Apps app from a natural-language intent — tables, columns, relationships, adaptive forms with sub-grids, views, Choice-column charts, generative page intents for overview/dashboard surfaces (page `.tsx` generated in generate-pages after plan approval), and an app module + sitemap — via the headless cds-maker-sdk. Runs an interactive, multi-turn authoring flow (env selection, jobs-to-be-done first, then design-only App Spec authoring across confirmed levels, guardrail lint, plan-mode approval, generate-pages, full build) and a narrated build, and can download a deployed app back into an editable spec to change it. Use when the user says "build an app for X", "create a model-driven app", "make me an app to manage Y", or "edit/add to my app". This skill stands alone and does not require /genpage — but for a standalone generative page added to an app that already exists, use /genpage instead.
data-ai
Use when the user wants to enable offline mode for a Power Apps mobile app and create a Mobile Offline Profile in Dataverse — designs per-table row scope, relationships, columns, and sync frequency through a 3-gate approval flow.
data-ai
Use when the user wants to design or redesign the Dataverse schema and connector plan for an existing mobile app, or has an ER diagram (image, Mermaid, or text) to apply. Skip when the user is creating a brand-new app — /create-mobile-app handles the data model inline.
tools
Use when the user wants to report a bug, file an issue, submit a bug report, or report any problem with the mobile-app plugin.