agentleFS
soulemikesoulemike/microsoft-skills/skills/copilotstudio/SKILL.md

copilotstudio

Skill2 starsChanged 3 months agoMITView on GitHub

Use this skill for Copilot Studio agent deployment and knowledge source management through Dataverse-backed REST operations.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when an agent needs to read Copilot Studio bot metadata, publish or unpublish a bot, or manage knowledge sources directly in …

    line 22
  2. Distinctive:

    Create, list, update, or delete Copilot Studio knowledge sources.

    line 27
  3. Distinctive:

    Avoid client secrets in production.

    line 73
  4. Distinctive:

    Create a knowledge source

    line 117

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Copilot Studio Skill

Agent Summary

Use this skill when an agent needs to read Copilot Studio bot metadata, publish or unpublish a bot, or manage knowledge sources directly in Dataverse. Supply a Dataverse context from ./skills/dataverse/Connect-DataverseApi.ps1.

When to Use

  • Query Copilot Studio bot metadata from the bots entity set.
  • Publish, unpublish, or update a Copilot Studio agent.
  • Create, list, update, or delete Copilot Studio knowledge sources.

Required Parameters

Get-CopilotAgentInfo.ps1

ParameterTypeRequiredNotes
ContexthashtableYesDataverse context from Connect-DataverseApi.ps1.
AgentIdstringNoRetrieve one bot record.
Selectstring[]NoOData projection.
FilterstringNoOData filter for list operations.

Deploy-CopilotAgent.ps1

ParameterTypeRequiredNotes
AgentIdstringYesCopilot Studio bot identifier.
ActionstringYesPublish, Unpublish, or Update.
ContexthashtableYesDataverse context.
AgentDatahashtableNoRequired for update flows or PATCH-based publish/unpublish fallback.
PublishActionNamestringNoDataverse bound action for publish.
UnpublishActionNamestringNoDataverse bound action for unpublish.

Manage-CopilotKnowledge.ps1

ParameterTypeRequiredNotes
OperationstringYesList, Get, Create, Update, or Delete.
ContexthashtableYesDataverse context.
AgentIdstringConditionalUseful for scoped list operations and some relationship bindings.
KnowledgeSourceIdstringConditionalRequired for Get, Update, and Delete.
KnowledgeSourceDatahashtableConditionalRequired for Create and Update.
KnowledgeEntitySetNamestringNoDefaults to knowledgesources.
AgentFilterFieldstringNoDefaults to _botid_value.

Example Agent Prompts

  • "List all Copilot Studio agents in this Dataverse environment."
  • "Publish a Copilot Studio agent by bot ID."
  • "Create a knowledge source and bind it to a Copilot Studio bot."

Example Agent Workflow

$ctx = ./skills/dataverse/Connect-DataverseApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud -EnvironmentUrl "https://contoso.crm.dynamics.com"

$agents = ./skills/copilotstudio/Get-CopilotAgentInfo.ps1 -Context $ctx -Select @('botid','name','statecode','statuscode')

Security Caveats

  • Copilot Studio is Dataverse-backed, so use Dataverse least-privilege roles and table permissions.
  • Avoid client secrets in production; prefer managed identity or federated credentials.
  • Bound action names and knowledge entity names can vary by environment, so verify them before writing automation that mutates data.

Overview

Manage Copilot Studio agents and knowledge sources using the Dataverse Web API. The scripts operate directly on Dataverse bots and knowledge source entity sets via REST, with token and endpoint details supplied through Connect-DataverseApi.ps1.

Authentication

  • Dataverse Web API token (use the Dataverse environment URL as the token audience, passed into Connect-DataverseApi.ps1 as -EnvironmentUrl)
  • Accepts context from Connect-DataverseApi.ps1 (or a compatible hashtable) with at least Token and BaseUri

Endpoints

Uses Dataverse environment URL as base (for example, https://contoso.crm.dynamics.com).

Skills

| File | Purpose | | Deploy-CopilotAgent.ps1 | Publish, unpublish, or update a Copilot Studio agent by PATCHing the Dataverse bots(<id>) record, or by POSTing a bound action at /bots(<id>)/Microsoft.Dynamics.CRM.<ActionName> | | Get-CopilotAgentInfo.ps1 | Retrieve Copilot Studio agent metadata from the Dataverse bots entity set, with optional OData $select and $filter, plus @odata.nextLink pagination | | Manage-CopilotKnowledge.ps1 | Perform CRUD operations for Copilot Studio knowledge sources in Dataverse, including optional agent scoping for List via an OData filter on AgentFilterField |

Patterns & Caveats

  • Copilot Studio is Dataverse-backed (agents use the bots entity set)
  • Publish/Unpublish can use bound actions or PATCH fallback
  • Knowledge source entity names vary by environment (default: knowledgesources)
  • Agent filter field varies by environment (default: _botid_value)
  • OData-MaxVersion and OData-Version headers required

Examples

3 practical examples: get agent info, publish agent, create knowledge source.

Get agent info

$context = Connect-DataverseApi.ps1 -AuthenticationType ManagedIdentity -EnvironmentUrl "https://contoso.crm.dynamics.com" -Environment AzureCloud
$agent = Get-CopilotAgentInfo.ps1 -Context $context -AgentId $agentId -Select @('botid', 'name', 'statecode', 'statuscode')

Publish an agent (bound action)

$context = Connect-DataverseApi.ps1 -AuthenticationType ClientCredentials -EnvironmentUrl "https://contoso.crm.dynamics.com" -Environment AzureCloud -TenantId $tenantId -ClientId $clientId -ClientSecret $clientSecret

Deploy-CopilotAgent.ps1 -Context $context -AgentId $agentId -Action Publish -PublishActionName 'PublishBot'

Create a knowledge source

$context = Connect-DataverseApi.ps1 -AuthenticationType Federated -EnvironmentUrl "https://contoso.crm.dynamics.com" -Environment AzureCloud -TenantId $tenantId -ClientId $clientId -FederatedToken $oidcToken

Manage-CopilotKnowledge.ps1 -Context $context -Operation Create -KnowledgeSourceData @{
  name = 'Docs'
  'bot@odata.bind' = "/bots($agentId)"
}

Prerequisites

  • Required modules
    • PowerShell 7.2+ (all scripts use #Requires -Version 7.2)
    • The repo’s shared helpers, skills/Common.psm1, loaded by each script
    • Connect-DataverseApi.ps1 (to build the required Dataverse REST context)
  • Required permissions
    • Dataverse privileges to read and write the bots entity set for Copilot Studio agents
    • Dataverse privileges for the target knowledge source entity set (default: knowledgesources) and any relationships required by your environment
    • Permission to invoke bound actions when you use -PublishActionName or -UnpublishActionName

Related Docs

  • Auth Patterns
  • Token Chaining
  • Environment Endpoints

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.