Przejdź do treści
Biblioteka skilli
AI i agenci · Integracja z narzędziem

add-knowledge

/add-knowledge

Dodaje źródło wiedzy (strona publiczna, SharePoint, OneDrive lub wgrany plik) do lokalnie sklonowanego agenta Copilot Studio, zapisując nowoczesny YAML capabilities i knowledge.

Licencja
MIT
Ostatnia zmiana repozytorium
02.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 02.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Dodaje źródło wiedzy (strona publiczna, SharePoint, OneDrive lub wgrany plik) do lokalnie sklonowanego agenta Copilot Studio, zapisując nowoczesny YAML capabilities i knowledge.

Argumenty

/add-knowledge A URL (website / SharePoint / OneDrive) or a local file path, plus an optional name/description
Oryginalny opis (EN)

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.

Jak działa

  1. Authoritative schema — read this first
  2. Core Process
  3. Optional access pre-check (SharePoint / OneDrive)
Sekcje z nagłówków SKILL.md, w oryginale · 145 linii, 1 287 słów
Podgląd SKILL.md
---
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*)
---

# Add a Knowledge Source

You are a workflow that adds a **knowledge source** to a locally-cloned **Copilot Studio
agentic-loop** agent by writing modern `capabilities/knowledge` YAML. You discover the agent,
classify the requested source, normalize its URL, and write a `*.mcs.yml` component. You never invent
behavior the files do not support.

Initial request: $ARGUMENTS

Supports four source kinds: **Public Website**, **SharePoint**, **OneDrive**, and **Uploaded file**.

## Authoritative schema — read this first

The exact YAML for every source kind, the `capabilities/knowledge` file layout, filename
conventions, SharePoint/OneDrive URL normalization, best practices, and limitations live in a single
shared reference — **`reference/knowledge-schema.md`**. It is the source of truth; the
`copilot-studio-architect` agent uses the same file, so the two never drift. **Read it before writing
any YAML** and follow it exactly.

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')`.
If `plugin-paths.json` cannot be read, fall back to locating `reference/knowledge-schema.md` under the
installed plugin directory.

---

## Core Process

### 1. Locate the target agent (blocking)

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 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
   the filename prefix for source-backed knowledge components.
5. The knowledge folder is `<agent>/capabilities/knowledge/` (create it if missing). Uploaded files
   additionally use `<agent>/capabilities/knowledge/files/`.

### 2. Parse the arguments

Extract from `$ARGUMENTS`:

- The **URL** or **local file path** of the source.
- An optional **name** and/or **description**.

### 3. Classify, build, and save (per `reference/knowledge-schema.md`)

1. **Classify** the input into one of the four source kinds:
   - Require every URL source to be absolute HTTPS with no embedded username or password.
   - a `-my.sharepoint.*` host with `/personal/…` → **OneDrive**
     (`SharePointKnowledgeSource`, `targetKind: File`)
   - `*.sharepoint.com`, `*.sharepoint.us`, `*.sharepoint.cn`, or
     `*.sharepoint-mil.us` → **SharePoint** (`targetKind: File` for a file, `Folder` for a
     folder/library)
   - other absolute `https://` URL → **Public Website** (`WebsiteKnowledgeSource`), after applying
     the reference's public-site validation. Reject paths deeper than two nonempty segments and ask
     for a broader HTTPS base URL instead.
   - an existing, supported regular local file → **Uploaded file** (copy into `files/` +
     metadata-only sidecar). Do not treat directories or unsupported file types as uploads.
2. **Normalize** SharePoint/OneDrive URLs (direct path, `AllItems.aspx?id=` decode, sharing-link
   refusal, `%20` encoding) exactly as the reference specifies.
3. **(Optional) Verify access** — for **SharePoint/OneDrive** sources only, you may pre-check that
   the link is valid and the signed-in user can read it, before writing YAML (see "Optional access
   pre-check" below). This is opt-in and best-effort: skip it silently if it isn't configured.
4. **Generate** the YAML for the matching source kind using the reference's shapes and metadata
   rules (`componentName`, plus a genuinely descriptive `description`). Encode every value derived
   from user input, a URL, a path, or an existing file as a YAML-safe double-quoted scalar using
   `JSON.stringify(value)` semantics; never interpolate an external value as raw YAML structure.
5. **Save** using the reference's filename convention:
   - source-backed → `capabilities/knowledge/<schemaName>.<slug>_<id>.mcs.yml`
   - uploaded file → copy the file into `capabilities/knowledge/files/`, then write the
     metadata-only sidecar `capabilities/knowledge/files/<slug>_<id>.mcs.yml`
   Apply the reference's exact 100-character schema-name budget before writing. Check that the
   resulting component path does not already exist; regenerate the id on a component-name collision.
6. **Protect existing uploaded files.** Before copying, inspect the destination payload and all
   sidecars whose `mcs.metadata.componentName` names that payload:
   - If neither exists, copy the payload and create one sidecar.
   - If the payload or a matching sidecar exists, do **not** overwrite anything. Ask whether to
     replace the existing source or copy under a different payload name.
   - On explicit replacement, reuse the existing sidecar filename/suffix and update that sidecar;
     do not create a second sidecar. If zero or multiple matching sidecars make replacement
     ambiguous, stop and report the conflict.

### 4. Confirm

Tell the user what was created: the source kind, the resolved `siteUrl` (or copied file), and the
path of the written `*.mcs.yml`. Remind them the agent must be re-packed/pushed and (re)published for
the new knowledge to take effect. For source types not supported here (Dataverse, AI Search, SQL
Server, Graph connectors), point them to the Limitations section of the reference.

## Optional access pre-check (SharePoint / OneDrive)

For SharePoint/OneDrive links you can verify **up front** that the link resolves and the **signed-in
(author) user** can read it — without downloading the file — via a single Microsoft Graph call
(`GET /shares/{id}/driveItem`). This is **opt-in** (offer it, or run it when the user asks); never
block adding the source on it.

**⚠️ Delegated-permissions caveat — always state this.** SharePoint/OneDrive knowledge is retrieved
at runtime using **each end user's** permissions. This check runs as the author, so a ✅ result
confirms **your** access only — it does **not** guarantee end users of the agent can access the item.
Always pair the result with a reminder to ensure end users have access in SharePoint/OneDrive.

**How to run it.** Resolve `pluginRoot` from
`path.join(os.homedir(), '.copilot-studio-cli', 'plugin-paths.json')` (as in step "Authoritative
schema" above), then:

```bash
node "<pluginRoot>/scripts/verify-knowledge-access.bundle.js" --agent-dir "<agentDir>" "<url>"
```

- Add `--dry-run` to resolve the plan (encoded share id, Graph endpoint, scopes, `needsClientId`)
  **without** authenticating — useful to check setup first.
- It reuses the same per-agent Entra **public-client app id** the `/chat` skill saves. That app
  registration must **also** have the delegated Microsoft Graph permission **`Files.ReadWrite`**
  consented, and must be an app the user **owns** in the tenant. Microsoft documents
  `Files.ReadWrite` as the least-privileged delegated permission for `GET /shares`; although this
  script only issues a `GET`, the consent grants the app read/write access to files the signed-in
  user can access. Make that permission impact clear before asking the user to opt in. If
  `needsClientId` is true or auth/permission errors come back, explain the missing setup and
  **continue** adding the source anyway.
- Tokens are persisted only when OS-backed encrypted storage is available. Otherwise the check uses
  an in-memory cache for that run and never writes Graph credentials to plaintext storage.
- US Government, DoD, and China SharePoint hosts select their matching Graph and Microsoft Entra
  endpoints automatically. `--cloud <name>` can override inference when necessary.
- **`AADSTS65002` in an `error`** means the `--client-id` is a Microsoft **first-party/sample** app,
  which cannot obtain Graph tokens. Tell the user to supply **their own** Entra app registration
  (single-tenant, public client flows enabled, delegated Graph `Files.ReadWrite` consented). An app
  id that works for `/chat` (preauthorized for the Power Platform API) is **not** automatically valid
  for Graph. This is a setup issue, not a failure of the source — continue.

**Interpreting the JSON `status`:**

| `status` | Meaning | What to tell the user |
|---|---|---|
| `ok` | Dry-run plan resolved; no request was sent | inspect `needsClientId`, `authority`, and `scopes` before opting in |
| `accessible` | Link valid; author can read it | ✅ proceed — plus the end-user caveat above |
| `forbidden` | Access denied — no access **or** the link doesn't resolve (Graph `/shares` returns 403 for both) | ⚠️ re-copy the URL from the browser, confirm you (and end users) have access, then retry — you can still add it, but it returns nothing without access |
| `notfound` | Link didn't resolve (uncommon — `/shares` usually returns `forbidden` for bad links) | ❌ likely a wrong/renamed URL — re-copy it from the browser address bar |
| `skipped` | Not a SharePoint/OneDrive URL | no check needed |
| `error` | Setup/auth/network problem | note it's optional; continue adding the source |

Wersje

RepozytoriumWynikLicencja
Ta strona · microsoft/copilot-studio-plugin100MIT
microsoft/skills-for-copilot-studio84MIT

Migawka bazy z 13.11.2026 · wersja paczki 2f9ed6899e49 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100add-skill
    Dodaje Agent Skill do agenta Copilot Studio (wgrany z dysku jako SKILL.md lub zip albo z galerii Cat Agent Skills) i opcjonalnie importuje go do sklonowanego workspace w behaviors/.
  • 100okhp3-sharepoint-skill-foundry
    Projektuje, pisze, ocenia i planuje wdrożenie osobistego lub witrynowego skilla Copilot w SharePoint, zapisanego jako SKILL.md w bibliotece albo na liście.
  • 90studio-knowledge-architecture
    Projektuje warstwę wiedzy agenta Copilot Studio: źródła, ich zakres, uprawnienia, cytowania i odświeżanie.
  • 100microsoft-onedrive
    Czyta i zarządza plikami OneDrive i SharePoint przez Microsoft Graph, w tym wysyłaniem, pobieraniem i linkami do udostępniania.
  • 100okhp3-copilot-studio-skill-foundry
    Projektuje, pisze, ocenia i pakuje wielokrotnego użytku skill agenta Microsoft Copilot Studio, gdy zadaniową funkcję trzeba współdzielić między agentami opartymi na GitHub Copilot.
  • 84new-topic
    Tworzy nowy plik YAML tematu Copilot Studio dla przepływu rozmowy lub dialogu agenta.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.