agentleFS
soulemikesoulemike/microsoft-skills/AGENTS.md

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.

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
  1. Common:

    No embedded secrets: Never hardcode passwords, client secrets, or certificates in scripts.

    line 97
  2. Distinctive:

    Context isolation: Always pass explicit auth context objects.

    line 100
  3. Very specific:

    Use -Prefix parameter with environment variables: PROD_TENANT_ID, PROD_CLIENT_ID

    line 104
  4. Very specific:

    Use -Profile with config.yaml for centralized multi-tenant config

    line 105
  5. Distinctive:

    All scripts follow consistent error patterns:

    line 163
  6. Distinctive:

    Before using any skill:

    line 179
  7. Distinctive:

    When adding a new skill:

    line 203
  8. Distinctive:

    Follow the normalized auth parameter set defined in this contract

    line 204
  9. Very specific:

    Use Common.psm1 for auth context resolution, REST execution, and pagination

    line 205
  10. Very specific:

    Document service-specific caveats in docs/patterns-and-caveats.md

    line 207
  11. Distinctive:

    Update the tool inventory in this file

    line 208

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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:

  1. Authenticate securely to any Microsoft cloud service using a unified auth hierarchy
  2. Query and manage Azure resources, Entra ID objects, Sentinel incidents, Intune devices, Teams channels, Dataverse entities, and more
  3. Run KQL queries against Log Analytics workspaces
  4. Deploy and manage Copilot Studio agents via Dataverse
  5. Execute VM run commands and manage SSH keys securely
  6. Track and manage cloud assets through standardized inventory scaffolding with protocol, credential, and endpoint metadata

Tool Inventory

Connection Tools (Auth)

ToolScript PathPurposeRequired ParamsOptional Params
connect_graphskills/graph/Connect-GraphApi.ps1Auth to Microsoft Graph-AuthenticationType, -Environment-TenantId, -ClientId, -FederatedToken, -CertificatePath
connect_azureskills/azure/Connect-AzureApi.ps1Auth to Azure ARM-AuthenticationType, -Environment-TenantId, -ClientId, -SubscriptionId
connect_loganalyticsskills/loganalytics/Connect-LogAnalyticsApi.ps1Auth to Log Analytics-AuthenticationType, -Environment-TenantId, -ClientId
connect_dataverseskills/dataverse/Connect-DataverseApi.ps1Auth to Dataverse-AuthenticationType, -EnvironmentUrl-TenantId, -ClientId
connect_powerplatformskills/powerplatform/Connect-PowerPlatformApi.ps1Auth to Power Platform BAP-AuthenticationType, -Environment-TenantId, -ClientId
setup_auth_contextprerequisites/Setup-AuthenticationContext.ps1Auto-detect best auth method-Resource—

Invocation Tools (Data Plane)

ToolScript PathPurposeContext Required
invoke_graph_requestskills/graph/Invoke-GraphRequest.ps1Call any Graph API endpointGraph auth context
invoke_azure_restskills/azure/Invoke-AzureRestMethod.ps1Call any Azure ARM endpointAzure auth context
invoke_loganalytics_kqlskills/loganalytics/Invoke-LogAnalyticsKqlQuery.ps1Run KQL queryLog Analytics auth context
invoke_dataverse_requestskills/dataverse/Invoke-DataverseRequest.ps1Call Dataverse Web APIDataverse auth context
invoke_sentinel_armskills/sentinel/Invoke-SentinelArmRequest.ps1Sentinel management planeAzure auth context

Specialized Tools

ToolScript PathPurposeContext Required
get_sentinel_incidentsskills/sentinel/Get-SentinelIncident.ps1List Sentinel incidentsAzure auth context
get_sentinel_alert_rulesskills/sentinel/Get-SentinelAlertRule.ps1List Sentinel alert rulesAzure auth context
get_intune_devicesskills/intune/Get-IntuneDevice.ps1List Intune devicesGraph auth context
get_intune_policiesskills/intune/Get-IntuneConfigurationPolicy.ps1List Intune config policiesGraph auth context
get_teams_channelsskills/teams/Get-TeamsChannel.ps1List Teams channelsGraph auth context
get_teams_membersskills/teams/Get-TeamsMember.ps1List Teams membersGraph auth context
get_powerplatform_envsskills/powerplatform/Get-PowerPlatformEnvironment.ps1List Power Platform environmentsPower Platform auth context
get_copilot_agent_infoskills/copilotstudio/Get-CopilotAgentInfo.ps1Get Copilot agent infoDataverse auth context
deploy_copilot_agentskills/copilotstudio/Deploy-CopilotAgent.ps1Deploy/publish Copilot agentDataverse auth context
manage_copilot_knowledgeskills/copilotstudio/Manage-CopilotKnowledge.ps1Manage Copilot knowledge sourcesDataverse auth context
invoke_vm_run_commandskills/vm-guest-management/Invoke-VmRunCommand.ps1Execute command on Azure VMAzure auth context
connect_vm_bastion_sshskills/vm-guest-management/Connect-VmBastionSsh.ps1SSH via Azure BastionAzure 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 AzureCloud

Step 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 AzureUSGovernment

Security Boundaries

Hard Rules

  1. No embedded secrets. Never hardcode passwords, client secrets, or certificates in scripts.
  2. Auth hierarchy is enforced. Managed Identity > Federated > Certificate > Client Secret. Using client secrets emits a mandatory runtime warning.
  3. No interactive auth. Device code and browser login are not supported in skill execution.
  4. Context isolation. Always pass explicit auth context objects. Never rely on global session state.

Secret Management

  • Use -Prefix parameter with environment variables: PROD_TENANT_ID, PROD_CLIENT_ID
  • Use -Profile with config.yaml for centralized multi-tenant config
  • For certificates, use secure paths and SecureString for 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 $graphCtx

Workflow: 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:

  1. Follow the normalized auth parameter set defined in this contract
  2. Use Common.psm1 for auth context resolution, REST execution, and pagination
  3. Emit the mandatory warning if client secret auth is used
  4. Document service-specific caveats in docs/patterns-and-caveats.md
  5. Update the tool inventory in this file

Documentation Index

DocumentPurpose
README.mdProject overview and quickstart
llms.txtConcise agent discovery context
docs/asset-tracking.mdCloud asset inventory tracking and management
docs/auth-patterns.mdAuth method selection guide
docs/secret-management.mdSecret hierarchy and handling rules
docs/multi-tenant-auth.mdMulti-context session management
docs/patterns-and-caveats.mdOperational lessons learned
docs/environment-endpoints.mdCross-cloud endpoint mapping
skills/*/SKILL.mdPer-service patterns and examples

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.