Skip to content

Commit d121e44

Browse files
TianqiZhangclaude
andcommitted
Add Learn CLI alternative to all skills
Add CLI fallback sections to microsoft-docs, microsoft-code-reference, and microsoft-skill-creator skills so agents can use the mslearn CLI via Bash when the Learn MCP server is not available. Each section maps MCP tools to their CLI equivalents and shows both npx and global install usage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b4d902c commit d121e44

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

skills/microsoft-code-reference/SKILL.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,24 @@ Before generating code using Microsoft SDKs, verify it's correct:
7777
3. **Find working sample**`microsoft_code_sample_search(query: "[task]", language: "[lang]")`
7878

7979
For simple lookups, step 1 alone may suffice. For complex API usage, complete all three steps.
80+
81+
## CLI Alternative
82+
83+
If the Learn MCP server is not available, use the `mslearn` CLI via Bash instead:
84+
85+
```bash
86+
# Run directly (no install needed)
87+
npx @microsoft/learn-cli search "BlobClient UploadAsync Azure.Storage.Blobs"
88+
89+
# Or install globally, then run
90+
npm install -g @microsoft/learn-cli
91+
mslearn search "BlobClient UploadAsync Azure.Storage.Blobs"
92+
```
93+
94+
| MCP Tool | CLI Command |
95+
|----------|-------------|
96+
| `microsoft_docs_search(query: "...")` | `mslearn search "..."` |
97+
| `microsoft_code_sample_search(query: "...", language: "...")` | `mslearn code-search "..." --language ...` |
98+
| `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` |
99+
100+
Pass `--json` to `search` or `code-search` to get raw JSON output for further processing.

skills/microsoft-docs/SKILL.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ Fetch after search when:
5050
- **Deep dives** — user wants comprehensive coverage
5151
- **Search excerpt is cut off** — full context needed
5252

53+
## CLI Alternative
54+
55+
If the Learn MCP server is not available, use the `mslearn` CLI via Bash instead:
56+
57+
```bash
58+
# Run directly (no install needed)
59+
npx @microsoft/learn-cli search "azure functions timeout"
60+
61+
# Or install globally, then run
62+
npm install -g @microsoft/learn-cli
63+
mslearn search "azure functions timeout"
64+
```
65+
66+
| MCP Tool | CLI Command |
67+
|----------|-------------|
68+
| `microsoft_docs_search(query: "...")` | `mslearn search "..."` |
69+
| `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` |
70+
71+
The `fetch` command also supports `--section <heading>` to extract a single section and `--max-chars <number>` to truncate output.
72+
5373
## Why Use This
5474

5575
- **Accuracy** — live docs, not training data that may be outdated

skills/microsoft-skill-creator/SKILL.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ skill-name/
3737
| `microsoft_docs_fetch` | Get full page content | Deep dive into important pages |
3838
| `microsoft_code_sample_search` | Find code examples | Get implementation patterns |
3939

40+
### CLI Alternative
41+
42+
If the Learn MCP server is not available, use the `mslearn` CLI via Bash instead:
43+
44+
```bash
45+
# Run directly (no install needed)
46+
npx @microsoft/learn-cli search "semantic kernel overview"
47+
48+
# Or install globally, then run
49+
npm install -g @microsoft/learn-cli
50+
mslearn search "semantic kernel overview"
51+
```
52+
53+
| MCP Tool | CLI Command |
54+
|----------|-------------|
55+
| `microsoft_docs_search(query: "...")` | `mslearn search "..."` |
56+
| `microsoft_code_sample_search(query: "...", language: "...")` | `mslearn code-search "..." --language ...` |
57+
| `microsoft_docs_fetch(url: "...")` | `mslearn fetch "..."` |
58+
59+
Generated skills should include this same CLI fallback table so agents can use either path.
60+
4061
## Creation Process
4162

4263
### Step 1: Investigate the Topic

0 commit comments

Comments
 (0)