AgentSkillsCN

skill-creator

为创建高效的VS Code智能体技能、自定义指令、提示词与智能体提供指南。在新建SKILL.md文件、编写.instruction.md文件、定义.prompt.md或.agent.md文件,或搭建.github/Copilot目录结构时使用。涵盖Frontmatter架构、路径要求、渐进式披露、命名规范,以及VS Code的发现行为。

SKILL.md
--- frontmatter
name: skill-creator
description: Guide for creating effective VS Code agent skills, custom instructions, prompts, and agents. Use when building new SKILL.md files, writing .instructions.md files, defining .prompt.md or .agent.md files, or setting up a .github/ Copilot directory structure. Covers frontmatter schemas, path requirements, progressive disclosure, naming conventions, and VS Code discovery behaviour.
argument-hint: "[skill or file type to create, e.g. 'a skill for Python linting']"

Skill Creator

Create concise, high-signal skills with clear triggers, reusable resources, and progressive disclosure.

VS Code Copilot File Types

File TypePathPurpose
Always-on instructions.github/copilot-instructions.mdProject-wide rules loaded in every chat
Scoped instructions.github/instructions/*.instructions.mdRules applied based on applyTo glob or description
Reusable prompts.github/prompts/*.prompt.mdSlash commands for specific tasks
Custom agents.github/agents/*.agent.mdNamed agents with tools, model, and handoff config
Project skills.github/skills/<name>/SKILL.mdOn-demand capabilities with scripts and resources
Personal skills~/.copilot/skills/<name>/SKILL.mdUser-level skills across all workspaces

SKILL.md Format

yaml
---
name: skill-name                    # REQUIRED — must match directory name exactly
description: >                      # REQUIRED — max 1024 chars; be specific about WHEN to trigger
  What it does and when to use it.
argument-hint: "[input hint]"        # Optional — shown in / menu
user-invokable: true                 # Optional — show in / menu (default: true)
disable-model-invocation: false      # Optional — prevent auto-loading (default: false)
---

# Skill Body
Detailed instructions here...

Rules for name:

  • Must be lowercase, using hyphens for spaces
  • Must match the parent directory name exactly
  • Maximum 64 characters
  • Example: directory dj-tag-editorname: dj-tag-editor

.instructions.md Format

yaml
---
description: "Short description for hover display"
applyTo: '**/*.py'          # Glob pattern for auto-application
---

# Instructions

.prompt.md Format

yaml
---
description: "What this prompt does"
agent: 'agent'              # 'agent' for agentic mode
tools: ['search', 'edit', 'problems', 'read']
argument-hint: "${input:variableName}"
---

# Prompt body
Your instructions here with ${input:variableName} placeholders.

.agent.md Format

yaml
---
description: "What this agent specialises in"
name: My Agent
tools: ['search', 'edit', 'execute', 'read', 'problems']
model: 'Claude Sonnet 4.5'
target: 'vscode'
infer: true
---

# Agent Instructions

Writing Effective Skill Descriptions

The description field is what VS Code reads to decide whether to activate a skill. Make it:

  • Specific about triggers: include keywords users are likely to say
  • Specific about capabilities: list the exact technologies and tasks covered
  • Under 1024 characters

Good example:

code
Generate and review Playwright Python tests using role-based locators and web-first assertions. Use when writing UI tests, end-to-end tests, fixing flaky selectors, or setting up Pytest fixtures for web automation.

Weak example:

code
Testing skill for Python.

Progressive Disclosure Design

VS Code loads skills in three levels:

  1. Discovery — reads only name + description (always loaded, lightweight)
  2. Instructions — loads SKILL.md body when request matches description
  3. Resources — loads additional files referenced in body (scripts, examples)

Design for this: put the most critical "when to use" context in the description, not just the body.

Directory Structure Best Practices

code
.github/
├── copilot-instructions.md          # Always-on project rules
├── instructions/
│   └── python-rules.instructions.md # Scoped: applyTo **/*.py
├── prompts/
│   └── refactor-module.prompt.md    # Slash: /refactor-module
├── agents/
│   └── my-specialist.agent.md       # @my-specialist
└── skills/
    └── my-skill/
        ├── SKILL.md                 # Required
        ├── helper-script.sh         # Optional resources
        └── examples/                # Optional examples

Common Mistakes

MistakeFix
name in SKILL.md doesn't match directoryRename either the file or directory
Description is too vagueList specific technologies, tasks, trigger phrases
Body content in description fieldMove detailed instructions to the body
Missing applyTo in instructions fileAdd glob pattern or rely on semantic matching
Agent handoff references non-existent agentCreate the target .agent.md file