关于 microsoft-skill-creator
microsoft-skill-creator 指导 Agent 为 Microsoft 技术构建技能,将本地参考资料和代码示例与动态 Microsoft Learn 查询结合,并提供 mslearn 命令行备用方案。
主要功能
- 01结合本地与动态知识
- 02搜索 Microsoft Learn 文档
- 03获取文档页面
- 04搜索代码示例
- 05提供 mslearn 命令行备用方案
适用场景
- 01为 Microsoft 技术创建技能
- 02查找最新 Microsoft 文档
- 03获取实现示例
MCP 相关
该工作流使用 Microsoft Learn MCP 工具搜索文档、获取页面和查找代码示例。Learn MCP 服务不可用时,也介绍了 mslearn 命令行替代方案。
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ github/ awesome-copilot --skill microsoft-skill-creator安装后在 Claude Code 中输入/microsoft-skill-creator确认已加载。
附带文件references/skill-templates.md
详细介绍
Microsoft Skill Creator
为 Microsoft 技术创建混合技能,将 essential 知识存储在本地,同时支持通过 Learn MCP 动态查询以获取更深入的细节。
关于技能
技能是模块化包,通过专业知识和 工作流 扩展 Agent 能力。技能可将通用 Agent 转化为特定领域的专业 Agent。
技能结构
skill-name/
├── SKILL.md (required) # Frontmatter (name, description) + instructions
├── references/ # Documentation loaded into context as needed
├── sample_codes/ # Working code examples
└── assets/ # Files used in output (templates, etc.)
关键原则
- Frontmatter 至关重要:
name和description决定技能何时触发——要清晰且全面 - 简洁是关键:只包含 Agent 尚不知道的内容;上下文窗口是共享的
- 避免重复:信息应存放在 SKILL.md 或引用文件中,而不是两者都放
Learn MCP 工具
| 工具 | 用途 | 何时使用 |
|---|---|---|
microsoft_docs_search | 搜索官方文档 | 第一轮探索,查找主题 |
microsoft_docs_fetch | 获取完整页面内容 | 深入阅读重要页面 |
microsoft_code_sample_search | 查找代码示例 | 获取实现模式 |
CLI 替代方案
如果 Learn MCP 服务不可用,请在终端或 shell(例如 Bash、PowerShell 或 cmd)中使用 mslearn 命令行 代替:
# Run directly (no install needed)
npx @microsoft/learn-cli search "semantic kernel overview"
# Or install globally, then run
npm install -g @microsoft/learn-cli
mslearn search "semantic kernel overview"
| MCP 工具 | CLI 命令 |
|---|---|
microsoft_docs_search(query: "...") | mslearn search "..." |
microsoft_code_sample_search(query: "...", language: "...") | mslearn code-search "..." --language ... |
microsoft_docs_fetch(url: "...") | mslearn fetch "..." |
生成的技能应包含同样的 CLI 回退表,以便 Agent 可以使用任一方式。
创建流程
步骤 1:调研主题
使用 Learn MCP 工具分三个阶段建立深入理解:
阶段 1 - 范围探索:
microsoft_docs_search(query="{technology} overview what is")
microsoft_docs_search(query="{technology} concepts architecture")
microsoft_docs_search(query="{technology} getting started tutorial")
阶段 2 - 核心内容:
microsoft_docs_fetch(url="...") # Fetch pages from Phase 1
microsoft_code_sample_search(query="{technology}", language="{lang}")
阶段 3 - 深度:
microsoft_docs_search(query="{technology} best practices")
microsoft_docs_search(query="{technology} troubleshooting errors")
调研检查清单
调研后,请验证:
- 能用一段话解释该技术的用途
- 已确定 3-5 个关键概念
- 有可运行的基础用法代码
- 了解最常见的 API 模式
- 有针对更深入主题的搜索查询
步骤 2:与用户确认
展示发现并询问:
- “我发现这些关键领域:[列表]。哪些最重要?”
- “Agent 使用该技能主要会执行哪些任务?”
- “代码示例应优先使用哪种编程语言?”
步骤 3:生成技能
使用 skill-templates.md 中的合适模板:
| 技术类型 | 模板 |
|---|---|
| 客户端库、NuGet/npm 包 | SDK/库 |
| Azure 资源 | Azure 服务 |
| 应用开发框架 | 框架/平台 |
| REST API、协议 | API/协议 |
生成的技能结构
{skill-name}/
├── SKILL.md # Core knowledge + Learn MCP guidance
├── references/ # Detailed local documentation (if needed)
└── sample_codes/ # Working code examples
├── getting-started/
└── common-patterns/
步骤 4:平衡本地内容与动态内容
在以下情况下存为本地:
- 基础性内容(任何任务都需要)
- 频繁访问
- 稳定(不会变化)
- 难以通过搜索找到
在以下情况下保持动态:
- 详尽参考(内容过大)
- 版本特定
- 情境性(仅特定任务)
- 索引良好(易于搜索)
内容指南
| 内容类型 | 本地 | 动态 |
|---|---|---|
| 核心概念(3-5 个) | ✅ 完整 | |
| Hello world 代码 | ✅ 完整 | |
| 常见模式(3-5 个) | ✅ 完整 | |
| 主要 API 方法 | 签名 + 示例 | 通过 fetch 获取完整文档 |
| 最佳实践 | 前 5 条要点 | 搜索更多 |
| 故障排除 | 搜索查询 | |
| 完整 API 参考 | 文档链接 |
步骤 5:验证
- 检查:本地内容是否足以完成常见任务?
- 测试:建议的搜索查询是否返回有用结果?
- 验证:代码示例是否能无错误运行?
常见调研模式
针对 SDK/库
"{name} overview" → purpose, architecture
"{name} getting started quickstart" → setup steps
"{name} API reference" → core classes/methods
"{name} samples examples" → code patterns
"{name} best practices performance" → optimization
针对 Azure 服务
"{service} overview features" → capabilities
"{service} quickstart {language}" → setup code
"{service} REST API reference" → endpoints
"{service} SDK {language}" → client library
"{service} pricing limits quotas" → constraints
针对框架/平台
"{framework} architecture concepts" → mental model
"{framework} project structure" → conventions
"{framework} tutorial walkthrough" → end-to-end flow
"{framework} configuration options" → customization
示例:创建 “Semantic Kernel” 技能
调研
microsoft_docs_search(query="semantic kernel overview")
microsoft_docs_search(query="semantic kernel plugins functions")
microsoft_code_sample_search(query="semantic kernel", language="csharp")
microsoft_docs_fetch(url="https://learn.microsoft.com/semantic-kernel/overview/")
生成的技能
semantic-kernel/
├── SKILL.md
└── sample_codes/
├── getting-started/
│ └── hello-kernel.cs
└── common-patterns/
├── chat-completion.cs
└── function-calling.cs
生成的 SKILL.md
---
name: semantic-kernel
description: Build AI agents with Microsoft Semantic Kernel. Use for LLM-powered apps with plugins, planners, and memory in .NET or Python.
---
# Semantic Kernel
Orchestration SDK for integrating LLMs into applications with plugins, planners, and memory.
## Key Concepts
- **Kernel**: Central orchestrator managing AI services and plugins
- **Plugins**: Collections of functions the AI can call
- **Planner**: Sequences plugin functions to achieve goals
- **Memory**: Vector store integration for RAG patterns
## Quick Start
See [getting-started/hello-kernel.cs](sample_codes/getting-started/hello-kernel.cs)
## Learn More
| Topic | How to Find |
|-------|-------------|
| Plugin development | `microsoft_docs_search(query="semantic kernel plugins custom functions")` |
| Planners | `microsoft_docs_search(query="semantic kernel planner")` |
| Memory | `microsoft_docs_fetch(url="https://learn.microsoft.com/en-us/semantic-kernel/frameworks/agent/agent-memory")` |
## CLI Alternative
If the Learn MCP server is not available, use the `mslearn` CLI instead:
| 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 "..."` |
Run directly with `npx @microsoft/learn-cli <command>` or install globally with `npm install -g @microsoft/learn-cli`.
评论
支持 Markdown