winmd-api-search
它能做什么
这个工具可以帮你找到正确的 Windows 函数(API),以便为程序添加功能,比如调用摄像头或保存文件。它还会获取这些函数的完整详细信息。
适用场景
- ✓当你想开发一个新功能,却不知道该用哪个函数时。
- ✓当你提问“我该如何做 X?”,而 X 涉及系统中的某些功能(如摄像头、文件等)时。
- ✓当你在编写代码前,需要某个函数的确切细节时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/winmd-api-search/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我该如何使用这个应用拍照?”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会在一个本地数据库中搜索 Windows 函数的相关信息。它会把你的需求转换成技术术语,找到最合适的函数,并展示其详细信息。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
.winmdfiles - Project-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.
…
常见问题
使用前需要安装什么吗?
需要。首次使用前,你需要运行一个特定的脚本来生成“缓存”(即信息文件)。
什么是 API?
API(应用程序编程接口)就像程序员用来让操作系统(如 Windows)执行特定任务的命令或工具,例如访问摄像头或显示通知。
如果工具找不到对应的 API 怎么办?
如果工具在本地数据中找不到合适的匹配项,它会建议你去微软官方的在线文档中搜索。
详情
作者的原始描述
Find and explore Windows desktop APIs. Use when building features that need platform capabilities — camera, file access, notifications, UI controls, AI/ML, sensors, networking, etc. Discovers the right API for a task and retrieves full type details (methods, properties, events, enumeration values).
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7478
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。