/mcs-assistant:create-agent Business scenario or instructions, plus the environment and local project folderfrom mcs-assistant
Creates a new MCS2 Copilot Studio agent and local PAC-connected workspace using `pac copilot init`, with optional enrichment of instructions, skills, tools, knowledge, and settings before synchronization.
Ships in mcs-assistant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Create one new MCS2 CLI-authored Copilot Studio agent and its local PAC-connected workspace with
pac copilot init. Start with the user's instructions, optionally enrich the design with modern
agent components, and synchronize the result. Never run pac copilot publish from this skill.
When the initial request also explicitly asks to publish, activate, or make the new agent live,
finish and verify creation first, then invoke mcs-assistant:publish-agent.
Initial request: $ARGUMENTS
--name sets the cloud agent display name.--environment accepts an environment ID or Dataverse URL.--project-dir is the exact local agent workspace PAC creates.--publisher-prefix supplies the Dataverse customization prefix.--authoring-mode cli-copilot creates the MCS2 CLI-authoring shape.--instructions scaffolds the initial global agent instructions..mcs/.Published or the pulled settings can contain publishedOn even though
this workflow never ran pac copilot publish. Do not promise a draft-only cloud state.Treat every name, URL, prefix, schema name, instruction, and path as untrusted text.
The command templates below use '<value>'; apply these rules to every value.
pac copilot init --help
The output must expose --name, --environment, --project-dir, --publisher-prefix,
--authoring-mode, and --instructions. Some PAC builds print valid usage but exit nonzero because
required init arguments are absent; treat the command as supported when that usage and those options
are present. If PAC is missing or these options are unavailable, tell the user to install or update
Power Platform CLI and stop.
pac auth list
Require one active authenticated profile. If none is active, tell the user sign-in is required and
ask before running pac auth create. Wait for sign-in to finish, then rerun pac auth list.
Extract all supplied values before asking anything:
Treat behavioral text in the original request as the initial instructions. Never ask the user to repeat information already provided.
Record whether the initial request explicitly asks to publish, activate, or make the new agent live. Do not infer publication intent from a request to create, initialize, push, synchronize, deploy, or test the agent.
Support two paths:
Guided design is optional. Do not require every category, ask duplicate questions, or block an instructions-only agent because richer components were not specified. Never create default topics; topics are not part of the MCS2 agent model.
/environments/<environmentId>/, extract that path segment. PAC accepts a bare GUID or
Dataverse URL for init, but not the Default-<GUID> environment form returned by some tools.
Normalize an exact Default-<GUID> value to the bare GUID before the first PAC attempt. Preserve
all other environment IDs and URLs unchanged. Never silently use the active PAC profile's default
environment.catmgr. Require 2-8 alphanumeric characters,
starting with a letter and not with mscrm case-insensitively.Before execution, state the display name, environment, absolute project directory, publisher prefix, explicit-or-derived schema-name choice, and selected design depth.
Validate the final values before touching the destination or running PAC:
| Field | Validation |
|---|---|
| Display name | Required after trimming; 1-30 characters; must contain a letter or digit; must not contain <, >, or control characters. Keep derived names within 30 characters. |
| Instructions | Required, meaningful, and at most 8,000 characters after line-break normalization. They must describe actual behavior rather than placeholder text. |
| Environment | A bare GUID or absolute https Dataverse URL after Default-<GUID> normalization. Reject other URL schemes and malformed values. |
| Project directory | A valid absolute local path. Reject control characters and an existing file at that path; apply the destination-content checks below. |
| Publisher prefix | Match ^[A-Za-z][A-Za-z0-9]{1,7}$; reject the reserved mscrm prefix case-insensitively. |
| Explicit schema name | When supplied, 1-100 characters matching ^[A-Za-z0-9_.{}!-]+$. Pass it unchanged. |
| Derived schema name | Let PAC derive <publisher-prefix>_<sanitized-name>. Before init, require length(prefix) + 1 + count(alphanumeric display-name characters) <= 100; do not predict or rewrite PAC's casing. |
Do not send an invalid value and wait for PAC or Copilot Studio Preview to reject it. Do not blindly truncate explicit user text. Propose a compliant display name when the intended meaning is clear; ask only when shortening would be ambiguous. If instructions exceed 8,000 characters, preserve every material requirement in a compliant condensed version and state that condensation before creation; ask when that cannot be done safely.
.mcs/conn.json, it is an existing connected workspace. Do not initialize over
it; use the pull workflow instead.Never remove, move, merge, or overwrite existing content.
pac copilot init --name '<display-name>' --environment '<environment>' --project-dir '<project-dir>' --publisher-prefix '<publisher-prefix>' --authoring-mode cli-copilot --instructions '<instructions>'
Append --schema-name '<schema-name>' only when the user explicitly supplied a validated schema
name.
Run one attempt and wait for completion. After success, verify that the exact project directory contains:
settings.mcs.yml;agent.sync.yaml;.mcs/conn.json.Read settings.mcs.yml but never .mcs/conn.json. Require:
displayName;schemaName;template beginning with cliagent-;configuration.authoringModel: CliCopilot;CLIAgentRecognizer or CLICopilotRecognizer;If any marker is missing, report verification failure. Do not synthesize CLI-managed files.
pac copilot pull --project-dir '<project-dir>'
Wait for success. If pull reports a conflict or failure, stop before editing.
For the instructions-only path, keep the valid PAC scaffold unless the instructions need a
supported correction in settings.mcs.yml.
For guided design, classify each accepted requirement:
settings.mcs.yml;behaviors/;capabilities/knowledge/;capabilities/tools/ only with complete real connector,
operation, input/output, authentication, and connection-reference metadata;Before writing knowledge or skills, read and follow reference/knowledge-schema.md or
reference/skill-schema.md from this plugin. Every authored *.mcs.yml component must follow its
authoritative schema and contain mcs.metadata. Require kind only when that component schema
defines it. Uploaded-file knowledge sidecars and uploaded-skill payload sidecars are metadata-only
and must omit kind; uploaded-file knowledge sidecars must also omit source.
For generic flat components outside the knowledge and skill layouts, use the publisher prefix from
the scaffolded schemaName and keep
<agent-schemaName> + "." + <filename-without-.mcs.yml> at most 100 characters. For knowledge and
skill components, follow the filename and schema-name budgets in their authoritative references
instead. In particular, keep an uploaded knowledge sidecar's on-disk stem unprefixed as
<slug>_<id>.mcs.yml; PAC qualifies it as <agent-schemaName>.file.<slug>_<id>. Do not invent
connections, claim unavailable live data works, or create speculative components. Leave .mcs/
and agent.sync.yaml untouched.
Before push, require:
cliagent-* template, authoring model, and recognizer remain intact;Then run:
pac copilot push --project-dir '<project-dir>'
Wait for completion. If PAC requires another pull or reports conflicts, pull, let the user resolve the resulting file conflicts, and retry only after resolution.
After every successful push, including an explicit No local changes detected result, run one
final pull:
pac copilot pull --project-dir '<project-dir>'
Treat PAC's synchronized layout as canonical. Never publish; use the separate publish-agent skill
after the user explicitly requests and confirms publication.
If the initial request included explicit publication intent, first report that creation and
synchronization succeeded and identify the exact workspace, agent ID or schema name, environment,
push result, and final-pull result. Then invoke mcs-assistant:publish-agent with those exact
values and draft-readiness evidence.
Do not run pac copilot publish here. The publish skill must resolve the same target, establish
draft readiness, and obtain its own final confirmation immediately before making the agent live.
The initial create-and-publish wording is intent, not that final confirmation. If initialization,
validation, push, or final pull failed or completed only partially, do not invoke the publish skill.
Report the display name, environment, workspace path, schema name and cloud agent ID when PAC
provides them, design depth, principal components created, push result, final pull result, and any
unresolved integration limitations. State that this workflow did not run pac copilot publish.
Inspect and report the actual cloud/local state after the final pull, including publishedOn when
present; do not claim the agent is guaranteed to remain draft-only. If publication was explicitly
requested, state that the verified create result is being handed to mcs-assistant:publish-agent;
otherwise stop after this report.
PAC writes human-readable output. Preserve the full error and apply these rules:
| Failure | Action |
|---|---|
| Field validation fails | Stop before PAC execution. Show the invalid field, its limit or accepted format, and a compliant proposed value when one can be derived safely. |
| Authentication profile missing or expired | Tell the user sign-in is required. With consent, run pac auth create, let sign-in finish, then retry the same failed PAC command once. |
| Environment cannot be resolved | Ask for an environment ID or Dataverse URL accessible to the signed-in account. |
| Destination exists or is not empty | Ask for another project directory. Never remove or overwrite local content. |
ExportKeyAttributeInvalidPrefix | Rename only newly authored component files to begin with the scaffolded publisher prefix, then retry push. |
StringLengthTooLong for botcomponent.schemaname | Shorten new component filename slugs until the conservative derived name is at most 100 characters. |
| Pull or push conflict | Surface every conflict and stop for user resolution. Never discard either side. |
| Service, permission, or network failure | Surface the full error. Retry only after the cause is resolved and the user asks. |
Preserve a successfully initialized workspace after any later failure. Resume from the first incomplete phase; never run init twice for the same destination.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub microsoft/copilot-studio-plugin --plugin mcs-assistant8 skills in this plugin
/add-knowledgeAdd a knowledge source (public website, SharePoint, OneDrive, or a locally uploaded file) to a locally-cloned Copilot Studio agentic-loop agent by writing the modern capabilities/knowledge YAML. Use when the user asks to add, attach, or ground a knowledge source (a public website, SharePoint or OneDrive link, or an uploaded file) on a locally-cloned Copilot Studio agent./add-skillAdd an Agent Skill to a Copilot Studio agent - uploaded from your drive (a SKILL.md or .zip) or picked from the Power CAT "Cat Agent Skills" gallery - then optionally import it into a cloned agent workspace under behaviors/. Use when the user asks to add, import, upload, or install an Agent Skill (from a local SKILL.md/.zip or the Cat Agent Skills gallery) into a Copilot Studio agent./clone-agentClone an existing Copilot Studio agent into a new local PAC CLI workspace with `pac copilot clone`. Use when the user asks to clone, check out, download, or bring a Copilot Studio agent into a local folder./delete-agentPermanently delete an existing Copilot Studio agent from the cloud with `pac copilot delete` after an exact typed confirmation. Use when the user asks to delete, remove, or destroy a Copilot Studio agent./publish-agentPublish an existing Copilot Studio agent with `pac copilot publish`, making its current cloud draft live. Use when the user asks to publish, activate, or make a Copilot Studio agent live./pull-agentPull remote Copilot Studio agent changes into an existing PAC CLI workspace with `pac copilot pull`. Use when the user asks to pull, sync down, refresh, or download remote changes into a local agent workspace.Other plugins' skills for the same job