From cdd01857e02b7671e906adf3d15359e3711b130a Mon Sep 17 00:00:00 2001 From: anderson-joyle Date: Fri, 25 Sep 2026 11:03:15 -0500 Subject: [PATCH] Migrate add-skill and add-knowledge from commands to skills The add-skill (#35) and add-knowledge (#33) features were introduced as slash commands, but were intended to be Agent Skills. Move each into skills//SKILL.md (matching the delete-agent skill layout): add a `name:` field, extend the description with a "Use when the user asks to..." trigger for auto-invocation, and reword self-references from "command" to "skill". Update the /add-skill and /add-knowledge references in copilot-studio-architect.md, reference/skill-schema.md, and reference/knowledge-schema.md accordingly. Scripts, schemas, and tests are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: fcaa5aa6-2684-4021-9bc4-bc40b27f5dca --- agents/copilot-studio-architect.md | 4 ++-- reference/knowledge-schema.md | 6 +++--- reference/skill-schema.md | 6 +++--- commands/add-knowledge.md => skills/add-knowledge/SKILL.md | 5 +++-- commands/add-skill.md => skills/add-skill/SKILL.md | 7 ++++--- 5 files changed, 15 insertions(+), 13 deletions(-) rename commands/add-knowledge.md => skills/add-knowledge/SKILL.md (96%) rename commands/add-skill.md => skills/add-skill/SKILL.md (96%) diff --git a/agents/copilot-studio-architect.md b/agents/copilot-studio-architect.md index 55f52c0..ab4e4e0 100644 --- a/agents/copilot-studio-architect.md +++ b/agents/copilot-studio-architect.md @@ -161,7 +161,7 @@ Knowledge components live in `capabilities\knowledge\` (source-backed sources) a The **authoritative knowledge-source schema** — every source kind (public website, SharePoint, OneDrive, uploaded file), the exact YAML shapes and fields, `targetKind` rules, filename conventions, and SharePoint/OneDrive URL normalization — lives in a single shared reference, -`reference/knowledge-schema.md`. Read it and follow it exactly; the `/add-knowledge` command uses the +`reference/knowledge-schema.md`. Read it and follow it exactly; the `add-knowledge` skill uses the same file, so the two never drift. Resolve its path via the plugin root: read `path.join(os.homedir(), '.copilot-studio-cli', 'plugin-paths.json')` to get `pluginRoot` for the current `mcs-assistant` plugin, then read `path.join(pluginRoot, 'reference', 'knowledge-schema.md')`. @@ -201,7 +201,7 @@ procedures. The **authoritative skill schema** — the inline and upload variants, the exact YAML shapes and fields, the `behaviors/` file layout, anchor/sidecar rules, folder naming, and schema-name conventions — lives in a single shared reference, `reference/skill-schema.md`. Read it and follow it -exactly; the `/add-skill` command and its importer use the same file, so the three never drift. +exactly; the `add-skill` skill and its importer use the same file, so the three never drift. Resolve its path via the plugin root: read `path.join(os.homedir(), '.copilot-studio-cli', 'plugin-paths.json')` to get `pluginRoot` for the current `mcs-assistant` plugin, then read `path.join(pluginRoot, 'reference', 'skill-schema.md')`. diff --git a/reference/knowledge-schema.md b/reference/knowledge-schema.md index f5e63ce..7da3b0d 100644 --- a/reference/knowledge-schema.md +++ b/reference/knowledge-schema.md @@ -1,7 +1,7 @@ # Knowledge Source Schema (authoritative) **Single source of truth** for how knowledge sources are represented in a modern Copilot Studio -**agentic-loop** agent (`capabilities/knowledge`). Both the `/add-knowledge` command and the +**agentic-loop** agent (`capabilities/knowledge`). Both the `add-knowledge` skill and the `copilot-studio-architect` agent consult this file — edit the schema **here only** so the two never drift. @@ -205,8 +205,8 @@ Require an absolute HTTPS URL with no embedded username or password before apply ## Optional: verifying a SharePoint/OneDrive link before adding You can pre-check that a SharePoint/OneDrive link is valid and readable **without downloading the -file**, using a single Microsoft Graph call (`GET /shares/{id}/driveItem`). The `/add-knowledge` -command exposes this as an **opt-in** step backed by `scripts/verify-knowledge-access.bundle.js`. +file**, using a single Microsoft Graph call (`GET /shares/{id}/driveItem`). The `add-knowledge` +skill exposes this as an **opt-in** step backed by `scripts/verify-knowledge-access.bundle.js`. - **What it proves:** the author can read the item (`200`), or Graph denied it (`403` — either no access *or* the link doesn't resolve; the `/shares` endpoint returns `403` for both, and rarely a diff --git a/reference/skill-schema.md b/reference/skill-schema.md index 9b38ba2..4036ca2 100644 --- a/reference/skill-schema.md +++ b/reference/skill-schema.md @@ -1,7 +1,7 @@ # Agent Skill Schema (authoritative) **Single source of truth** for how agent skills are represented in a modern Copilot Studio -**CLI agentic-loop** agent (`behaviors/`). The `/add-skill` command, the `scripts/add-skill.js` +**CLI agentic-loop** agent (`behaviors/`). The `add-skill` skill, the `scripts/add-skill.js` importer, and the `copilot-studio-architect` agent all consult this file — edit the schema **here only** so the three never drift. @@ -30,12 +30,12 @@ A skill is always `kind: InlineAgentSkill`, but it is materialized in one of two | Variant | Where the skill text lives | Marker | Emitted by | |---|---|---|---| | **Inline** | Embedded in the component's `content:` block | no `authoringSource` | `copilot-studio-architect` when authoring a new skill from an idea | -| **Upload** | A real `SKILL.md` file on disk, plus optional payload files | `authoringSource: Upload` | `/add-skill` import (`scripts/add-skill.js`), and a portal upload | +| **Upload** | A real `SKILL.md` file on disk, plus optional payload files | `authoringSource: Upload` | `add-skill` skill import (`scripts/add-skill.js`), and a portal upload | > **Open question — variant selection.** The platform accepts both, but there is currently no > documented rule for *when* an author should prefer one over the other, and no verified statement > that they are functionally equivalent at runtime. Until that is confirmed, keep using the variant -> each producer already emits (architect → inline; `/add-skill` → upload) and do not convert between +> each producer already emits (architect → inline; `add-skill` → upload) and do not convert between > them. Resolve this before relying on cross-variant behavior. ## File layout diff --git a/commands/add-knowledge.md b/skills/add-knowledge/SKILL.md similarity index 96% rename from commands/add-knowledge.md rename to skills/add-knowledge/SKILL.md index 2938eb2..008efce 100644 --- a/commands/add-knowledge.md +++ b/skills/add-knowledge/SKILL.md @@ -1,5 +1,6 @@ --- -description: Add 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. +name: add-knowledge +description: Add 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. argument-hint: A URL (website / SharePoint / OneDrive) or a local file path, plus an optional name/description allowed-tools: Read, Write, Glob, Grep, Bash(mkdir *), Bash(cp *), Bash(powershell *Copy-Item*), Bash(node *verify-knowledge-access.bundle.js*) --- @@ -37,7 +38,7 @@ installed plugin directory. 1. Auto-discover the cloned agent with `Glob: **/settings.mcs.yml`. A cloned agentic-loop workspace contains `settings.mcs.yml` at its root. **Never hardcode an agent name.** -2. If none is found, tell the user this command needs a **locally-cloned agentic-loop agent** (clone +2. If none is found, tell the user this skill needs a **locally-cloned agentic-loop agent** (clone one with `pac copilot clone`, or use `/migrate`). Stop. 3. If several are found, ask the user which agent to add the knowledge to. 4. Read the agent's **`schemaName`** from `settings.mcs.yml` (e.g. `crbab_guitarcoach_dcF_b3`) — it is diff --git a/commands/add-skill.md b/skills/add-skill/SKILL.md similarity index 96% rename from commands/add-skill.md rename to skills/add-skill/SKILL.md index 859fdd6..dbd8e6a 100644 --- a/commands/add-skill.md +++ b/skills/add-skill/SKILL.md @@ -1,5 +1,6 @@ --- -description: Add 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/. +name: add-skill +description: Add 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. argument-hint: Optional skill name/slug or a local path to a SKILL.md / .zip allowed-tools: Bash(node *add-skill.js*), Read, Glob, Grep --- @@ -18,7 +19,7 @@ folder), then optionally *import* it into a cloned Copilot Studio agent workspac the **portal-style `.mcs.yml` companions** (an anchor `skill.mcs.yml` plus per-file sidecars for bundle skills) so the on-disk layout matches a Copilot Studio portal import. Import only materializes files on disk; **publishing to the cloud is done from the VS Code Copilot Studio -extension** (Agent Changes view / sync push) afterward - this command never pushes. +extension** (Agent Changes view / sync push) afterward - this skill never pushes. Initial request: $ARGUMENTS @@ -178,7 +179,7 @@ Tell the user, concisely: - If imported: the `behaviors//` path created, the `.mcs.yml` companions written (or that it fell back to a bare skill, with the reason from `warnings`), and any other warnings; and that **publishing to the cloud is the next step, done from the VS Code Copilot Studio extension** (Agent - Changes view / sync push) - this command does not push. + Changes view / sync push) - this skill does not push. ## Error handling