agentleFS
MicrosoftKnown publishermicrosoft/AgentHosting.Cli/.github/plugins/msagent-assistant/skills/add-knowledge/SKILL.md

add-knowledge

Skill3 starsChanged 6 days agoMITView on GitHub

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.

4 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 9 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Add one knowledge source to a locally-cloned Copilot Studio agentic-loop agent.

    line 11
  2. Very specific:

    If an agent workspace was supplied, resolve that exact directory first and require its root-level settings.mcs.yml.

    line 18
  3. Distinctive:

    If none is found, tell the user this skill needs a locally-cloned agentic-loop agent.

    line 23
  4. Distinctive:

    If several are found, ask the user which agent to add the knowledge to.

    line 27
  5. Very specific:

    Read the agent's schemaName from settings.mcs.yml (e.g.

    line 28
  6. Distinctive:

    Read only the references required for the selected source, completely, before writing any YAML or copying any payload.

    line 40
  7. Distinctive:

    Every source requires common schema and naming rules, plus:

    line 44
  8. Distinctive:

    All URLs must have no embedded username or password.

    line 53
  9. Distinctive:

    Only for SharePoint/OneDrive, offer the author-only check or honor an explicit request for it.

    line 59
  10. Distinctive:

    Read access-check setup and results only after the user opts in, before authenticating.

    line 64
  11. Very specific:

    Follow the loaded common and selected-source contracts exactly.

    line 71
  12. Distinctive:

    Do not run either lifecycle workflow as part of adding knowledge.

    line 91

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
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

  1. 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 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. Direct them to the clone-agent workflow, which uses msagent agent create --agent-type MCSAgent with either --mcs-clone-agent-id or --mcs-clone-agent-schemaname, plus the source environment and project root. Do not clone implicitly or bypass that workflow. 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. Parse the settings with an available local YAML parser. Verify a versioned cliagent- template and the GitHub Copilot harness: configuration.authoringModel: CliCopilot or configuration.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.
  5. 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:

InputSelected source referenceAdditional required reference
Absolute HTTPS URL on a -my.sharepoint.* host with /personal/...OneDrive fileSharePoint/OneDrive URL normalization
HTTPS URL on *.sharepoint.com, *.sharepoint.us, *.sharepoint.cn, or *.sharepoint-mil.usSharePoint file/folderSharePoint/OneDrive URL normalization
Other absolute HTTPS URLPublic websiteNone
Existing regular local fileUploaded fileNone

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.