using-git-worktrees
OBobra/superpowers298k2,631 new stars in the last 7 days
Generate comprehensive documentation for Microsoft Copilot Studio agents from exported Dataverse solutions using the Power Platform CLI. Use when asked, to analyse the solution with the agents file and create documentation from the contents.
To generate documentation in a single file, follow this process, using the sections below to analyse and structure the agents within the /Agents/ folder in this repo.
Agents/<AgentName>/Docs/Agents/ folder# Locate the agent solution
ls Agents/<AgentName>/src/bots/
# List all bot components
ls Agents/<AgentName>/src/botcomponents/
Read key files in this order:
Agents/<AgentName>/src/Other/Solution.xml - Publisher, version, solution nameAgents/<AgentName>/src/bots/<prefix>_<agentname>/bot.xml - Agent metadataAgents/<AgentName>/src/bots/<prefix>_<agentname>/configuration.json - Agent configurationbotcomponents/<prefix>_<agent>.topic.<TopicName>/botcomponent.xml for topic name and statedata file for conversation logic (if present)botcomponents/<prefix>_<agent>.gpt.default/data filebotcomponents/<prefix>_<agent>.action.<Connector-Operation>/.action.ServiceNow-GetRecord, .action.ServiceNow-OrderitemAssets/botcomponent_connectionreferenceset.xmlbotcomponents/<prefix>_<agent>.InvokeConnectedAgentTaskAction.<ChildAgent>/InvokeConnectedAgentTaskAction components to route conversations.botcomponents/mspva_<GUID>/botcomponent.xml with <category>Testing</category><componenttype>19</componenttype><description> or <name> elements<parentbotid>)botcomponents/<componentschema>/
├── botcomponent.xml # Metadata (name, parent, state)
└── data # Optional binary/additional data
Other/Solution.xml - Publisher, version, localization settingsAssets/botcomponent_*.xml - Cross-cutting configuration setsRead Agents/<AgentName>/src/Other/Customizations.xml:
<connectionreference> elementsconnectorid (e.g., /providers/Microsoft.PowerApps/apis/shared_service-now)Read Agents/<AgentName>/src/unstructuredfilesearchentities/*.meta.xml:
<sourceurl> values (external API endpoints)<knowledgesource> codes)Agents may include Dataverse table search capabilities for querying business data. These are found in:
Agents/<AgentName>/src/dvtablesearchs/ - Search configurationsAgents/<AgentName>/src/dvtablesearchentities/ - Entity/table mappingsRelationship Structure:
dvtablesearch.xml defines a search configuration with a unique <dvtablesearchid>dvtablesearchentity.xml links to a search via <dvtablesearchid> and specifies the <entitylogicalname> (table)Analysis Process:
To find Dataverse table searches:
# Find all Dataverse table searches
ls Agents/<AgentName>/src/dvtablesearchs/
# Find all entity mappings
ls Agents/<AgentName>/src/dvtablesearchentities/
For each dvtablesearch:
dvtablesearchs/<guid>/dvtablesearch.xml - Extract search name and IDdvtablesearchid in dvtablesearchentitiesdvtablesearchentities/<guid>/dvtablesearchentity.xml - Extract entity logical name and display nameGenerate ERD Diagram: Create a Mermaid entity-relationship diagram showing:
erDiagram
DvTableSearch ||--o{ DvTableSearchEntity : "configures"
DvTableSearchEntity ||--|| DataverseTable : "queries"
DvTableSearch {
guid dvtablesearchid PK
string name
int searchtype
}
DvTableSearchEntity {
guid dvtablesearchentityid PK
guid dvtablesearchid FK
string entitylogicalname
string name
}
DataverseTable {
string entitylogicalname PK
string displayname
}
Example Mapping:
PeopleonAccount_Account_sKtInwp9Jyd91zLl63PSV (ID: c5010e77-c900-4bf1-898d-c4c0ab9eed30)account (Account table)Search for bot components with <category>Testing</category>:
grep -r "<category>Testing</category>" Agents/<AgentName>/src/botcomponents/ -l
For each testing component:
botcomponents/<guid>/botcomponent.xml<description> and <name> fields - these contain the test phrases<parentbotid> to identify which agent the test is forTest phrases are used for:
Create markdown file in Docs/<AgentName>.md with sections:
# <Agent Display Name>
**Solution Name:** <from Solution.xml>
**Version:** <from Solution.xml>
**Publisher:** <from Solution.xml>
## Overview
<Brief description of agent purpose>
## Agent Architecture
<Multi-agent diagram if applicable>
## Topics
### Standard Topics
- List ConversationStart, Greeting, Fallback, etc.
### Custom Topics
- Document business-specific conversation flows
## GPT Instructions
<System prompt summary>
## External Integrations
### Connectors
- **ServiceNow**: <list actions>
- **<OtherConnector>**: <list actions>
### Knowledge Sources
- URL: <sourceurl>
- Type: <description>
### Dataverse Tables
<If dvtablesearch components exist>
The agent has access to the following Dataverse tables for data queries:
#### Entity Relationship Diagram
```mermaid
erDiagram
<SearchName> ||--o{ <EntityName> : "searches"
<EntityName> {
string entitylogicalname
string displayname
}
| Search Name | Search ID | Entity | Description |
|---|---|---|---|
### Naming Conventions to Recognize
#### Component Schema Names
- Format: `<customizationprefix>_<logicalname>.<componenttype>.<descriptor>`
- Example: `cr667_primaryPortalAgent.InvokeConnectedAgentTaskAction.ClientExplorer`
- The prefix (e.g., `cr667`, `pkb`) comes from the Dataverse publisher
#### Topic Naming Patterns
- Standard: `.topic.Greeting`, `.topic.Fallback`, `.topic.OnError`
- Custom: `.topic.<Intent>_<GUID>` or `.topic.<FriendlyName>`
#### Action Naming Pattern
- Format: `.action.<ConnectorName>-<OperationName>`
- Example: `.action.ServiceNow-Getcatalogitems`
### Common Analysis Commands
```bash
# Count topics for an agent
ls Agents/<AgentName>/src/botcomponents/ | grep "\.topic\." | wc -l
# Find all connector actions
ls Agents/<AgentName>/src/botcomponents/ | grep "\.action\."
# Check for multi-agent orchestration
ls Agents/<AgentName>/src/botcomponents/ | grep "InvokeConnectedAgentTaskAction"
# Find external service URLs
grep -r "sourceurl\|connectorid" Agents/<AgentName>/src/
# List all agents in solution
ls Agents/<AgentName>/src/bots/
# Find all test phrases/evaluation sets
grep -r "<category>Testing</category>" Agents/<AgentName>/src/botcomponents/ -A 3
# Check for Dataverse table searches
ls Agents/<AgentName>/src/dvtablesearchs/ 2>/dev/null || echo "No Dataverse searches"
# List Dataverse entities
ls Agents/<AgentName>/src/dvtablesearchentities/ 2>/dev/null || echo "No Dataverse entities"
# Find entity-to-search mappings
grep -r "dvtablesearchid" Agents/<AgentName>/src/dvtablesearchentities/
Docs/ - Never create documentation in other foldersDocs/<AgentName>.mdThe multiagentdemo solution contains 5 agents:
ServiceNow integration found:
shared_service-nowhttps://<instance-name>.service-now.com/Solution.xml - Version, publisher, solution metadataCustomizations.xml - Connection references to external servicesbotcomponent_connectionreferenceset.xml - Bot-to-connector mappingsunstructuredfilesearchentities/*.meta.xml - Knowledge source URLsbotcomponents/*/botcomponent.xml - Individual component metadatabotcomponents/*/data - Individual component data filesbots/*/bot.xml - Top-level bot definitionsbots/*/configuration.json - Bot configuration settingsdvtablesearchs/*/dvtablesearch.xml - Dataverse table search configurationsdvtablesearchentities/*/dvtablesearchentity.xml - Dataverse entity/table mappingsWhen you are building references to files, navigate from the repo root, as the generated document can existing under a subfolder when generated.
OBobra/superpowers298k2,631 new stars in the last 7 days
OBobra/superpowers298k2,631 new stars in the last 7 days
OBobra/superpowers298k2,631 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days
MAmattpocock/skills288k10,178 new stars in the last 7 days