manage-agent
Skill486 starsChanged 8 months agoMITView on GitHub
Push/pull Copilot Studio agent content via the VS Code extension's LanguageServerHost LSP binary. Handles authentication (interactive browser login for push/pull, device code flow for chat token), sync push, sync pull, clone, and diff operations.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- gnekt/My-Brain-Is-Full-Crewtheir own version, first seen Oct 8, 2026
- 0gfoundation/0g-agent-skillstheir own version, first seen Sep 17, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- gnekt/My-Brain-Is-Full-Crew★ 3.9ksame name
- 0gfoundation/0g-agent-skills★ 15same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository30 other files it gives its agents.
- add-actionSkill
- add-adaptive-cardSkill
- add-generative-answersSkill
- add-global-variableSkill
- add-knowledgeSkill
- add-nodeSkill
- add-other-agentsSkill
- analyze-evalsSkill
- chat-directlineSkill
- chat-sdkSkill
- chat-with-agentSkill
- clone-agentSkill
- create-eval-setSkill
- create-evalSkill
- detect-modeSkill
- directline-chatSkill
- edit-actionSkill
- edit-agentSkill
- edit-triggersSkill
- int-patternsSkill
- int-project-contextSkill
- int-referenceSkill
- list-kindsSkill
- list-topicsSkill
- lookup-schemaSkill
- new-topicSkill
- run-evalSkill
- run-tests-kitSkill
- test-authSkill
- validateSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Copilot Studio VS Code extension: must be installed (ms-copilotstudio.vscode-copilotstudio).
- Very specific: line 40
Search for .mcs/conn.json in the workspace and nearby directories to find existing connection details.
- Distinctive: line 52
After ~90 days, the browser will open again for re-authentication
- Distinctive: line 60
Run with a 5-minute timeout:
- Very specific: line 109
All commands auto-detect the agent directory (finds the subfolder with .mcs/conn.json) and read connection details from it.
- Very specific: line 126
Important: Always pull before push to get fresh row versions.
- Very specific: line 179
When --url is provided, the script extracts environmentId and agentId from the URL and resolves environmentUrl and agentMgmtUrl …
- Very specific: line 221
After a successful push, if the user wants changes to be testable via /chat-with-agent or /run-tests
- Very specific: line 250
All commands output JSON to stdout with a status field:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Manage Agent
Push 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.
IMPORTANT: Do Not Modify Scripts
This 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:
- Report the error as-is — show the user the full error output
- 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
- Direct the user to raise an issue at https://github.com/microsoft/skills-for-copilot-studio/issues with the error output
- Suggest using the VS Code extension directly — the user can perform the same push/pull/clone operations from the Copilot Studio VS Code extension UI as a fallback
Prerequisites
- Copilot Studio VS Code extension must be installed (
ms-copilotstudio.vscode-copilotstudio). - Azure AD app registration (optional) — only needed for device code flow (
authcommand). If--client-idis omitted, the script uses VS Code's first-party client ID with interactive browser login instead. - Environment details — tenant ID, environment ID, environment URL, and agent management URL. These come from the
.mcs/conn.jsoninside a cloned agent workspace (created automatically during clone).
Dataverse URLs must be HTTPS origins on an organization hostname under
crm.dynamics.com, crm<number>.dynamics.com, crm.microsoftdynamics.us,
crm.appsplatform.us, or crm.dynamics.cn, without credentials, custom ports,
paths, queries, or fragments. Trailing slashes and the default HTTPS port are
accepted. Tenant IDs must be GUIDs or tenant domain names; agent IDs must be GUIDs.
Authenticated REST requests do not follow redirects. Accepting a sovereign-cloud
Dataverse hostname does not add sovereign-cloud authentication or discovery;
the existing authority and BAP endpoints are unchanged.
Phase 0: Resolve Configuration
Search for .mcs/conn.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.
Phase 1: Authenticate
There are two different auth flows depending on the operation:
For push / pull / clone / changes / list-agents (interactive browser login)
These 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.
- On first use, a browser window opens for Microsoft sign-in
- Tokens are cached in the OS credential store and silently refreshed for ~90 days
- After ~90 days, the browser will open again for re-authentication
No separate auth step is needed before push/pull. The commands handle token acquisition automatically. Just run the command directly (Phase 2).
For the auth command (device code flow — chat/test token)
The 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/pull.
Run with a 5-minute timeout:
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js auth \
--tenant-id "<tenantId>" \
--client-id "<clientId>" \
--environment-url "<environmentUrl>"Timeout: 300000ms (5 minutes) — set this on the Bash tool call.
Token caching and silent refresh
Tokens and MSAL refresh tokens are persisted in the OS credential store (macOS Keychain, Windows DPAPI, Linux secret-tool). After initial authentication:
- Access tokens are valid for ~1 hour
- Refresh tokens are valid for ~90 days
- The script automatically refreshes expired access tokens silently using the cached refresh token
- Re-authentication is only needed on the very first use or after ~90 days
When device code flow starts (auth command only)
The script emits a JSON line to stdout:
{"status":"device_code","userCode":"XXXXXXXX","verificationUri":"https://login.microsoft.com/device","message":"...","expiresIn":900}When you see this in the output, immediately tell the user:
Authentication Required
Please open {verificationUri} in your browser and enter code {userCode}
The command is waiting for you to complete sign-in. You have {expiresIn/60} minutes.
The command will automatically continue once the user completes authentication. Do NOT cancel the command — it is waiting for the browser sign-in to complete.
Two tokens are acquired sequentially (Copilot Studio API, then Dataverse API), so the user may need to authenticate twice on first use.
If the command completes with status: "ok"
Tokens are cached. Proceed to Phase 2.
If the command fails with device_code_expired
The user didn't authenticate in time. Re-run the auth command and remind them to authenticate promptly.
Phase 2: Execute Command
All commands auto-detect the agent directory (finds the subfolder with .mcs/conn.json) and read connection details from it.
Pull (download remote changes)
--client-id is optional. When omitted, uses VS Code's 1p client with interactive browser login.
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js pull \
--workspace "<path-to-agent-folder>" \
--tenant-id "<tenantId>" \
--environment-id "<envId>" \
--environment-url "<envUrl>" \
--agent-mgmt-url "<mgmtUrl>"Push (upload local changes)
Important: Always pull before push to get fresh row versions. If you push without pulling first, you'll get a ConcurrencyVersionMismatch error.
Push automatically validates all .mcs.yml files before pushing and blocks if there are errors. Add --force to bypass validation (not recommended).
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js push \
--workspace "<path-to-agent-folder>" \
--tenant-id "<tenantId>" \
--environment-id "<envId>" \
--environment-url "<envUrl>" \
--agent-mgmt-url "<mgmtUrl>"Validate (check YAML before pushing)
Validates all .mcs.yml files in the workspace using the LSP binary's full diagnostics (YAML structure, Power Fx, schema, cross-file references).
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js validate \
--workspace "<path-to-agent-folder>" \
--tenant-id "<tenantId>" \
--environment-id "<envId>" \
--environment-url "<envUrl>" \
--agent-mgmt-url "<mgmtUrl>"Returns JSON: { "valid": true|false, "summary": { "errors": N, "warnings": N }, "files": [...] }
Clone (download agent to new local folder)
Requires either --agent-id (the bot GUID from list-agents) or --url (a Copilot Studio web URL). Uses Island API token automatically.
With explicit IDs:
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js clone \
--workspace "<target-folder>" \
--tenant-id "<tenantId>" \
--environment-id "<envId>" \
--environment-url "<envUrl>" \
--agent-mgmt-url "<mgmtUrl>" \
--agent-id "<agentId>"With a Copilot Studio URL (recommended shortcut):
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js clone \
--workspace "<target-folder>" \
--tenant-id "<tenantId>" \
--url "https://copilotstudio.microsoft.com/environments/<envId>/bots/<agentId>/overview"When --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.
View Changes (diff local vs remote)
--client-id is optional. When omitted, uses VS Code's 1p client with interactive browser login.
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js changes \
--workspace "<path-to-agent-folder>" \
--tenant-id "<tenantId>" \
--environment-id "<envId>" \
--environment-url "<envUrl>" \
--agent-mgmt-url "<mgmtUrl>"Publish (make draft agent live)
Publishes the agent so that the current draft becomes the live version reachable by external clients (/chat-with-agent, /run-tests, Teams, etc.). Uses the Dataverse PvaPublish bound action directly (no LSP binary needed).
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?"
The command polls the publishedon field on the bot entity until the timestamp changes, confirming that publish has taken effect. Default timeout is 5 minutes.
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js publish \
--workspace "<path-to-agent-folder>" \
--tenant-id "<tenantId>" \
--environment-url "<envUrl>" \
[--timeout <ms>]Timeout: 300000ms (5 minutes) — set this on the Bash tool call.
Optional: --agent-id "<agentId>" overrides the bot ID from conn.json.
Publish output (success)
{"status":"ok","botId":"...","publishedOn":"2026-03-27T12:00:00Z","previousPublishedOn":"2026-03-26T10:00:00Z","durationMs":45000,"durationSeconds":45}When to publish
- After a successful
push, if the user wants changes to be testable via/chat-with-agentor/run-tests - In an improvement loop (edit → push → publish → test), publish is required between push and test
- The command confirms publish completion via API — do not use time-based waits
List Agents
Uses Dataverse REST API directly (no LSP binary needed). --client-id is optional.
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js list-agents \
--tenant-id "<tenantId>" \
--environment-url "<envUrl>" \
[--no-owner]By default lists only agents owned by the current user. Add --no-owner to list all unmanaged agents.
List Environments
Uses BAP REST API directly (no LSP binary needed). --client-id is optional.
node ${CLAUDE_SKILL_DIR}/../../scripts/manage-agent.bundle.js list-envs \
--tenant-id "<tenantId>"Output Format
All commands output JSON to stdout with a status field:
Device code prompt (during auth)
{"status":"device_code","userCode":"XXXXXXXX","verificationUri":"https://login.microsoft.com/device","message":"...","expiresIn":900}Success
{"status":"ok","method":"powerplatformls/syncPull","result":{...}}Error
{"status":"error","error":"description of what went wrong"}Error Handling
| Error | Likely cause | Resolution |
| Extension not found | Copilot Studio VS Code extension not installed | Install from VS Code marketplace |
| LSP request timed out | Binary not responding or wrong protocol version | Check extension version, try updating |
| device_code_expired | User didn't authenticate in time | Re-run auth, authenticate promptly |
| ConcurrencyVersionMismatch | Push without fresh row versions | Pull first, then push |
| Token expired + silent refresh failed | Refresh token expired (~90 days) | Run auth command for new device code flow |
| Binary missing | Extension installed but binary not present | Reinstall the extension |
| PvaPublish failed | Insufficient permissions or bot not found | Verify the user has publish permissions and the agent ID is correct |
| Publish timed out | Publish still in progress after timeout | Increase --timeout or check the Copilot Studio UI for status |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

