GitHub Copilot 技能创建
skill-creator
在本仓库中创建高效 GitHub Copilot 技能(.github/skills/)的指南。适用于创建新技能、更新现有技能,或被问及 vscode-documentdb 项目的技能结构、格式或最佳实践时。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 33
- Forks
- 22
01 前言 Front Matter
- name
- skill-creator
- description
- Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.
03 SKILL.md 正文
Skill Creator for GitHub Copilot
Create and maintain skills in .github/skills/ that extend GitHub Copilot's capabilities with project-specific knowledge.
What Are Skills
Skills are SKILL.md files that provide specialized, procedural knowledge that Copilot doesn't inherently have. They turn Copilot from a general assistant into a domain expert for specific tasks in this codebase.
Skills provide:
- Specialized workflows — multi-step procedures for project-specific domains
- Domain expertise — architecture patterns, conventions, business logic
- Bundled references — detailed docs loaded only when needed
Skill Anatomy
.github/skills/
└── skill-name/
├── SKILL.md (required — frontmatter + instructions)
└── references/ (optional — detailed docs, loaded on demand)
SKILL.md Structure
---
name: my-skill-name
description: What this skill does and WHEN to use it. Include trigger words and scenarios. This is the primary mechanism for Copilot to decide whether to load the skill body.
---
# Skill Title
Concise instructions for using this skill.
## When to Use
- Bullet list of triggering scenarios
## Core Content
(workflow, patterns, examples)
Wiring the Skill
After creating the SKILL.md, register it in .github/copilot-instructions.md under the <skills> section:
<skill>
<name>my-skill-name</name>
<description>Same or similar description as in SKILL.md frontmatter</description>
<file>${workspaceFolder}\.github\skills\my-skill-name\SKILL.md</file>
</skill>
Note: Replace
${workspaceFolder}with the absolute path to the repository root on your machine (e.g.\home\user\repos\vscode-documentdb). VS Code resolves skill file paths at runtime and currently requires absolute paths.
Copilot reads skill metadata (name + description) to decide when to trigger. The SKILL.md body is loaded only after triggering.
Core Principles
1. Concise is Key
The context window is shared with conversation history, other instructions, and user requests. Challenge each paragraph: "Does Copilot already know this?" and "Does this justify its token cost?"
- Prefer concise examples over verbose explanations
- Only include what Copilot doesn't already know — skip general TypeScript/React knowledge
- Target under 300 lines for SKILL.md body; split into references if larger
2. Progressive Disclosure
Use a three-level loading system:
- Metadata (name + description) — always visible (~50 words)
- SKILL.md body — loaded when skill triggers
- References — loaded on demand by Copilot when deeper detail is needed
For skills with multiple variants or extensive reference material, keep the core workflow in SKILL.md and move details to references/:
## Advanced Topics
- **Detailed format spec**: See [FORMAT.md](./FORMAT.md)
- **Migration patterns**: See [references/migration.md](./references/migration.md)
3. Match Freedom to Task Fragility
| Freedom Level | When | Example |
|---|---|---|
| High (text guidance) | Multiple valid approaches | Architecture recommendations |
| Medium (patterns with examples) | Preferred pattern exists | tRPC router creation |
| Low (exact steps) | Fragile, error-prone | Release note formatting |
4. Do NOT Include
- README.md, CHANGELOG.md, or auxiliary documentation
- Setup/installation instructions for the skill itself
- User-facing documentation — skills are for Copilot, not humans
- Information Copilot already knows (general language features, common libraries)
Skill Creation Workflow
Step 1: Understand the Domain
Identify concrete scenarios the skill addresses:
- What tasks trigger it?
- What does Copilot get wrong without it?
- What project-specific knowledge is needed?
Step 2: Plan Contents
For each scenario, determine:
- What code patterns or templates are repeatedly needed?
- What reference material should be available?
- What pitfalls must be called out?
Step 3: Write the Skill
- Create
.github/skills/{skill-name}/SKILL.md - Write frontmatter:
nameanddescription(description is the trigger — be comprehensive about when to use) - Write body: Core workflow, patterns, examples. Keep it lean.
- Add references (optional): Split out detailed format specs, schemas, or variant-specific docs
- Register in
.github/copilot-instructions.md
Step 4: Validate
- Ensure the description covers all trigger scenarios
- Verify code examples follow project conventions (see
.github/copilot-instructions.mdand.github/instructions/) - Check that referenced files exist and paths are correct
- Confirm the skill doesn't duplicate information already in
.github/instructions/files
Existing Skills Reference
| Skill | Purpose |
|---|---|
writing-release-notes |
Release notes and changelog generation |
accessibility-aria-expert |
Accessibility issues in React/Fluent UI webviews |
webview-trpc-messaging |
tRPC communication between extension host and webviews |
Example: Minimal Skill
---
name: my-pattern
description: Implements the XYZ pattern for this codebase. Use when creating new XYZ instances, modifying existing XYZ behavior, or debugging XYZ-related issues.
---
# XYZ Pattern
## When to Use
- Creating a new XYZ
- Modifying XYZ behavior
- Debugging XYZ issues
## Pattern
\`\`\`typescript
// core pattern example
\`\`\`
## Common Pitfalls
- Don't do X because Y
- Always do Z when W
04 同仓库更多 Skills
扩展发布说明与变更日志编写
writing-release-notes
为 Visual Studio Code 的 DocumentDB 扩展生成发布说明和变更日志条目,并在 GitHub Discussions 上发布版本公告。当需要准备版本发布、编写补丁更新说明、撰写变更日志条目、记录新功能和修复,或向 Discussions 发布正式版或补丁版发布公告时使用。可处理主版本/次版本(新建文件)和补丁更新(追加到现有文件)两种情况。
Webview tRPC 消息通信实现
webview-trpc-messaging
实现 VS Code 扩展宿主与 React webview 之间基于 tRPC 的通信。当需要创建新的 webview 过程(查询、变更、订阅)、添加新的 webview 路由(router)、接入 webview 控制器(controller)、在 React 组件中使用 tRPC 客户端、应用遥测中间件(telemetryMiddlewareBody),或在 webview 操作中支持基于 AbortSignal 的取消时使用。
UX PR 评审准备与执行
ux-pr-review
准备并运行一次由智能体辅助的 UX / 工作流拉取请求(PR)评审。当操作者说“我准备做一个 UX PR 评审,请准备”、“为一个 PR 准备 UX 评审”时使用。
集群树形架构实现
tree-cluster-architecture
vscode-documentdb 中集群节点和树数据提供者的实现模式。当需要添加或更改集群树项、发现提供者(discovery provider)、Connections/Azure/Discovery 树层级结构、树/列表模式、集群标识、treeId/clusterId 查找、Collection View 导入/导出解析、reveal 行为、凭据、shell 操作或复制连接字符串支持时使用。
遥测埋点植入
telemetry-instrumentation
vscode-documentdb 扩展中遥测(telemetry)的埋点模式。适用于为功能添加遥测、用属性或度量值丰富现有遥测、用关联 ID(correlation ID)关联相关事件、为命令或树视图埋点、抑制噪声事件,或决定采集哪些数据点。当被要求为任何功能 “add telemetry” 或 “improve telemetry” 时也使用。
外部 PR 审查与合并
review-external-pr
对外部贡献者的 PR 进行分类并准备合并。检测推送权限、目标分支、草稿状态、规模和提交历史质量,然后选择三条路径之一(仅审查、直接推送到贡献者分支,或使用 `reviews/` 暂存分支)。适用于分类或审查社区 PR、判断是否需要维护者修改、选择合并策略(squash/merge/rebase),或合并外部贡献。