Skip to content

Add msagent-backed agent lifecycle skills - #47

Draft
Anderson Silva (anderson-joyle) wants to merge 2 commits into
mainfrom
andersonf/msagent-skills
Draft

Anderson Silva (anderson-joyle) wants to merge 2 commits into
mainfrom
andersonf/msagent-skills

Conversation

@anderson-joyle

Copy link
Copy Markdown
Contributor

Summary

  • add msagent-backed skills for authentication, agent listing, clone, pull, push, and publish
  • make the existing PAC manage agent an internal /migrate clone/push helper only
  • require exact account, agent, deployment, and environment resolution before cloud mutations
  • verify imported workspace bindings and revalidate authentication context after interactive login
  • document the msagent prerequisite and tested minimum version
  • add contract tests for skill discovery, command arguments, confirmation gates, and target-safety invariants

Behavior changes

  • push-agent deploys local content to an explicitly selected dev deployment without publishing
  • publish-agent explicitly confirms that current local content will be deployed and then made live
  • pull, push, and publish always resolve and pass an exact agentId
  • interactive connection binding is handed back to the user's terminal unless exact non-interactive selectors are supplied
  • /migrate and /chat remain PAC-backed

Validation

  • npm test — 62 tests passed
  • validated documented options against msagent 0.1.49-beta CLI help
  • git diff --check passed
  • staged diff scanned for secret-like values
  • no live cloud mutations were run

Known existing issue

npm audit reports a high-severity CPU-denial-of-service advisory for the existing direct js-yaml dependency below 4.3.2. This branch does not change dependencies or the lockfile.

…on helper

Introduce six msagent-CLI-backed skills as the user-facing surface for
Copilot Studio agent lifecycle operations, replacing the PAC-based manage
agent for day-to-day use:

- agent-auth: sign in/status/switch/logout and environment select
- list-agents: msagent agent list (environment or tenant-wide)
- clone-agent: msagent agent create (clone mode) into a new project
- pull-agent: msagent agent pull into a registered project
- push-agent: msagent agent deploy to a dev deployment slot (no publish)
- publish-agent: msagent agent deploy --publish, behind a confirmation gate

Re-scope agents/copilot-studio-manage.md to an INTERNAL migration-only
helper used by /migrate for its PAC clone+push. Narrow its description so it
no longer competes with the new skills, remove the Publish and List sections
and their workflow rules, and add a redirect table pointing users to the
skills.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fcaa5aa6-2684-4021-9bc4-bc40b27f5dca
Require exact account, agent, deployment, and environment resolution before
cloud mutations. Revalidate identity after login, verify imported workspace
bindings, accurately describe publish behavior, and avoid unsafe interactive
connection prompts.

Document the msagent prerequisite and add contract tests for the lifecycle
skill safety invariants.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: fcaa5aa6-2684-4021-9bc4-bc40b27f5dca
Copilot AI lite review requested due to automatic review settings September 25, 2026 22:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Unresolved correctness, safety-gate, workspace-discovery, escaping, and regression-test issues remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 5 Medium severity

Open (5)
What changed in this PR

Adds msagent-backed authentication and agent lifecycle skills while limiting PAC management to migration workflows.

Changes:

  • Adds auth, list, clone, pull, push, and publish skills.
  • Documents CLI prerequisites and adds contract tests.
  • Restricts PAC management to migration use.
File Summary
skills/​push-agent/​SKILL.md Dev-slot deployment; unresolved escaping, workspace discovery, named deployment selection, and confirmation-gate issues.
skills/​pull-agent/​SKILL.md Cloud-to-local synchronization; unresolved apostrophe escaping issue.
skills/​publish-agent/​SKILL.md Publishing workflow; unresolved environment resolution, workspace discovery, and apostrophe escaping issues.
skills/​list-agents/​SKILL.md Agent discovery workflow.
skills/​clone-agent/​SKILL.md Agent cloning; unresolved apostrophe escaping and target-environment resolution issues.
skills/​agent-auth/​SKILL.md Authentication workflow; unresolved apostrophe escaping issue.
scripts/​test/​msagent-skill-contracts.test.js Lifecycle contract tests; unresolved command-scoping and migration-command regression guards.
README.md CLI prerequisite documentation.
agents/​copilot-studio-manage.md Migration-only PAC management scope.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +50 to +54
2. Otherwise auto-discover with `Glob: **/.config/agent.config.json` and present a numbered
pick-list; never silently use the first match.
3. If the only candidate is an unregistered workspace, follow
**Register an unregistered workspace safely** below before continuing.
4. If nothing usable is found, tell the user publish needs a registered project, and ask for a folder.
Comment on lines +72 to +75
- Choose the deployment slot to publish. If the user named one, require exactly one match within
that agent's deployments. Otherwise present a numbered list (`deploymentName`, `deploymentType`,
`environmentId`) and let the user pick. If there are no deployments, tell the user to use the
`push-agent` skill first.
Comment on lines +49 to +53
2. Otherwise auto-discover with `Glob: **/.config/agent.config.json` and present a numbered
pick-list; never silently use the first match.
3. If the only candidate is an unregistered workspace (`settings.mcs.yml` + `.mcs\conn.json`, no
`.config`), follow **Register an unregistered workspace safely** below before continuing.
4. If nothing usable is found, tell the user push needs a registered project, and ask for a folder.
Comment on lines +74 to +76
- **Existing dev slot:** prefer a deployment whose `deploymentType` is `dev`. If exactly one, use its
`deploymentName`. If several, present a pick-list. If its `environmentId` is absent, use the
selected agent's home `environmentId` when displaying and confirming the target.
Comment on lines +77 to +82
- **No dev slot:** offer to create one. Ask the user for a slot name (4–42 chars, `[-a-zA-Z0-9_]`) or
propose one, then:

```bash
msagent deployment create --project '<project>' --agent-id '<agentId>' --deployment-name '<name>' --deployment-type dev --json --non-interactive
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants