The docent in Microsoft 365 Copilot
This page is for anyone who adds the docent to a Microsoft 365 Copilot agent. ktl-docent-m365 is the docent as a custom skill for a Copilot declarative agent, not a skill of its own.
Copilot runs skills with no repository, shell or network. So the skill carries a snapshot of the bundle, and the docent answers from it.
1. Get the zip
Section titled “1. Get the zip”Download it from a release. There is nothing to install.
- Open the repository’s Releases page on GitHub.
- Under the release’s Assets, download
ktl-docent-m365-<tag>-<repository>.zip, where<repository>is the repository’s name or the name itsKNOWLEDGE_RELEASE_NAMEvariable sets.
The release workflow attaches it beside the bundle zip whenever the bundle changed. A release lacks it when the bundle did not change, or when the repository has no .lokf/m365/. When the bundle did not change, take the zip from the last release that carries one.
Or build it yourself. A repository on another forge, or on none, runs the same builder the release workflow runs, on its bundle folder. It needs bash and zip.
.lokf/m365/knowledge-m365.sh --repo-url https://github.com/me/my-repo --ref v1.2.0 .lokf/knowledge ./distIt creates dist/ktl-docent-m365/, with SKILL.md, SNAPSHOT.md (repository, revision, build date) and knowledge/, and dist/ktl-docent-m365.zip. In a git clone only tracked files are copied, and hidden files such as .obsidian/ are left out. With SOURCE_DATE_EPOCH set, one input gives one zip. The build writes nothing and exits 1 if a skill breaks one of Copilot’s limits. If something goes wrong lists them.
2. Add it to an agent
Section titled “2. Add it to an agent”First, check that your tenant has custom skills. They are in preview, only for organizations in Microsoft’s Frontier program, and not in tenants that use Information Barriers. Ask an admin if you are not sure. Without the preview, both routes below fail, and neither error says why: the toolkit’s provision refuses the agent_skills entry, and Agent Builder sends you to Copilot Studio. If something goes wrong quotes both errors.
Two routes take the same zip. Pick Agent Builder unless you already develop agents with the toolkit.
With Agent Builder, nothing installed.
- In Microsoft 365 Copilot, open Agent Builder. Create an agent, or open one you own.
- Add the zip as a skill. Agent Builder takes the skill as one zip. Microsoft’s page on custom skills in declarative agents shows where.
With the Agents Toolkit, for developers. This needs Node.js and a Microsoft 365 account that may add agents.
-
Install the Agents Toolkit CLI:
npm install -g @microsoft/m365agentstoolkit-cli, thenatk auth login m365. -
Create an agent, then change into the folder
atk newmade for it. Run every lateratkcommand there. To use an agent you have, change into its folder instead.Terminal window atk new -c declarative-agent -n my-docent -i falsecd my-docent -
Turn skills on for this shell, then add the zip from wherever you saved it. The toolkit turns skills on only when a variable is set, and the variable’s name depends on the version:
TEAMSFX_AGENT_SKILLSin the 1.1.17 release,ATK_FRONTIERfrom the 1.1.18 betas on. Export both, and the steps work with either:Terminal window export TEAMSFX_AGENT_SKILLS=true ATK_FRONTIER=trueatk add skill --from ../ktl-docent-m365-v1.2.0-my-repo.zip -i false -
In the same shell, run
atk provision --env dev, thenatk preview --env dev. The variable must still be set: without it, the toolkit packs the agent without the skill’s files but keeps its entry. Skipatk validatefor now, because it rejects theagent_skillsentry that step 3 wrote, as If something goes wrong explains.
Whichever route you take, an agent cannot have skills and embedded files together yet.
3. Ask it something
Section titled “3. Ask it something”Ask the agent a question the bundle answers, such as what a service does or who owns it. The answer names the snapshot, its version and build date, and each concept it rests on with a trust label, such as confirmed by a person or draft. An answer with no snapshot in it did not come from the skill.
When the docent cannot answer, or two concepts disagree, it ends with one line for you to paste into the repository’s .lokf/feedback.md, and SNAPSHOT.md says where to send it. It never records the gap itself. File the line in the repository, and the repository’s librarian turns it into a concept or a question for the curator.
Keep it current
Section titled “Keep it current”The snapshot does not update itself. After each release that changes the bundle, take the new zip and add it again. The workflow packs the skill only when the bundle changed, so a release that brings new instructions and the same bundle carries no new zip. Run the workflow by hand with force for that tag.
If something goes wrong
Section titled “If something goes wrong”- The release has no
ktl-docent-m365-…asset. Get the zip gives the two reasons, and where to take the zip from. - The build exits 1. The skill breaks one of Copilot’s limits, and the output names which:
SKILL.mdover 20,000 characters, folders more than 3 deep, file types Copilot does not accept, more than 350 files, more than 10 MB, or symbolic links. Nothing is written. - The build says
zip not found. The folder is built but not zipped. Installzip, or zip the folder yourself before adding it. atk add skillis not a command (UnknownCommandError). Export bothTEAMSFX_AGENT_SKILLS=trueandATK_FRONTIER=true, as Add it to an agent does. Which one your toolkit reads depends on the versionatk --versionprints.atk add skillsaysInvalidProjectError:m365agents.ymlnot found. The command ran outside the agent’s project. Change into the folderatk newcreated (cd my-docent), or add--folder ./my-docentto the command.atk validatesaysproperty name must be validforagent_skills. Toolkit 1.1.17 and the 1.1.18 betas check the agent against the v1.8 manifest schema, the newest published, which has noagent_skillsyet. The toolkit’s ownadd skillwrote the entry, so the zip is not at fault. Skipvalidate, and letprovisiondecide.atk provisionfails atteamsApp/validateAppPackagewithUnrecognized member 'agent_skills'. Microsoft’s service refused the entry, not just the local schema. Check that the tenant has custom skills, as Add it to an agent says. By thenteamsApp/createhas registered an app, whose IDprovisionprints asTEAMS_APP_ID. If you give up on this agent, delete that app in the Teams Developer Portal.- Agent Builder says skill attachments require the full Copilot Studio experience. Copy the agent to Copilot Studio from the top-right menu, and add the zip there. Copilot Studio needs its own licence or trial. If it says sign-up is disabled by your admin, the tenant has no licence for you, and only an admin can give you one.
- Agent Builder or the toolkit refuses the skill for another reason. Check whether the agent already has embedded files. That is a preview limit, not a fault in the zip.
How it is put together
Section titled “How it is put together”One pattern for every read-only role. A KTL Copilot skill is an instructions file plus the snapshot. .lokf/m365/ holds one instructions file per role, named after the skill it becomes, and the builder packs each into its own zip. The docent is ktl-docent-m365.md. An auditor, the third line in three-lines.md, would be ktl-auditor-m365.md beside it, with no change to the builder, the workflow or the checks.
Why not the curator yet. The librarian and the sidecar need a repository and a shell. The curator could follow once an action lets the agent write to SharePoint and there is a way to record who confirmed what without a forge login. The curator’s domain-schemas.md holds the shape of that record.
Change the instructions. Edit ktl-docent-m365.md, which the build packs as the skill’s SKILL.md. It is named after the skill, not SKILL.md, so installers don’t list it as one. Its trust labels must match ktl-docent’s, and the repository checks enforce that. A host’s releases pack its own copy under .lokf/m365/, so a host that edits it changes what its readers’ Copilot follows.
Where the rest is written
Section titled “Where the rest is written”- What Copilot allows, what the toolkit checks, and how the curator’s needs map to Microsoft 365 are in the sidecar’s references/m365.md.
- Building on a host without git is in the sidecar’s portability.md.
- The release step that attaches the zip, and when it runs, is the
knowledge-release.yamlrow in ktl-sidecar’s SKILL.md. releasing.md says how a release comes about. - What the docent does with a question, step by step, is the instructions file itself, ktl-docent-m365.md.