microsoft-skills
AGENTS.md2 starsChanged 3 months agoMITView on GitHub
This file is a machine-readable contract for AI coding agents. It describes the tools, auth patterns, and security boundaries available in this repository. Your agent can use this toolkit to:
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,774 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository13 other files it gives its agents.
- agents.mdAGENTS.md
- llms.txtllms.txt
- azureSkill
- copilotstudioSkill
- dataverseSkill
- graphSkill
- intuneSkill
- loganalyticsSkill
- powerplatformSkill
- sentinelSkill
- sharepoint-onlineSkill
- teamsSkill
- vm-guest-managementSkill
The file
We split this AGENTS.md into the rules it gives an agent
11 rules. About 1 is common, 6 are distinctive, and 4 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 97
No embedded secrets: Never hardcode passwords, client secrets, or certificates in scripts.
- Distinctive: line 100
Context isolation: Always pass explicit auth context objects.
- Very specific: line 104
Use -Prefix parameter with environment variables: PROD_TENANT_ID, PROD_CLIENT_ID
- Very specific: line 105
Use -Profile with config.yaml for centralized multi-tenant config
- Distinctive: line 163
All scripts follow consistent error patterns:
- Distinctive: line 179
Before using any skill:
- Distinctive: line 203
When adding a new skill:
- Distinctive: line 204
Follow the normalized auth parameter set defined in this contract
- Very specific: line 205
Use Common.psm1 for auth context resolution, REST execution, and pagination
- Very specific: line 207
Document service-specific caveats in docs/patterns-and-caveats.md
- Distinctive: line 208
Update the tool inventory in this file
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
Agent Contract — Microsoft Cloud API Skills
This file is a machine-readable contract for AI coding agents. It describes the tools, auth patterns, and security boundaries available in this repository.
Project Identity
- Name: Microsoft Cloud API Skills
- Type: PowerShell-native automation toolkit
- Scope: Unified authentication and API interaction for Microsoft Graph, Azure ARM, Sentinel, Log Analytics, Intune, Teams, Dataverse, Power Platform, Copilot Studio, and VM Guest Management
- License: MIT
- Repository: https://github.com/microsoft/cloud-api-skills
Agent Capabilities
Your agent can use this toolkit to:
- Authenticate securely to any Microsoft cloud service using a unified auth hierarchy
- Query and manage Azure resources, Entra ID objects, Sentinel incidents, Intune devices, Teams channels, Dataverse entities, and more
- Run KQL queries against Log Analytics workspaces
- Deploy and manage Copilot Studio agents via Dataverse
- Execute VM run commands and manage SSH keys securely
- Track and manage cloud assets through standardized inventory scaffolding with protocol, credential, and endpoint metadata
Tool Inventory
Connection Tools (Auth)
| Tool | Script Path | Purpose | Required Params | Optional Params |
connect_graph | skills/graph/Connect-GraphApi.ps1 | Auth to Microsoft Graph | -AuthenticationType, -Environment | -TenantId, -ClientId, -FederatedToken, -CertificatePath |
connect_azure | skills/azure/Connect-AzureApi.ps1 | Auth to Azure ARM | -AuthenticationType, -Environment | -TenantId, -ClientId, -SubscriptionId |
connect_loganalytics | skills/loganalytics/Connect-LogAnalyticsApi.ps1 | Auth to Log Analytics | -AuthenticationType, -Environment | -TenantId, -ClientId |
connect_dataverse | skills/dataverse/Connect-DataverseApi.ps1 | Auth to Dataverse | -AuthenticationType, -EnvironmentUrl | -TenantId, -ClientId |
connect_powerplatform | skills/powerplatform/Connect-PowerPlatformApi.ps1 | Auth to Power Platform BAP | -AuthenticationType, -Environment | -TenantId, -ClientId |
setup_auth_context | prerequisites/Setup-AuthenticationContext.ps1 | Auto-detect best auth method | -Resource | — |
Invocation Tools (Data Plane)
| Tool | Script Path | Purpose | Context Required |
invoke_graph_request | skills/graph/Invoke-GraphRequest.ps1 | Call any Graph API endpoint | Graph auth context |
invoke_azure_rest | skills/azure/Invoke-AzureRestMethod.ps1 | Call any Azure ARM endpoint | Azure auth context |
invoke_loganalytics_kql | skills/loganalytics/Invoke-LogAnalyticsKqlQuery.ps1 | Run KQL query | Log Analytics auth context |
invoke_dataverse_request | skills/dataverse/Invoke-DataverseRequest.ps1 | Call Dataverse Web API | Dataverse auth context |
invoke_sentinel_arm | skills/sentinel/Invoke-SentinelArmRequest.ps1 | Sentinel management plane | Azure auth context |
Specialized Tools
| Tool | Script Path | Purpose | Context Required |
get_sentinel_incidents | skills/sentinel/Get-SentinelIncident.ps1 | List Sentinel incidents | Azure auth context |
get_sentinel_alert_rules | skills/sentinel/Get-SentinelAlertRule.ps1 | List Sentinel alert rules | Azure auth context |
get_intune_devices | skills/intune/Get-IntuneDevice.ps1 | List Intune devices | Graph auth context |
get_intune_policies | skills/intune/Get-IntuneConfigurationPolicy.ps1 | List Intune config policies | Graph auth context |
get_teams_channels | skills/teams/Get-TeamsChannel.ps1 | List Teams channels | Graph auth context |
get_teams_members | skills/teams/Get-TeamsMember.ps1 | List Teams members | Graph auth context |
get_powerplatform_envs | skills/powerplatform/Get-PowerPlatformEnvironment.ps1 | List Power Platform environments | Power Platform auth context |
get_copilot_agent_info | skills/copilotstudio/Get-CopilotAgentInfo.ps1 | Get Copilot agent info | Dataverse auth context |
deploy_copilot_agent | skills/copilotstudio/Deploy-CopilotAgent.ps1 | Deploy/publish Copilot agent | Dataverse auth context |
manage_copilot_knowledge | skills/copilotstudio/Manage-CopilotKnowledge.ps1 | Manage Copilot knowledge sources | Dataverse auth context |
invoke_vm_run_command | skills/vm-guest-management/Invoke-VmRunCommand.ps1 | Execute command on Azure VM | Azure auth context |
connect_vm_bastion_ssh | skills/vm-guest-management/Connect-VmBastionSsh.ps1 | SSH via Azure Bastion | Azure auth context |
Auth Pattern
Step 1: Detect or Configure Auth
# Option A: Auto-detect the best auth method for a resource
$authContext = ./prerequisites/Setup-AuthenticationContext.ps1 -Resource "https://management.azure.com/"
# Option B: Explicit auth with full control
$graphCtx = ./skills/graph/Connect-GraphApi.ps1 `
-AuthenticationType ManagedIdentity `
-Environment AzureCloudStep 2: Use the Context
# Pass the context object to invocation scripts
./skills/graph/Invoke-GraphRequest.ps1 -Context $graphCtx -Uri "/users?`$select=id,displayName,mail"Step 3: Multi-Tenant Safety
# Use prefixed environment variables for multiple tenants
$prod = ./skills/graph/Connect-GraphApi.ps1 -Prefix "PROD" -Environment AzureCloud
$gov = ./skills/graph/Connect-GraphApi.ps1 -Prefix "GOV" -Environment AzureUSGovernmentSecurity Boundaries
Hard Rules
- No embedded secrets. Never hardcode passwords, client secrets, or certificates in scripts.
- Auth hierarchy is enforced. Managed Identity > Federated > Certificate > Client Secret. Using client secrets emits a mandatory runtime warning.
- No interactive auth. Device code and browser login are not supported in skill execution.
- Context isolation. Always pass explicit auth context objects. Never rely on global session state.
Secret Management
- Use
-Prefixparameter with environment variables:PROD_TENANT_ID,PROD_CLIENT_ID - Use
-Profilewithconfig.yamlfor centralized multi-tenant config - For certificates, use secure paths and
SecureStringfor passwords - For Key Vault integration, see
docs/secret-management.md
Common Workflows
Workflow: List Sentinel Incidents from Last 24 Hours
# 1. Setup auth (auto-detect)
$ctx = ./prerequisites/Setup-AuthenticationContext.ps1 -Resource "https://management.azure.com/"
# 2. Get incidents
./skills/sentinel/Get-SentinelIncident.ps1 -AuthContext $ctx -WorkspaceName "my-workspace"Workflow: Run KQL Query Against Log Analytics
# 1. Connect to Log Analytics
$laCtx = ./skills/loganalytics/Connect-LogAnalyticsApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud
# 2. Run KQL
./skills/loganalytics/Invoke-LogAnalyticsKqlQuery.ps1 `
-AuthContext $laCtx `
-WorkspaceId "00000000-0000-0000-0000-000000000000" `
-Query "SecurityAlert | where TimeGenerated > ago(24h) | take 10"Workflow: List Intune Devices with Compliance Status
# 1. Connect to Graph (Intune uses Graph endpoints)
$graphCtx = ./skills/graph/Connect-GraphApi.ps1 -AuthenticationType ManagedIdentity -Environment AzureCloud
# 2. Get devices
./skills/intune/Get-IntuneDevice.ps1 -AuthContext $graphCtx
# 3. Get configuration policies
./skills/intune/Get-IntuneConfigurationPolicy.ps1 -AuthContext $graphCtxWorkflow: Query Dataverse Entities
# 1. Connect to Dataverse
$dvCtx = ./skills/dataverse/Connect-DataverseApi.ps1 `
-AuthenticationType ManagedIdentity `
-EnvironmentUrl "https://contoso.crm.dynamics.com"
# 2. Query accounts
./skills/dataverse/Invoke-DataverseRequest.ps1 `
-AuthContext $dvCtx `
-Uri "/accounts?`$select=accountid,name&`$top=50"Error Handling
All scripts follow consistent error patterns:
- Validate required auth context fields before execution
- Throw on auth failures with descriptive messages
- Return structured output (arrays/hashtables) on success
- Emit warnings (not errors) for client secret usage
Environment Support
- AzureCloud (Commercial)
- AzureUSGovernment (US Gov)
- AzureChinaCloud (China)
All Connect-* scripts accept -Environment parameter. Endpoint resolution is handled automatically.
Prerequisites
Before using any skill:
# Install required modules
./prerequisites/Install-RequiredModules.ps1
# Verify environment
./prerequisites/Test-Prerequisites.ps1
# (Optional) Load .env file
Import-Module ./skills/Common.psm1
Load-DotEnv -Path "./.env"MCP Server
This repository includes an MCP (Model Context Protocol) server for agent integration.
- Location:
mcp/ - Purpose: Expose all Connect/Invoke tools as MCP tools for Claude Code, Codex, Cursor, and other MCP-compatible agents
- Setup: See
mcp/README.md
Contributing
When adding a new skill:
- Follow the normalized auth parameter set defined in this contract
- Use
Common.psm1for auth context resolution, REST execution, and pagination - Emit the mandatory warning if client secret auth is used
- Document service-specific caveats in
docs/patterns-and-caveats.md - Update the tool inventory in this file
Documentation Index
| Document | Purpose |
README.md | Project overview and quickstart |
llms.txt | Concise agent discovery context |
docs/asset-tracking.md | Cloud asset inventory tracking and management |
docs/auth-patterns.md | Auth method selection guide |
docs/secret-management.md | Secret hierarchy and handling rules |
docs/multi-tenant-auth.md | Multi-context session management |
docs/patterns-and-caveats.md | Operational lessons learned |
docs/environment-endpoints.md | Cross-cloud endpoint mapping |
skills/*/SKILL.md | Per-service patterns and examples |
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
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.

