add-knowledge
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.
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 3
- Forks
- 1
01 前言 Front Matter
- name
- add-knowledge
- metadata
- { "argument-hint": "A URL (website / SharePoint / OneDrive) or a local file path, plus an optional name/description" }
- 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.
- allowed-tools
- Read Write Glob Grep
02 资源文件 8
- 参考文档references/access-precheck.md4.2 KB
- 参考文档references/knowledge-schema.md5.2 KB
- 参考文档references/onedrive.md686 B
- 参考文档references/sharepoint-url.md1.3 KB
- 参考文档references/sharepoint.md1.2 KB
- 参考文档references/uploaded-file.md1.8 KB
- 参考文档references/website.md1.0 KB
- 脚本scripts/verify-knowledge-access.bundle.js616.9 KB
03 SKILL.md 正文
Add a Knowledge Source
Add one knowledge source to a locally-cloned Copilot Studio agentic-loop agent. This skill only authors local files; it does not push or publish. Never invent behavior the files do not support.
Initial request: $ARGUMENTS
1. Resolve the target and input
- If an agent workspace was supplied, resolve that exact directory first and require its
root-level
settings.mcs.yml. If it is missing, invalid, or ambiguous, stop and report the supplied target; never substitute a discovered workspace. Only when no workspace was supplied, auto-discover withGlob: **/settings.mcs.yml. A cloned agentic-loop workspace containssettings.mcs.ymlat its root. Never hardcode an agent name. - If none is found, tell the user this skill needs a locally-cloned agentic-loop agent. Direct
them to the
clone-agentworkflow, which usesmsagent agent create --agent-type MCSAgentwith either--mcs-clone-agent-idor--mcs-clone-agent-schemaname, plus the source environment and project root. Do not clone implicitly or bypass that workflow. Stop. - If several are found, ask the user which agent to add the knowledge to.
- Read the agent's
schemaNamefromsettings.mcs.yml(e.g.crbab_guitarcoach_dcF_b3) — it is the filename prefix for source-backed knowledge components. Parse the settings with an available local YAML parser. Verify a versionedcliagent-template and the GitHub Copilot harness:configuration.authoringModel: CliCopilotorconfiguration.recognizer.kind: CLICopilotRecognizer. If another harness or a non-CLI template is identified, stop before any writes. If identity is unknown, ask for clarification; do not infer support from the schema name or folder alone. - Extract the source URL or local file path, plus any requested name/description. Ask for missing input; do not create directories or files yet.
2. Select and load the authoring contract
Read only the references required for the selected source, completely, before writing any YAML or copying any payload. Resolve every reference from this skill's own directory, never from a plugin root or sibling skill. If a required reference cannot be read, stop and report its path.
Every source requires common schema and naming rules, plus:
| Input | Selected source reference | Additional required reference |
|---|---|---|
Absolute HTTPS URL on a -my.sharepoint.* host with /personal/... |
OneDrive file | SharePoint/OneDrive URL normalization |
HTTPS URL on *.sharepoint.com, *.sharepoint.us, *.sharepoint.cn, or *.sharepoint-mil.us |
SharePoint file/folder | SharePoint/OneDrive URL normalization |
| Other absolute HTTPS URL | Public website | None |
| Existing regular local file | Uploaded file | None |
All URLs must have no embedded username or password. Reject unsupported or ambiguous inputs and explain the problem; ask for a supported source rather than guessing. Apply the selected reference's validation before authoring.
3. Optional access check
Only for SharePoint/OneDrive, offer the author-only check or honor an explicit request for it.
Explain that each end user's permissions govern runtime retrieval: author access does not prove
end-user access. Explain that delegated Files.ReadWrite consent grants read/write access to files
the signed-in user can access, before asking the user to opt in.
Read access-check setup and results only after the user opts in, before authenticating. If the user declines, do not load it, resolve the helper, or authenticate. The check is optional and best-effort. If its reference/helper or setup is unavailable, report that the check could not run and continue adding the source without it.
4. Author and report
Follow the loaded common and selected-source contracts exactly. Encode externally derived YAML
strings using JSON.stringify(value) semantics. Check the 100-character schema-name budget and
component collisions before writing. Never overwrite an uploaded payload or sidecar without
explicit replacement consent; stop if replacement cannot identify exactly one existing sidecar.
Re-read and parse every written YAML artifact with an available local YAML parser. Verify
the selected source kind, exact normalized URL or relative payload path, unique component
identity, and 100-character schema budget against the loaded contracts. For uploads, verify
the copied file's bytes match the source. Review the diff (or before/after file inventory for
an untracked workspace): only the intended knowledge component and approved payload/sidecar
may change; preserve unrelated content and leave .config/, .mcs/, and agent.sync.yaml
untouched. If parsing, artifact validation, or diff review cannot complete, report the failure
and do not claim success.
Report the source kind, normalized siteUrl or copied file, and written component path. State that
the changes remain local. To upload a draft, direct the user to the deploy-agent workflow
(msagent agent deploy); to make the knowledge live, direct them to publish-agent
(msagent agent deploy --publish), which requires explicit publication confirmation.
Both routes require the registered MSAGENT project root and an explicit deployment ID or name;
the authored agent workspace is not the registration root. There is no standalone pack step.
Do not run either lifecycle workflow as part of adding knowledge. Use the common contract's
limitations for unsupported knowledge types.
04 同仓库更多 Skills
skill-1
description of skill 1
my-skill-1
description of my skill 1
get-us-weather
Get the current weather (temperature, sky conditions, wind, humidity) for any city or town in the United States. Use when the user asks about the current weather, temperature, or conditions in a US city, e.g. "what's the weather in Seattle" or "how hot is it in Austin right now".
get-us-temperature
MD2-162228 - Get the current observed temperature for any city or town in the United States. Use when the user asks for the current temperature, how hot or cold it is, or the temperature in a US city, e.g. "what is the temperature in Seattle" or "how cold is it in Austin right now".
pull-agent
Pull remote Copilot Studio agent changes into an existing registered MSAGENT project with `msagent agent pull`. Use when the user asks to pull, sync down, refresh, or download remote changes into a local agent project.
publish-agent
Push and publish a registered Copilot Studio agent with the `--publish` route of `msagent agent deploy`. Use when the user asks to publish, activate, or make a local MSAGENT project's agent live.