microsoft-code-reference — GitHub Copilot skill: install
Checks Microsoft APIs and SDK code against official docs, finds working samples, and helps debug Azure and .NET issues.
npx skills add github/awesome-copilot --skill microsoft-code-reference -a claude-codeWhat microsoft-code-reference does
This skill looks up Microsoft API methods, classes, packages, and parameters through Microsoft Learn. It helps verify that a call exists, check its signature, and find a working example for Azure SDKs, .NET libraries, or Microsoft Graph.
It defines the microsoft_docs_search, microsoft_code_sample_search, and microsoft_docs_fetch tools. For a complex case, the workflow checks the API, fetches the full reference page, then compares the implementation with an official sample. When the Microsoft Learn MCP Server is unavailable, mslearn can be used through npx or a global install.
Install it when an agent writes Microsoft SDK code and mixes up versions, methods, or packages. It adds little value to projects that do not use Microsoft APIs.
What it helps with
- verify that a Microsoft SDK method exists
- find a working Azure file upload example
- check an overloaded API signature
- troubleshoot an auth or 403 error
- choose a package for .NET or Python
Example prompts for the agent
- Check `BlobClient UploadAsync Azure.Storage.Blobs` and find a working C# example.
- Compare this code with the official API and verify the parameters for `GraphServiceClient Users Microsoft.Graph`.
- Find the cause of this `DefaultAzureCredential` auth error and show a correct example.
How to install microsoft-code-reference
1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill microsoft-code-reference -a claude-code2Manually: put the files in place
~/.claude/skills/microsoft-code-reference/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/microsoft-code-reference/
Manually: put the files in place
.agents/skills/microsoft-code-reference/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/microsoft-code-reference/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1Skills CLI (Vercel)
npx skills add github/awesome-copilot --skill microsoft-code-reference2GitHub CLI
gh skill install github/awesome-copilot microsoft-code-reference3Manually: put the files in place
.github/skills/microsoft-code-reference/SKILL.mdPlatform CLI
gemini skills install https://github.com/github/awesome-copilot --path skills/microsoft-code-referenceManually: put the files in place
.devin/skills/microsoft-code-reference/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set554
The whole set →Similar
Questions about microsoft-code-reference
How do I install microsoft-code-reference in GitHub Copilot?
Run npx skills add github/awesome-copilot --skill microsoft-code-reference, gh skill install github/awesome-copilot microsoft-code-reference, or place the file at .github/skills/microsoft-code-reference/SKILL.md.
What does microsoft-code-reference do?
The skill searches Microsoft API references, official code samples, and full method signatures. It helps catch made-up methods, wrong parameters, and deprecated patterns.
What does microsoft-code-reference need to work?
It works best with the Microsoft Learn MCP Server. When that server is unavailable, the skill can use the mslearn CLI with mslearn search, mslearn code-search, and mslearn fetch.
Source text
SKILL.md · MIT
--- name: microsoft-code-reference description: Look up Microsoft API references, find working code samples, and verify SDK code is correct. Use when working with Azure SDKs, .NET libraries, or Microsoft APIs—to find the right method, check parameters, get working examples, or troubleshoot errors. Catches hallucinated methods, wrong signatures, and deprecated patterns by querying official docs. compatibility: Works best with Microsoft Learn MCP Server (https://learn.microsoft.com/api/mcp). Can also use the mslearn CLI as a fallback. --- # Microsoft Code Reference ## Tools | Need | Tool | Example | |------|------|---------| | API method/class lookup | `microsoft_docs_search` | `"BlobClient UploadAsync Azure.Storage.Blobs"` | | Working code sample | `microsoft_code_sample_search` | `query: "upload blob managed identity", language: "python"` | | Full API reference | `microsoft_docs_fetch` | Fetch URL from `microsoft_docs_search` (for overloads, full signatures) | ## Finding Code Samples Use `microsoft_code_sample_search` to get official, working examples: ``` microsoft_code_sample_search(query: "upload file to blob storage", language: "csharp") microsoft_code_sample_search(query: "authenticate with managed identity", language: "python") microsoft_code_sample_search(query: "send message service bus", language: "javascript") ``` **When to use:** - Before writing code—find a working pattern to follow - After errors—compare your code against a known-good sample - Unsure of initialization/setup—samples show complete context ## API Lookups ``` # Verify method exists (include namespace for precision) "BlobClient UploadAsync Azure.Storage.Blobs" "GraphServiceClient Users Microsoft.Graph" # Find class/interface "DefaultAzureCredential class Azure.Identity" # Find correct package "Azure Blob Storage NuGet package" "azure-storage-blob pip package" ``` Fetch full page when method has multiple overloads or you need complete parameter details. ## Error Troubleshooting Use `microsoft_code_sample_search` to find working code samples and compare with your implementation. For specific errors, use `microsoft_docs_search` and `microsoft_docs_fetch`: | Error Type | Query | |------------|-------| | Method not found | `"[ClassName] methods [Namespace]"` | | Type not found | `"[TypeName] NuGet package namespace"` | | Wrong signature | `"[ClassName] [MethodName] overloads"` → fetch full page | | Deprecated warning | `"[OldType] migration v12"` | | Auth failure | `"DefaultAzureCredential troubleshooting"` | | 403 Forbidden | `"[ServiceName] RBAC permissions"` | ## When to Verify Always verify when: - Method name seems "too convenient" (`UploadFile` vs actual `Upload`) - Mixing SDK versions (v11 `CloudBlobClient` vs v12 `BlobServiceClient`) - Package name doesn't follow conventions (`Azure.*` for .NET, `azure-*` for Python) - Using an API for the first time ## Validation Workflow Before generating code using Microsoft SDKs, verify it's correct: 1. **Confirm method or package exists** — `microsoft_docs_search(query: "[ClassName] [MethodName] [Namespace]")` 2. **Fetch full details** (for overloads/complex params) — `microsoft_docs_fetch(url: "...")` 3. **Find working sample** — `microsoft_code_sample_search(query: "[task]", language: "[lang]")` For simple lookups, step 1 alone may suffice. For complex API usage, complete all three steps. ## CLI Alternative If the Learn MCP server is not available, use the `mslearn` CLI from a terminal or shell (for example, Bash, PowerShell, or cmd) instead: ```sh # Run directly (no install needed) npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs" # Or install globally, then run npm install -g @microsoft/learn-cli mslearn search "BlobClient UploadAsync Azure.Storage.Blobs" ``` | MCP Tool | CLI Command | |----------|-------------| | `microsoft_docs_search(query: "...")` | `mslearn search "..."` | | `microsoft_code_sample_search(query: "...", language: "...")` | `mslearn code-search "..." --language ...` | | `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` | Pass `--json` to `search` or `code-search` to get raw JSON output for further processing.
© github · MIT · github/awesome-copilot