AgentSkillsCN

agent-customization

创建、更新、审查、修复,或调试 VS Code 智能体自定义文件(.instructions.md、.prompt.md、.agent.md、SKILL.md、copilot-instructions.md、AGENTS.md)。可用于:保存编码偏好;排查为何指令/技能/智能体被忽略或未被调用;配置 applyTo 模式;定义工具使用限制;创建自定义智能体模式或专属工作流;封装领域知识;修复 YAML frontmatter 语法。

SKILL.md
--- frontmatter
name: agent-customization
description: 'Create, update, review, fix, or debug VS Code agent customization files (.instructions.md, .prompt.md, .agent.md, SKILL.md, copilot-instructions.md, AGENTS.md). Use for: saving coding preferences; troubleshooting why instructions/skills/agents are ignored or not invoked; configuring applyTo patterns; defining tool restrictions; creating custom agent modes or specialized workflows; packaging domain knowledge; fixing YAML frontmatter syntax.'

Agent Customization

Decision Flow

PrimitiveWhen to Use
Workspace InstructionsAlways-on, applies everywhere in the project
File InstructionsExplicit via applyTo patterns, or on-demand via description
MCPIntegrates external systems, APIs, or data
Custom AgentsSubagents for context isolation, or multi-stage workflows with tool restrictions
PromptsSingle focused task with parameterized inputs
SkillsOn-demand workflow with bundled assets (scripts/templates)

Quick Reference

Consult the reference docs for templates, domain examples, advanced frontmatter options, asset organization, anti-patterns, and creation checklists.

TypeFileLocationKey FieldReference
Workspace Instructionscopilot-instructions.md, AGENTS.md.github/ or rootN/A (always applies)Link
File Instructions*.instructions.md.github/instructions/applyTo (explicit), description (on-demand)Link
Prompts*.prompt.md.github/prompts/description (user-invoked)Link
Custom Agents*.agent.md.github/agents/description (on-demand), infer (subagent)Link
SkillsSKILL.md.github/skills/<name>/description (on-demand)Link

User-level: {{USER_PROMPTS_FOLDER}}/ (*.prompt.md, *.instructions.md, *.agent.md; not skills) Customizations roam with user's settings sync

Creation Process

If you need to explore or validate patterns in the codebase, use a read-only subagent. If the ask-questions tool is available, use it to interview the user and clarify requirements.

Follow these steps when creating any customization file.

1. Determine Scope

Ask the user where they want the customization:

  • Workspace: For project-specific, team-shared customizations → .github/ folder
  • User profile: For personal, cross-workspace customizations → {{USER_PROMPTS_FOLDER}}/

2. Choose the Right Primitive

Use the Decision Flow above to select the appropriate file type based on the user's need.

3. Create the File

Create the file directly at the appropriate path:

  • Use the location tables in each reference file
  • Include required frontmatter as needed
  • Add the body content following the templates

4. Validate

After creating:

  • Confirm the file is in the correct location
  • Verify frontmatter syntax (YAML between --- markers)
  • Check that description is present and meaningful

Edge Cases

Instructions vs Skill? Does this apply to most work, or specific tasks? Most → Instructions. Specific → Skill.

Skill vs Prompt? Multi-step workflow with bundled assets → Skill. Single focused task with inputs → Prompt.

Skill vs Custom Agent? Same capabilities for all steps → Skill. Need context isolation (subagent returns single output) or different tool restrictions per stage → Custom Agent.