Skip to content

Commit c02dd75

Browse files
committed
Add Microsoft Code Reference and Microsoft Docs skills with detailed usage instructions
1 parent d929b71 commit c02dd75

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

docs/README.skills.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,6 @@ Skills differ from other primitives by supporting bundled assets (scripts, code
2222

2323
| Name | Description | Bundled Assets |
2424
| ---- | ----------- | -------------- |
25+
| [microsoft-code-reference](../skills/microsoft-code-reference/SKILL.md) | 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. | - |
26+
| [microsoft-docs](../skills/microsoft-docs/SKILL.md) | Query official Microsoft documentation to understand concepts, find tutorials, and learn how services work. Use for Azure, .NET, Microsoft 365, Windows, Power Platform, and all Microsoft technologies. | - |
2527
| [webapp-testing](../skills/webapp-testing/SKILL.md) | Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. | `test-helper.js` |
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: microsoft-code-reference
3+
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.
4+
compatibility: Requires Microsoft Learn MCP Server (https://learn.microsoft.com/api/mcp)
5+
---
6+
7+
# Microsoft Code Reference
8+
9+
## Tools
10+
11+
| Need | Tool | Example |
12+
|------|------|---------|
13+
| API method/class lookup | `microsoft_docs_search` | `"BlobClient UploadAsync Azure.Storage.Blobs"` |
14+
| Working code sample | `microsoft_code_sample_search` | `query: "upload blob managed identity", language: "python"` |
15+
| Full API reference | `microsoft_docs_fetch` | Fetch URL from search (for overloads, full signatures) |
16+
17+
## Finding Code Samples
18+
19+
Use `microsoft_code_sample_search` to get official, working examples:
20+
21+
```
22+
microsoft_code_sample_search(query: "upload file to blob storage", language: "csharp")
23+
microsoft_code_sample_search(query: "authenticate with managed identity", language: "python")
24+
microsoft_code_sample_search(query: "send message service bus", language: "javascript")
25+
```
26+
27+
Languages: `python`, `csharp`, `javascript`, `typescript`, `java`, `go`, `powershell`, `cli`
28+
29+
**When to use:**
30+
- Before writing code—find a working pattern to follow
31+
- After errors—compare your code against a known-good sample
32+
- Unsure of initialization/setup—samples show complete context
33+
34+
## API Lookups
35+
36+
```
37+
# Verify method exists (include namespace for precision)
38+
"BlobClient UploadAsync Azure.Storage.Blobs"
39+
"GraphServiceClient Users Microsoft.Graph"
40+
41+
# Find class/interface
42+
"DefaultAzureCredential class Azure.Identity"
43+
44+
# Find correct package
45+
"Azure Blob Storage NuGet package"
46+
"azure-storage-blob pip package"
47+
```
48+
49+
Fetch full page when method has multiple overloads or you need complete parameter details.
50+
51+
## Error Troubleshooting
52+
53+
| Error Type | Query |
54+
|------------|-------|
55+
| Method not found | `"[ClassName] methods [Namespace]"` |
56+
| Type not found | `"[TypeName] NuGet package namespace"` |
57+
| Wrong signature | `"[ClassName] [MethodName] overloads"` → fetch full page |
58+
| Deprecated warning | `"[OldType] migration v12"` |
59+
| Auth failure | `"DefaultAzureCredential troubleshooting"` |
60+
| 403 Forbidden | `"[ServiceName] RBAC permissions"` |
61+
62+
## When to Verify
63+
64+
Check before using when:
65+
- Method name seems "too convenient" (`UploadFile` vs actual `Upload`)
66+
- Mixing SDK versions (v11 `CloudBlobClient` vs v12 `BlobServiceClient`)
67+
- Package name doesn't follow conventions (`Azure.*` for .NET, `azure-*` for Python)
68+
- First time using this API
69+
70+
## Quick Validation
71+
72+
Before generating Microsoft SDK code:
73+
1. **Package exists**`microsoft_docs_search(query: "[PackageName] NuGet")`
74+
2. **Method is real**`microsoft_docs_search(query: "[ClassName] [MethodName] [Namespace]")`
75+
3. **Get working sample**`microsoft_code_sample_search(query: "[what you're doing]", language: "[lang]")`

skills/microsoft-docs/SKILL.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: microsoft-docs
3+
description: Query official Microsoft documentation to understand concepts, find tutorials, and learn how services work. Use for Azure, .NET, Microsoft 365, Windows, Power Platform, and all Microsoft technologies. Get accurate, current information from learn.microsoft.com and other official Microsoft websites—architecture overviews, quickstarts, configuration guides, limits, and best practices.
4+
compatibility: Requires Microsoft Learn MCP Server (https://learn.microsoft.com/api/mcp)
5+
---
6+
7+
# Microsoft Docs
8+
9+
## Tools
10+
11+
| Tool | Use For |
12+
|------|---------|
13+
| `microsoft_docs_search` | Find documentation—concepts, guides, tutorials, configuration |
14+
| `microsoft_docs_fetch` | Get full page content (when search excerpts aren't enough) |
15+
16+
## When to Use
17+
18+
- **Understanding concepts** — "How does Cosmos DB partitioning work?"
19+
- **Learning a service** — "Azure Functions overview", "Container Apps architecture"
20+
- **Finding tutorials** — "quickstart", "getting started", "step-by-step"
21+
- **Configuration options** — "App Service configuration settings"
22+
- **Limits & quotas** — "Azure OpenAI rate limits", "Service Bus quotas"
23+
- **Best practices** — "Azure security best practices"
24+
25+
## Query Effectiveness
26+
27+
Good queries are specific:
28+
29+
```
30+
# ❌ Too broad
31+
"Azure Functions"
32+
33+
# ✅ Specific
34+
"Azure Functions Python v2 programming model"
35+
"Cosmos DB partition key design best practices"
36+
"Container Apps scaling rules KEDA"
37+
```
38+
39+
Include context:
40+
- **Version** when relevant (`.NET 8`, `EF Core 8`)
41+
- **Task intent** (`quickstart`, `tutorial`, `overview`, `limits`)
42+
- **Platform** for multi-platform docs (`Linux`, `Windows`)
43+
44+
## When to Fetch Full Page
45+
46+
Fetch after search when:
47+
- **Tutorials** — need complete step-by-step instructions
48+
- **Configuration guides** — need all options listed
49+
- **Deep dives** — user wants comprehensive coverage
50+
- **Search excerpt is cut off** — full context needed
51+
52+
## Why Use This
53+
54+
- **Accuracy** — live docs, not training data that may be outdated
55+
- **Completeness** — tutorials have all steps, not fragments
56+
- **Authority** — official Microsoft documentation

0 commit comments

Comments
 (0)