[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M699F4QN5BMQA3X9F7WC1NS0":3,"skill-same:01M699F4QN5BMQA3X9F7WC1NS0":66},{"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":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":17,"ownerHtmlUrl":48,"ownerBlogUrl":49,"ownerDescription":50,"updatedAt":51,"install":52,"resources":65},"01M699F4QN5BMQA3X9F7WC1NS0","manage-agent","Copilot Studio 智能体管理","Push\u002Fpull Copilot Studio agent content via the VS Code extension's LanguageServerHost LSP binary. Handles authentication (interactive browser login for push\u002Fpull, device code flow for chat token), sync push, sync pull, clone, and diff operations.","通过 VS Code 扩展的 LanguageServerHost LSP 二进制文件推送\u002F拉取 Copilot Studio 智能体内容。处理身份验证（推送\u002F拉取使用交互式浏览器登录，聊天令牌使用设备代码流）、同步推送、同步拉取、克隆和差异比较操作。","microsoft\u002Fskills-for-copilot-studio","microsoft","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6154722?v=4","01M698VYDXZ6JW5WH3CRV650R8","Microsoft","01M699DXBD563FYBGWKPJJRAVM",493,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Fmanage-agent\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发","SCENARIO","使用场景",[31,32,33],"manage agent","auth","sync","2026-11-10 10:12:30",false,"---\nuser-invocable: false\ndescription: Push\u002Fpull Copilot Studio agent content via the VS Code extension's LanguageServerHost LSP binary. Handles authentication (interactive browser login for push\u002Fpull, device code flow for chat token), sync push, sync pull, clone, and diff operations.\nargument-hint: \u003Cpush|pull|clone|changes|validate|publish|auth|list-agents|list-envs>\nallowed-tools: Bash(node *manage-agent.bundle.js *), Read, Glob, Grep\ncontext: fork\nagent: copilot-studio-manage\n---\n\n# Manage Agent\n\nPush and pull Copilot Studio agent content by calling the VS Code extension's LanguageServerHost binary directly, using the same custom LSP protocol the extension uses internally.\n\n## IMPORTANT: Do Not Modify Scripts\n\nThis is a new capability under active development. The manage-agent scripts (`manage-agent.bundle.js`, `chat-with-agent.bundle.js`) are pre-built bundles that must not be modified, patched, or monkey-patched. If a script fails:\n\n1. **Report the error as-is** — show the user the full error output\n2. **Do not attempt to fix, patch, or work around script errors** — the scripts interact with the LSP binary using a specific protocol and any modifications will break things\n3. **Direct the user to raise an issue** at https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fissues with the error output\n4. **Suggest using the VS Code extension directly** — the user can perform the same push\u002Fpull\u002Fclone operations from the Copilot Studio VS Code extension UI as a fallback\n\n## Prerequisites\n\n1. **Copilot Studio VS Code extension** must be installed (`ms-copilotstudio.vscode-copilotstudio`).\n2. **Azure AD app registration** (optional) — only needed for device code flow (`auth` command). If `--client-id` is omitted, the script uses VS Code's first-party client ID with interactive browser login instead.\n3. **Environment details** — tenant ID, environment ID, environment URL, and agent management URL. These come from the `.mcs\u002Fconn.json` inside a cloned agent workspace (created automatically during clone).\n\nDataverse URLs must be HTTPS origins on an organization hostname under\n`crm.dynamics.com`, `crm\u003Cnumber>.dynamics.com`, `crm.microsoftdynamics.us`,\n`crm.appsplatform.us`, or `crm.dynamics.cn`, without credentials, custom ports,\npaths, queries, or fragments. Trailing slashes and the default HTTPS port are\naccepted. Tenant IDs must be GUIDs or tenant domain names; agent IDs must be GUIDs.\nAuthenticated REST requests do not follow redirects. Accepting a sovereign-cloud\nDataverse hostname does not add sovereign-cloud authentication or discovery;\nthe existing authority and BAP endpoints are unchanged.\n\n## Phase 0: Resolve Configuration\n\nSearch for `.mcs\u002Fconn.json` in the workspace and nearby directories to find existing connection details. The script auto-reads environment details from `conn.json`. If no `conn.json` is found, ask the user for the required parameters.\n\n## Phase 1: Authenticate\n\nThere are **two different auth flows** depending on the operation:\n\n### For push \u002F pull \u002F clone \u002F changes \u002F list-agents (interactive browser login)\n\nThese commands use VS Code's first-party client ID with the **Island API gateway**. Authentication is **interactive** — a browser window opens automatically for sign-in. No manual code entry is needed.\n\n- On first use, a browser window opens for Microsoft sign-in\n- Tokens are cached in the OS credential store and silently refreshed for ~90 days\n- After ~90 days, the browser will open again for re-authentication\n\n**No separate auth step is needed before push\u002Fpull.** The commands handle token acquisition automatically. Just run the command directly (Phase 2).\n\n### For the `auth` command (device code flow — chat\u002Ftest token)\n\nThe `auth` command acquires a generic `api.powerplatform.com` token using **device code flow**. This token is used by the chat and test skills, not by push\u002Fpull.\n\nRun with a **5-minute timeout**:\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js auth \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --client-id \"\u003CclientId>\" \\\n  --environment-url \"\u003CenvironmentUrl>\"\n```\n\n**Timeout: 300000ms (5 minutes)** — set this on the Bash tool call.\n\n### Token caching and silent refresh\n\nTokens and MSAL refresh tokens are persisted in the OS credential store (macOS Keychain, Windows DPAPI, Linux secret-tool). After initial authentication:\n- Access tokens are valid for ~1 hour\n- Refresh tokens are valid for ~90 days\n- The script automatically refreshes expired access tokens silently using the cached refresh token\n- **Re-authentication is only needed on the very first use or after ~90 days**\n\n### When device code flow starts (auth command only)\n\nThe script emits a JSON line to stdout:\n\n```json\n{\"status\":\"device_code\",\"userCode\":\"XXXXXXXX\",\"verificationUri\":\"https:\u002F\u002Flogin.microsoft.com\u002Fdevice\",\"message\":\"...\",\"expiresIn\":900}\n```\n\n**When you see this in the output**, immediately tell the user:\n\n> **Authentication Required**\n>\n> Please open **{verificationUri}** in your browser and enter code **{userCode}**\n>\n> The command is waiting for you to complete sign-in. You have {expiresIn\u002F60} minutes.\n\nThe command will automatically continue once the user completes authentication. **Do NOT cancel the command** — it is waiting for the browser sign-in to complete.\n\nTwo tokens are acquired sequentially (Copilot Studio API, then Dataverse API), so the user may need to authenticate **twice** on first use.\n\n### If the command completes with `status: \"ok\"`\n\nTokens are cached. Proceed to Phase 2.\n\n### If the command fails with `device_code_expired`\n\nThe user didn't authenticate in time. Re-run the `auth` command and remind them to authenticate promptly.\n\n## Phase 2: Execute Command\n\nAll commands auto-detect the agent directory (finds the subfolder with `.mcs\u002Fconn.json`) and read connection details from it.\n\n### Pull (download remote changes)\n\n`--client-id` is optional. When omitted, uses VS Code's 1p client with interactive browser login.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js pull \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Push (upload local changes)\n\n**Important:** Always `pull` before `push` to get fresh row versions. If you push without pulling first, you'll get a `ConcurrencyVersionMismatch` error.\n\nPush automatically validates all `.mcs.yml` files before pushing and blocks if there are errors. Add `--force` to bypass validation (not recommended).\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js push \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Validate (check YAML before pushing)\n\nValidates all `.mcs.yml` files in the workspace using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references).\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js validate \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\nReturns JSON: `{ \"valid\": true|false, \"summary\": { \"errors\": N, \"warnings\": N }, \"files\": [...] }`\n\n### Clone (download agent to new local folder)\n\nRequires either `--agent-id` (the bot GUID from `list-agents`) **or** `--url` (a Copilot Studio web URL). Uses Island API token automatically.\n\n**With explicit IDs:**\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js clone \\\n  --workspace \"\u003Ctarget-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\" \\\n  --agent-id \"\u003CagentId>\"\n```\n\n**With a Copilot Studio URL (recommended shortcut):**\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js clone \\\n  --workspace \"\u003Ctarget-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --url \"https:\u002F\u002Fcopilotstudio.microsoft.com\u002Fenvironments\u002F\u003CenvId>\u002Fbots\u002F\u003CagentId>\u002Foverview\"\n```\n\nWhen `--url` is provided, the script extracts `environmentId` and `agentId` from the URL and resolves `environmentUrl` and `agentMgmtUrl` automatically via the BAP API. The `--url` flag also works with `push`, `pull`, `changes`, and `validate` commands.\n\n### View Changes (diff local vs remote)\n\n`--client-id` is optional. When omitted, uses VS Code's 1p client with interactive browser login.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js changes \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Publish (make draft agent live)\n\nPublishes the agent so that the current draft becomes the live version reachable by external clients (`\u002Fchat-with-agent`, `\u002Frun-tests`, Teams, etc.). Uses the Dataverse `PvaPublish` bound action directly (no LSP binary needed).\n\n**IMPORTANT — Publishing makes this version of the agent available to ALL users the agent is shared with.** If you are working in a development environment this is fine, but if the agent is shared with production users, **always confirm with the user before publishing.** Ask: \"This will publish the agent and make it live for all users it's shared with. Should I proceed?\"\n\nThe command polls the `publishedon` field on the bot entity until the timestamp changes, confirming that publish has taken effect. Default timeout is 5 minutes.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js publish \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  [--timeout \u003Cms>]\n```\n\n**Timeout: 300000ms (5 minutes)** — set this on the Bash tool call.\n\nOptional: `--agent-id \"\u003CagentId>\"` overrides the bot ID from `conn.json`.\n\n#### Publish output (success)\n```json\n{\"status\":\"ok\",\"botId\":\"...\",\"publishedOn\":\"2026-03-27T12:00:00Z\",\"previousPublishedOn\":\"2026-03-26T10:00:00Z\",\"durationMs\":45000,\"durationSeconds\":45}\n```\n\n#### When to publish\n\n- After a successful `push`, if the user wants changes to be testable via `\u002Fchat-with-agent` or `\u002Frun-tests`\n- In an improvement loop (edit → push → publish → test), publish is required between push and test\n- The command confirms publish completion via API — **do not use time-based waits**\n\n### List Agents\n\nUses Dataverse REST API directly (no LSP binary needed). `--client-id` is optional.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js list-agents \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  [--no-owner]\n```\n\nBy default lists only agents owned by the current user. Add `--no-owner` to list all unmanaged agents.\n\n### List Environments\n\nUses BAP REST API directly (no LSP binary needed). `--client-id` is optional.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js list-envs \\\n  --tenant-id \"\u003CtenantId>\"\n```\n\n\n## Output Format\n\nAll commands output JSON to stdout with a `status` field:\n\n### Device code prompt (during auth)\n```json\n{\"status\":\"device_code\",\"userCode\":\"XXXXXXXX\",\"verificationUri\":\"https:\u002F\u002Flogin.microsoft.com\u002Fdevice\",\"message\":\"...\",\"expiresIn\":900}\n```\n\n### Success\n```json\n{\"status\":\"ok\",\"method\":\"powerplatformls\u002FsyncPull\",\"result\":{...}}\n```\n\n### Error\n```json\n{\"status\":\"error\",\"error\":\"description of what went wrong\"}\n```\n\n## Error Handling\n\n| Error | Likely cause | Resolution |\n|-------|-------------|------------|\n| Extension not found | Copilot Studio VS Code extension not installed | Install from VS Code marketplace |\n| LSP request timed out | Binary not responding or wrong protocol version | Check extension version, try updating |\n| device_code_expired | User didn't authenticate in time | Re-run auth, authenticate promptly |\n| ConcurrencyVersionMismatch | Push without fresh row versions | Pull first, then push |\n| Token expired + silent refresh failed | Refresh token expired (~90 days) | Run `auth` command for new device code flow |\n| Binary missing | Extension installed but binary not present | Reinstall the extension |\n| PvaPublish failed | Insufficient permissions or bot not found | Verify the user has publish permissions and the agent ID is correct |\n| Publish timed out | Publish still in progress after timeout | Increase `--timeout` or check the Copilot Studio UI for status |\n","# Manage Agent\n\nPush and pull Copilot Studio agent content by calling the VS Code extension's LanguageServerHost binary directly, using the same custom LSP protocol the extension uses internally.\n\n## IMPORTANT: Do Not Modify Scripts\n\nThis is a new capability under active development. The manage-agent scripts (`manage-agent.bundle.js`, `chat-with-agent.bundle.js`) are pre-built bundles that must not be modified, patched, or monkey-patched. If a script fails:\n\n1. **Report the error as-is** — show the user the full error output\n2. **Do not attempt to fix, patch, or work around script errors** — the scripts interact with the LSP binary using a specific protocol and any modifications will break things\n3. **Direct the user to raise an issue** at https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fissues with the error output\n4. **Suggest using the VS Code extension directly** — the user can perform the same push\u002Fpull\u002Fclone operations from the Copilot Studio VS Code extension UI as a fallback\n\n## Prerequisites\n\n1. **Copilot Studio VS Code extension** must be installed (`ms-copilotstudio.vscode-copilotstudio`).\n2. **Azure AD app registration** (optional) — only needed for device code flow (`auth` command). If `--client-id` is omitted, the script uses VS Code's first-party client ID with interactive browser login instead.\n3. **Environment details** — tenant ID, environment ID, environment URL, and agent management URL. These come from the `.mcs\u002Fconn.json` inside a cloned agent workspace (created automatically during clone).\n\nDataverse URLs must be HTTPS origins on an organization hostname under\n`crm.dynamics.com`, `crm\u003Cnumber>.dynamics.com`, `crm.microsoftdynamics.us`,\n`crm.appsplatform.us`, or `crm.dynamics.cn`, without credentials, custom ports,\npaths, queries, or fragments. Trailing slashes and the default HTTPS port are\naccepted. Tenant IDs must be GUIDs or tenant domain names; agent IDs must be GUIDs.\nAuthenticated REST requests do not follow redirects. Accepting a sovereign-cloud\nDataverse hostname does not add sovereign-cloud authentication or discovery;\nthe existing authority and BAP endpoints are unchanged.\n\n## Phase 0: Resolve Configuration\n\nSearch for `.mcs\u002Fconn.json` in the workspace and nearby directories to find existing connection details. The script auto-reads environment details from `conn.json`. If no `conn.json` is found, ask the user for the required parameters.\n\n## Phase 1: Authenticate\n\nThere are **two different auth flows** depending on the operation:\n\n### For push \u002F pull \u002F clone \u002F changes \u002F list-agents (interactive browser login)\n\nThese commands use VS Code's first-party client ID with the **Island API gateway**. Authentication is **interactive** — a browser window opens automatically for sign-in. No manual code entry is needed.\n\n- On first use, a browser window opens for Microsoft sign-in\n- Tokens are cached in the OS credential store and silently refreshed for ~90 days\n- After ~90 days, the browser will open again for re-authentication\n\n**No separate auth step is needed before push\u002Fpull.** The commands handle token acquisition automatically. Just run the command directly (Phase 2).\n\n### For the `auth` command (device code flow — chat\u002Ftest token)\n\nThe `auth` command acquires a generic `api.powerplatform.com` token using **device code flow**. This token is used by the chat and test skills, not by push\u002Fpull.\n\nRun with a **5-minute timeout**:\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js auth \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --client-id \"\u003CclientId>\" \\\n  --environment-url \"\u003CenvironmentUrl>\"\n```\n\n**Timeout: 300000ms (5 minutes)** — set this on the Bash tool call.\n\n### Token caching and silent refresh\n\nTokens and MSAL refresh tokens are persisted in the OS credential store (macOS Keychain, Windows DPAPI, Linux secret-tool). After initial authentication:\n- Access tokens are valid for ~1 hour\n- Refresh tokens are valid for ~90 days\n- The script automatically refreshes expired access tokens silently using the cached refresh token\n- **Re-authentication is only needed on the very first use or after ~90 days**\n\n### When device code flow starts (auth command only)\n\nThe script emits a JSON line to stdout:\n\n```json\n{\"status\":\"device_code\",\"userCode\":\"XXXXXXXX\",\"verificationUri\":\"https:\u002F\u002Flogin.microsoft.com\u002Fdevice\",\"message\":\"...\",\"expiresIn\":900}\n```\n\n**When you see this in the output**, immediately tell the user:\n\n> **Authentication Required**\n>\n> Please open **{verificationUri}** in your browser and enter code **{userCode}**\n>\n> The command is waiting for you to complete sign-in. You have {expiresIn\u002F60} minutes.\n\nThe command will automatically continue once the user completes authentication. **Do NOT cancel the command** — it is waiting for the browser sign-in to complete.\n\nTwo tokens are acquired sequentially (Copilot Studio API, then Dataverse API), so the user may need to authenticate **twice** on first use.\n\n### If the command completes with `status: \"ok\"`\n\nTokens are cached. Proceed to Phase 2.\n\n### If the command fails with `device_code_expired`\n\nThe user didn't authenticate in time. Re-run the `auth` command and remind them to authenticate promptly.\n\n## Phase 2: Execute Command\n\nAll commands auto-detect the agent directory (finds the subfolder with `.mcs\u002Fconn.json`) and read connection details from it.\n\n### Pull (download remote changes)\n\n`--client-id` is optional. When omitted, uses VS Code's 1p client with interactive browser login.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js pull \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Push (upload local changes)\n\n**Important:** Always `pull` before `push` to get fresh row versions. If you push without pulling first, you'll get a `ConcurrencyVersionMismatch` error.\n\nPush automatically validates all `.mcs.yml` files before pushing and blocks if there are errors. Add `--force` to bypass validation (not recommended).\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js push \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Validate (check YAML before pushing)\n\nValidates all `.mcs.yml` files in the workspace using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references).\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js validate \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\nReturns JSON: `{ \"valid\": true|false, \"summary\": { \"errors\": N, \"warnings\": N }, \"files\": [...] }`\n\n### Clone (download agent to new local folder)\n\nRequires either `--agent-id` (the bot GUID from `list-agents`) **or** `--url` (a Copilot Studio web URL). Uses Island API token automatically.\n\n**With explicit IDs:**\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js clone \\\n  --workspace \"\u003Ctarget-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\" \\\n  --agent-id \"\u003CagentId>\"\n```\n\n**With a Copilot Studio URL (recommended shortcut):**\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js clone \\\n  --workspace \"\u003Ctarget-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --url \"https:\u002F\u002Fcopilotstudio.microsoft.com\u002Fenvironments\u002F\u003CenvId>\u002Fbots\u002F\u003CagentId>\u002Foverview\"\n```\n\nWhen `--url` is provided, the script extracts `environmentId` and `agentId` from the URL and resolves `environmentUrl` and `agentMgmtUrl` automatically via the BAP API. The `--url` flag also works with `push`, `pull`, `changes`, and `validate` commands.\n\n### View Changes (diff local vs remote)\n\n`--client-id` is optional. When omitted, uses VS Code's 1p client with interactive browser login.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js changes \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-id \"\u003CenvId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  --agent-mgmt-url \"\u003CmgmtUrl>\"\n```\n\n### Publish (make draft agent live)\n\nPublishes the agent so that the current draft becomes the live version reachable by external clients (`\u002Fchat-with-agent`, `\u002Frun-tests`, Teams, etc.). Uses the Dataverse `PvaPublish` bound action directly (no LSP binary needed).\n\n**IMPORTANT — Publishing makes this version of the agent available to ALL users the agent is shared with.** If you are working in a development environment this is fine, but if the agent is shared with production users, **always confirm with the user before publishing.** Ask: \"This will publish the agent and make it live for all users it's shared with. Should I proceed?\"\n\nThe command polls the `publishedon` field on the bot entity until the timestamp changes, confirming that publish has taken effect. Default timeout is 5 minutes.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js publish \\\n  --workspace \"\u003Cpath-to-agent-folder>\" \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  [--timeout \u003Cms>]\n```\n\n**Timeout: 300000ms (5 minutes)** — set this on the Bash tool call.\n\nOptional: `--agent-id \"\u003CagentId>\"` overrides the bot ID from `conn.json`.\n\n#### Publish output (success)\n```json\n{\"status\":\"ok\",\"botId\":\"...\",\"publishedOn\":\"2026-03-27T12:00:00Z\",\"previousPublishedOn\":\"2026-03-26T10:00:00Z\",\"durationMs\":45000,\"durationSeconds\":45}\n```\n\n#### When to publish\n\n- After a successful `push`, if the user wants changes to be testable via `\u002Fchat-with-agent` or `\u002Frun-tests`\n- In an improvement loop (edit → push → publish → test), publish is required between push and test\n- The command confirms publish completion via API — **do not use time-based waits**\n\n### List Agents\n\nUses Dataverse REST API directly (no LSP binary needed). `--client-id` is optional.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js list-agents \\\n  --tenant-id \"\u003CtenantId>\" \\\n  --environment-url \"\u003CenvUrl>\" \\\n  [--no-owner]\n```\n\nBy default lists only agents owned by the current user. Add `--no-owner` to list all unmanaged agents.\n\n### List Environments\n\nUses BAP REST API directly (no LSP binary needed). `--client-id` is optional.\n\n```bash\nnode ${CLAUDE_SKILL_DIR}\u002F..\u002F..\u002Fscripts\u002Fmanage-agent.bundle.js list-envs \\\n  --tenant-id \"\u003CtenantId>\"\n```\n\n\n## Output Format\n\nAll commands output JSON to stdout with a `status` field:\n\n### Device code prompt (during auth)\n```json\n{\"status\":\"device_code\",\"userCode\":\"XXXXXXXX\",\"verificationUri\":\"https:\u002F\u002Flogin.microsoft.com\u002Fdevice\",\"message\":\"...\",\"expiresIn\":900}\n```\n\n### Success\n```json\n{\"status\":\"ok\",\"method\":\"powerplatformls\u002FsyncPull\",\"result\":{...}}\n```\n\n### Error\n```json\n{\"status\":\"error\",\"error\":\"description of what went wrong\"}\n```\n\n## Error Handling\n\n| Error | Likely cause | Resolution |\n|-------|-------------|------------|\n| Extension not found | Copilot Studio VS Code extension not installed | Install from VS Code marketplace |\n| LSP request timed out | Binary not responding or wrong protocol version | Check extension version, try updating |\n| device_code_expired | User didn't authenticate in time | Re-run auth, authenticate promptly |\n| ConcurrencyVersionMismatch | Push without fresh row versions | Pull first, then push |\n| Token expired + silent refresh failed | Refresh token expired (~90 days) | Run `auth` command for new device code flow |\n| Binary missing | Extension installed but binary not present | Reinstall the extension |\n| PvaPublish failed | Insufficient permissions or bot not found | Verify the user has publish permissions and the agent ID is correct |\n| Publish timed out | Publish still in progress after timeout | Increase `--timeout` or check the Copilot Studio UI for status |\n",{"agent":39,"context":40,"description":7,"allowed-tools":41,"argument-hint":42,"user-invocable":35},"copilot-studio-manage","fork","Bash(node *manage-agent.bundle.js *), Read, Glob, Grep","\u003Cpush|pull|clone|changes|validate|publish|auth|list-agents|list-envs>","main","9c42d3a612c6e06389b6e5b4eed579aaed1a8b63","skills\u002Fmanage-agent",103,"https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio","https:\u002F\u002Fgithub.com\u002Fmicrosoft","https:\u002F\u002Fopensource.microsoft.com","Open source projects and samples from Microsoft","2026-11-12 17:03:17",{"source":9,"skillName":5,"commands":53,"prompt":63,"zipAvailable":64},[54,57,60],{"tool":55,"command":56},"npx","npx skills add microsoft\u002Fskills-for-copilot-studio --skill manage-agent",{"tool":58,"command":59},"bunx","bunx skills add microsoft\u002Fskills-for-copilot-studio --skill manage-agent",{"tool":61,"command":62},"pnpm","pnpm dlx skills add microsoft\u002Fskills-for-copilot-studio --skill manage-agent","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Fmanage-agent\u002FSKILL.md",true,[],[67,78,93,107,119,131],{"skillNo":68,"name":69,"nameZh":70,"description":71,"descriptionZh":72,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":73,"categories":74,"keywords":77,"publishedAt":34},"01M699FD973RBVBTQYE48GBFPG","validate","Copilot Studio YAML 校验","Validate Copilot Studio agent YAML files using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references). Use when the user asks to check, validate, or verify YAML files.","使用 LSP 二进制文件的完整诊断能力（YAML 结构、Power Fx、schema、跨文件引用）校验 Copilot Studio 智能体的 YAML 文件。当用户要求检查、验证或核对 YAML 文件时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Fvalidate\u002FSKILL.md",[75,76],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[69],{"skillNo":79,"name":80,"nameZh":81,"description":82,"descriptionZh":83,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":84,"categories":85,"keywords":88,"publishedAt":34},"01M699FBJC22B4HCFH9MA844C3","test-auth","Copilot Studio 测试身份验证","Authenticate for Copilot Studio evaluation API and SDK chat. Caches a token that is shared across run-eval and chat-sdk skills. Run this before any eval or SDK chat workflow. Requires an App Registration with MakerOperations and Copilots.Invoke permissions.","为 Copilot Studio 评估 API 和 SDK 聊天进行身份验证。缓存一个在 run-eval 和 chat-sdk 技能之间共享的令牌。在任何评估或 SDK 聊天工作流之前运行此技能。要求使用具有 MakerOperations 和 Copilots.Invoke 权限的 App Registration。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Ftest-auth\u002FSKILL.md",[86,87],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[89,32,90,91,92],"test","test auth","sdk","workflow",{"skillNo":94,"name":95,"nameZh":96,"description":97,"descriptionZh":98,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":99,"categories":100,"keywords":105,"publishedAt":34},"01M699FA38G1TAVA0JWD9DG783","run-tests-kit","Copilot Studio Kit 批量测试","Run a batch test suite via the Copilot Studio Kit (Dataverse API). Uses the Power CAT Copilot Studio Kit to execute test cases against a published agent and produces pass\u002Ffail results with latencies. Requires the Kit installed in the environment, an App Registration with Dataverse permissions, and a published agent.","通过 Copilot Studio Kit (Dataverse API) 运行批量测试套件。使用 Power CAT Copilot Studio Kit 对已发布的智能体执行测试用例，并生成包含延迟的通过\u002F失败结果。要求环境中已安装 Kit、具有 Dataverse 权限的 App Registration，以及已发布的智能体。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Frun-tests-kit\u002FSKILL.md",[101,104],{"categoryNo":102,"categoryName":103,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},[106,89],"run tests kit",{"skillNo":108,"name":109,"nameZh":110,"description":111,"descriptionZh":112,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":113,"categories":114,"keywords":117,"publishedAt":34},"01M699F8EP4BZT1EA3R4Y40X98","run-eval","Copilot Studio 智能体评估运行","Run evaluations against a Copilot Studio agent via the Power Platform Evaluation API. Works on DRAFT agents — no publish step required. Lists test sets, starts a run, polls until complete, fetches results, and proposes YAML fixes for failures. Use when the user wants to test agent changes without publishing.","通过 Power Platform Evaluation API 对 Copilot Studio 智能体运行评估。适用于草稿(DRAFT)智能体——无需发布步骤。列出测试集、启动运行、轮询直至完成、获取结果，并针对失败提出 YAML 修复建议。当用户希望在不发布的情况下测试智能体更改时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Frun-eval\u002FSKILL.md",[115,116],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[118,89],"run eval",{"skillNo":120,"name":121,"nameZh":122,"description":123,"descriptionZh":124,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":125,"categories":126,"keywords":129,"publishedAt":34},"01M699F6NR5Z4RTN5MWH5WYV9H","new-topic","Copilot Studio 主题创建","Create a new Copilot Studio topic YAML file. Use when the user asks to create a new topic, conversation flow, or dialog for their agent.","创建一个新的 Copilot Studio 主题（topic）YAML 文件。当用户要求为其智能体创建新主题、对话流程或对话框时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Fnew-topic\u002FSKILL.md",[127,128],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[130],"new topic",{"skillNo":132,"name":133,"nameZh":134,"description":135,"descriptionZh":136,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":141,"publishedAt":34},"01M699F2X4660A0NN18S2CDFVW","lookup-schema","Copilot Studio YAML 架构查询","Look up Copilot Studio YAML schema definitions. Use when the user asks about schema structure, element properties, or how to use a specific YAML kind.","查找 Copilot Studio YAML schema 定义。当用户询问 schema 结构、元素属性或如何使用特定 YAML kind 时使用。","https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fskills-for-copilot-studio\u002Fblob\u002Fmain\u002Fskills\u002Flookup-schema\u002FSKILL.md",[139,140],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},[142],"lookup schema"]