Winmd API Search
GitHubOfficialCreated by Microsoft CorporationDistributed by GitHub
- Skill
- Tool integration
- Software development
- MIT
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
winmd-api-search provides a local, cache-based interface for discovering and inspecting Windows desktop APIs. By indexing WinMD metadata from the Windows Platform SDK, WinAppSDK, and project-specific NuGet packages, it allows developers to quickly find relevant APIs for platform capabilities like camera access, UI controls, or sensors. The skill enables both discovery of APIs based on natural language queries and direct lookup of specific type members, methods, and enumeration values, ensuring developers have accurate signature information without needing to build or restore projects.
What it does
- Generates a local JSON cache of Windows API metadata for fast querying.
- Searches for relevant APIs based on natural language capability descriptions.
- Retrieves detailed signatures, including methods, properties, and events for specific types.
- Lists available namespaces and types within the indexed cache.
- Provides enumeration values for specific Windows API types.
- Supports querying across the Windows Platform SDK, WinAppSDK, and local project dependencies.
When to use it
- When you need to identify which Windows API provides a specific system capability.
- When you need to verify exact method signatures or property types before writing code.
- When working in a Windows development environment and needing offline access to API metadata.
- When you need to explore available types within a specific namespace.
- When you have updated project dependencies and need to refresh the local API index.
Advantages
- Provides fast, offline access to API signatures without requiring full project builds.
- Includes baseline coverage for Windows Platform SDK and WinAppSDK by default.
- Supports discovery through keyword-based search and ranked results.
- Allows for precise lookup of members and enums for known API types.
- Integrates with existing project structures to include custom WinMD outputs.
Usage examples
- “How do I implement a camera capture feature in my Windows app?”
- The agent uses the search action to find relevant APIs like MediaCapture, providing the user with the correct namespace and type details.
- “Show me the members of the Microsoft.UI.Xaml.Controls.NavigationView class.”
- The agent executes the members action to list all available methods, properties, and events for the specified UI control.
- “What are the available values for the Microsoft.UI.Xaml.Visibility enum?”
- The agent uses the enums action to retrieve and display the specific enumeration values for the requested type.
- “List all namespaces starting with Microsoft.UI.”
- The agent filters and displays a list of namespaces matching the provided prefix to help the user browse the API surface.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/github/winmd-api-search/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip winmd-api-search.zip -d .agents/skills
Documentation by Microsoft Corporation
WinMD API Search
This skill helps you find the right Windows API for any capability and get its full details. It searches a local cache of all WinMD metadata from:
Windows Platform SDK — all
Windows.*WinRT APIs (always available, no restore needed)WinAppSDK / WinUI — bundled as a baseline in the cache generator (always available, no restore needed)
NuGet packages — any additional packages in restored projects that contain
.winmdfilesProject-output WinMD — class libraries (C++/WinRT, C#) that produce
.winmdas build output
Even on a fresh clone with no restore or build, you still get full Platform SDK + WinAppSDK coverage.
When to Use This Skill
User wants to build a feature and you need to find which API provides that capability
User asks "how do I do X?" where X involves a platform feature (camera, files, notifications, sensors, AI, etc.)
You need the exact methods, properties, events, or enumeration values of a type before writing code
You're unsure which control, class, or interface to use for a UI or system task
Prerequisites
.NET SDK 8.0 or later — required to build the cache generator. Install from dotnet.microsoft.com if not available.
Cache Setup (Required Before First Use)
All query and search commands read from a local JSON cache. You must generate the cache before running any queries.
# All projects in the repo (recommended for first run)
.\.github\skills\winmd-api-search\scripts\Update-WinMdCache.ps1
# Single project
.\.github\skills\winmd-api-search\scripts\Update-WinMdCache.ps1 -ProjectDir <project-folder>No project restore or build is needed for baseline coverage (Platform SDK + WinAppSDK). For additional NuGet packages, the project needs dotnet restore (which generates project.assets.json) or a packages.config file.
Cache is stored at Generated Files\winmd-cache\, deduplicated per-package+version.
What gets indexed
| Source | When available |
|---|---|
| Windows Platform SDK | Always (reads from local SDK install) |
| WinAppSDK (latest) | Always (bundled as baseline in cache generator) |
| WinAppSDK Runtime | When installed on the system (detected via Get-AppxPackage) |
| Project NuGet packages | After dotnet restore or with packages.config |
Project-output .winmd | After project build (class libraries that produce WinMD) |
Note: This cache directory should be in
.gitignore— it's generated, not source.
How to Use
Pick the path that matches the situation:
Discover — "I don't know which API to use"
The user describes a capability in their own words. You need to find the right API.
0. Ensure the cache exists
If the cache hasn't been generated yet, run Update-WinMdCache.ps1 first — see Cache Setup above.
1. Translate user language → search keywords
Map the user's daily language to programming terms. Try multiple variations:
| User says | Search keywords to try (in order) |
|---|---|
| "take a picture" | camera, capture, photo, MediaCapture |
| "load from disk" | file open, picker, FileOpen, StorageFile |
| "describe what's in it" | image description, Vision, Recognition |
| "show a popup" | dialog, flyout, popup, ContentDialog |
| "drag and drop" | drag, drop, DragDrop |
| "save settings" | settings, ApplicationData, LocalSettings |
Start with simple everyday words. If results are weak or irrelevant, try the more technical variation.
2. Run searches
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action search -Query "<keyword>"This returns ranked namespaces with top matching types and the JSON file path.
If results have low scores (below 60) or are irrelevant, fall back to searching online documentation:
Use web search to find the right API on Microsoft Learn, for example:
site:learn.microsoft.com/uwp/api <capability keywords>forWindows.*APIssite:learn.microsoft.com/windows/windows-app-sdk/api/winrt <capability keywords>forMicrosoft.*WinAppSDK APIs
Read the documentation pages to identify which type matches the user's requirement.
Once you know the type name, come back and use
-Action membersor-Action enumsto get the exact local signatures.
3. Read the JSON to choose the right API
Read the file at the path(s) from the top results. The JSON has all types in that namespace — full members, signatures, parameters, return types, enumeration values.
Read and decide which types and members fit the user's requirement.
4. Look up official documentation for context
The cache contains only signatures — no descriptions or usage guidance. For explanations, examples, and remarks, look up the type on Microsoft Learn:
| Namespace prefix | Documentation base URL |
|---|---|
Windows.* | https://learn.microsoft.com/uwp/api/{fully.qualified.typename} |
Microsoft.* (WinAppSDK) | https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/{fully.qualified.typename} |
For example, Microsoft.UI.Xaml.Controls.NavigationView maps to:
https://learn.microsoft.com/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.navigationview
5. Use the API knowledge to answer or write code
Lookup — "I know the API, show me the details"
You already know (or suspect) the type or namespace name. Go direct:
# Get all members of a known type
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action members -TypeName "Microsoft.UI.Xaml.Controls.NavigationView"
# Get enum values
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action enums -TypeName "Microsoft.UI.Xaml.Visibility"
# List all types in a namespace
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action types -Namespace "Microsoft.UI.Xaml.Controls"
# Browse namespaces
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action namespaces -Filter "Microsoft.UI"If you need full detail beyond what -Action members shows, use -Action search to get the JSON file path, then read the JSON file directly.
Other Commands
# List cached projects
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action projects
# List packages for a project
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action packages
# Show stats
.\.github\skills\winmd-api-search\scripts\Invoke-WinMdQuery.ps1 -Action statsIf only one project is cached,
-Projectis auto-selected. If multiple projects exist, add-Project <name>(use-Action projectsto see available names). In scan mode, manifest names include a short hash suffix to avoid collisions; you can pass the base project name without the suffix if it's unambiguous.
Search Scoring
The search ranks type names and member names against your query:
| Score | Match type | Example |
|---|---|---|
| 100 | Exact name | Button → Button |
| 80 | Starts with | Navigation → NavigationView |
| 60 | Contains | Dialog → ContentDialog |
| 50 | PascalCase initials | ASB → AutoSuggestBox |
| 40 | Multi-keyword AND | navigation item → NavigationViewItem |
| 20 | Fuzzy character match | NavVw → NavigationView |
Results are grouped by namespace. Higher-scored namespaces appear first.
Troubleshooting
| Issue | Fix |
|---|---|
| "Cache not found" | Run Update-WinMdCache.ps1 |
| "Multiple projects cached" | Add -Project <name> |
| "Namespace not found" | Use -Action namespaces to list available ones |
| "Type not found" | Use fully qualified name (e.g., Microsoft.UI.Xaml.Controls.Button) |
| Stale after NuGet update | Re-run Update-WinMdCache.ps1 |
| Cache in git history | Add Generated Files/ to .gitignore |
References
Windows Platform SDK API reference — documentation for
Windows.*namespacesWindows App SDK API reference — documentation for
Microsoft.*WinAppSDK namespaces
Files
- ATTRIBUTION.mdAdded by AutoGineer973 B
- LICENSE.txt1.1 KiB
- SKILL.md8.5 KiB
- scripts/Invoke-WinMdQuery.ps1Script18.8 KiB
- scripts/Update-WinMdCache.ps1Script7.4 KiB
- scripts/cache-generator/CacheGenerator.csproj1.4 KiB
- scripts/cache-generator/Directory.Build.props101 B
- scripts/cache-generator/Directory.Build.targets95 B
- scripts/cache-generator/Directory.Packages.props108 B
- scripts/cache-generator/Program.csScript42.9 KiB
scripts/Update-WinMdCache.ps1
<#
.SYNOPSIS
Generate or refresh the WinMD cache for the Agent Skill.
.DESCRIPTION
Builds and runs the standalone cache generator to export cached JSON files
from all WinMD metadata found in project NuGet packages and Windows SDK.
The cache is per-package+version: if two projects reference the same
package at the same version, the WinMD data is parsed once and shared.
Supports single project or recursive scan of an entire repo.
.PARAMETER ProjectDir
Path to a project directory (contains .csproj/.vcxproj), or a project file itself.
Defaults to scanning the workspace root.
.PARAMETER Scan
Recursively discover all .csproj/.vcxproj files under ProjectDir.
.PARAMETER OutputDir
Path to the cache output directory. Defaults to "Generated Files\winmd-cache".
.EXAMPLE
.\Update-WinMdCache.ps1
.\Update-WinMdCache.ps1 -ProjectDir BlankWinUI
.\Update-WinMdCache.ps1 -Scan -ProjectDir .
.\Update-WinMdCache.ps1 -ProjectDir "src\MyApp\MyApp.csproj"
#>
[CmdletBinding()]
param(
[string]$ProjectDir,
[switch]$Scan,
[string]$OutputDir = 'Generated Files\winmd-cache'
)
$ErrorActionPreference = 'Stop'
# Convention: skill lives at .github/skills/winmd-api-search/scripts/
# so workspace root is 4 levels up from $PSScriptRoot.
$root = (Resolve-Path (Join-Path $PSScriptRoot '..\..\..\..')).Path
$generatorProj = Join-Path (Join-Path $PSScriptRoot 'cache-generator') 'CacheGenerator.csproj'
# ---------------------------------------------------------------------------
# WinAppSDK version detection -- look only at the repo root folder (no recursion)
# ---------------------------------------------------------------------------
function Get-WinAppSdkVersionFromDirectoryPackagesProps {
<#
.SYNOPSIS
Extract Microsoft.WindowsAppSDK version from a Directory.Packages.props
(Central Package Management) at the repo root.
#>
param([string]$RepoRoot)
$propsFile = Join-Path $RepoRoot 'Directory.Packages.props'
if (-not (Test-Path $propsFile)) { return $null }
try {
[xml]$xml = Get-Content $propsFile -Raw
$node = $xml.SelectNodes('//PackageVersion') |
Where-Object { $_.Include -eq 'Microsoft.WindowsAppSDK' } |
Select-Object -First 1
if ($node) { return $node.Version }
} catch {
Write-Verbose "Could not parse $propsFile : $_"
}
return $null
}
function Get-WinAppSdkVersionFromPackagesConfig {
<#
.SYNOPSIS
Extract Microsoft.WindowsAppSDK version from a packages.config at the repo root.
#>
param([string]$RepoRoot)
$configFile = Join-Path $RepoRoot 'packages.config'
if (-not (Test-Path $configFile)) { return $null }
try {
[xml]$xml = Get-Content $configFile -Raw
$node = $xml.SelectNodes('//package') |
Where-Object { $_.id -eq 'Microsoft.WindowsAppSDK' } |
Select-Object -First 1
if ($node) { return $node.version }
} catch {
Write-Verbose "Could not parse $configFile : $_"
}
return $null
}
# Try Directory.Packages.props first (CPM), then packages.config
$winAppSdkVersion = Get-WinAppSdkVersionFromDirectoryPackagesProps -RepoRoot $root
if (-not $winAppSdkVersion) {
$winAppSdkVersion = Get-WinAppSdkVersionFromPackagesConfig -RepoRoot $root
}
if ($winAppSdkVersion) {
Write-Host "Detected WinAppSDK version from repo: $winAppSdkVersion" -ForegroundColor Cyan
} else {
Write-Host "No WinAppSDK version found at repo root; will use latest (Version=*)" -ForegroundColor Yellow
}
# Default: if no ProjectDir, scan the workspace root
if (-not $ProjectDir) {
$ProjectDir = $root
$Scan = $true
}
Push-Location $root
try {
# Detect installed .NET SDK -- require >= 8.0, prefer stable over preview
$dotnetSdks = dotnet --list-sdks 2>$null
$bestMajor = $dotnetSdks |
Where-Object { $_ -notmatch 'preview|rc|alpha|beta' } |
ForEach-Object { if ($_ -match '^(\d+)\.') { [int]$Matches[1] } } |
Where-Object { $_ -ge 8 } |
Sort-Object -Descending |
Select-Object -First 1
# Fall back to preview SDKs if no stable SDK found
if (-not $bestMajor) {
$bestMajor = $dotnetSdks |
ForEach-Object { if ($_ -match '^(\d+)\.') { [int]$Matches[1] } } |
Where-Object { $_ -ge 8 } |
Sort-Object -Descending |
Select-Object -First 1
}
if (-not $bestMajor) {
Write-Error "No .NET SDK >= 8.0 found. Install from https://dotnet.microsoft.com/download"
exit 1
}
$targetFramework = "net$bestMajor.0"
Write-Host "Using .NET SDK: $targetFramework" -ForegroundColor Cyan
# Build MSBuild properties -- pass detected WinAppSDK version when available
$sdkVersionProp = ''
if ($winAppSdkVersion) {
$sdkVersionProp = "-p:WinAppSdkVersion=$winAppSdkVersion"
}
Write-Host "Building cache generator..." -ForegroundColor Cyan
$restoreArgs = @($generatorProj, "-p:TargetFramework=$targetFramework", '--nologo', '-v', 'q')
if ($sdkVersionProp) { $restoreArgs += $sdkVersionProp }
dotnet restore @restoreArgs
if ($LASTEXITCODE -ne 0) {
Write-Error "Restore failed"
exit 1
}
$buildArgs = @($generatorProj, '-c', 'Release', '--nologo', '-v', 'q', "-p:TargetFramework=$targetFramework", '--no-restore')
if ($sdkVersionProp) { $buildArgs += $sdkVersionProp }
dotnet build @buildArgs
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed"
exit 1
}
# Run the built executable directly (avoids dotnet run target framework mismatch issues)
$generatorDir = Join-Path $PSScriptRoot 'cache-generator'
$exePath = Join-Path $generatorDir "bin\Release\$targetFramework\CacheGenerator.exe"
if (-not (Test-Path $exePath)) {
# Fallback: try dll with dotnet
$dllPath = Join-Path $generatorDir "bin\Release\$targetFramework\CacheGenerator.dll"
if (Test-Path $dllPath) {
$exePath = $null
} else {
Write-Error "Built executable not found at: $exePath"
exit 1
}
}
$runArgs = @()
if ($Scan) {
$runArgs += '--scan'
}
# Detect installed WinAppSDK runtime via Get-AppxPackage (the WindowsApps
# folder is ACL-restricted so C# cannot enumerate it directly).
# WinMD files are architecture-independent metadata, so pick whichever arch
# matches the current OS to ensure the package is present.
$osArch = [System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture.ToString()
$runtimePkg = Get-AppxPackage -Name 'Microsoft.WindowsAppRuntime.*' -ErrorAction SilentlyContinue |
Where-Object { $_.Name -notmatch 'CBS' -and $_.Architecture -eq $osArch } |
Sort-Object -Property Version -Descending |
Select-Object -First 1
if ($runtimePkg -and $runtimePkg.InstallLocation -and (Test-Path $runtimePkg.InstallLocation)) {
Write-Host "Detected WinAppSDK runtime: $($runtimePkg.Name) v$($runtimePkg.Version)" -ForegroundColor Cyan
$runArgs += '--winappsdk-runtime'
$runArgs += $runtimePkg.InstallLocation
}
$runArgs += $ProjectDir
$runArgs += $OutputDir
Write-Host "Exporting WinMD cache..." -ForegroundColor Cyan
if ($exePath) {
& $exePath @runArgs
} else {
dotnet $dllPath @runArgs
}
if ($LASTEXITCODE -ne 0) {
Write-Error "Cache export failed"
exit 1
}
Write-Host "Cache updated at: $OutputDir" -ForegroundColor Green
} finally {
Pop-Location
}
Requirements and compatibility
Written for: GitHub Copilot
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Microsoft Corporation
- Publisher
- GitHub (Official)
- Distributed by
- GitHub
- Source
- github/awesome-copilot · skills/winmd-api-search · commit 797337f
- Licence
- MIT License (redistribution allowed)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft Corporation or GitHub.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download winmd-api-search.zip