来源: https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools
VSCode Agent(GitHub Copilot)的提示词系统是一个专门为 Visual Studio Code 编辑器设计的 AI 编程助手框架。该系统针对不同的 AI 模型进行了优化,并提供了完整的工具生态系统来支持代码编辑、搜索、执行等操作。
| 文件名 | 类型 | 用途 | 模型基础 |
|---|---|---|---|
| Prompt.txt | 基础提示词 | 核心提示词和工具定义 | 通用 |
| gpt-5.txt | 模型特定 | GPT-5 优化版本 | GPT-5 |
| gpt-5-mini.txt | 模型特定 | GPT-5 Mini 优化版本 | GPT-5 Mini |
| gpt-4o.txt | 模型特定 | GPT-4o 优化版本 | GPT-4o |
| gpt-4.1.txt | 模型特定 | GPT-4.1 优化版本 | GPT-4.1 |
| claude-sonnet-4.txt | 模型特定 | Claude Sonnet 4 优化版本 | Claude Sonnet 4 |
| gemini-2.5-pro.txt | 模型特定 | Gemini 2.5 Pro 优化版本 | Gemini 2.5 Pro |
| nes-tab-completion.txt | 功能特定 | Tab 自动补全功能 | 通用 |
| chat-titles.txt | 功能特定 | 聊天标题生成 | 通用 |
结构组成:
<identity> - 身份定义 <instructions> - 核心指令 <toolUseInstructions> - 工具使用规范 <editFileInstructions> - 文件编辑规范 <functions> - 工具函数定义(JSON 格式) <context> - 上下文信息 <reminder> - 提醒事项 <tool_format> - 工具调用格式
核心特点:
insert_edit_into_file 作为主要编辑工具关键指令:
共同结构:
<identity> - 身份定义(GitHub Copilot) <instructions> - 增强的指令集 <toolUseInstructions> - 工具使用规范 <applyPatchInstructions> - Patch 应用规范(高级模型) <todoListToolInstructions> - 任务管理(高级模型) <notebookInstructions> - 笔记本编辑规范 <outputFormatting> - 输出格式规范 <reminderInstructions> - 提醒指令
版本差异:
manage_todo_list 工具apply_patch 工具(优先于 insert_edit_into_file)<engineeringMindsetHints><qualityGatesHints><responseModeHints><requirementsUnderstanding>apply_patch 工具manage_todo_listreplace_string_in_filereplace_string_in_filereplace_string_in_file特殊用途:
核心机制:
<|code_to_edit|> 标签内的代码输出格式:
<|code_to_edit|> 标签内的修订代码#|)特殊用途:
示例:
标准身份:
You are an expert AI programming assistant, working with a user in the VS Code editor. When asked for your name, you must respond with "GitHub Copilot".
核心原则:
核心特征:
关键指令:
You are an agent—keep going until the user's query is completely resolved before ending your turn. ONLY stop if solved or genuinely blocked.
策略:
先收集上下文,再执行任务
大块读取
语义搜索优先
semantic_searchgrep_search符号追踪
核心原则:
run_in_terminal 工具编辑工具选择:
apply_patch,回退到 insert_edit_into_filereplace_string_in_file 或 insert_edit_into_file应该并行的情况:
grep_search 和 file_search不应该并行的情况:
semantic_search(不能并行调用)run_in_terminal(必须顺序执行)GPT-5/5-Mini 要求:
示例:
"Searching the codebase for authentication logic to understand the current implementation."
策略:
格式:
*** Begin Patch *** Update File: [file_path] @@ class BaseClass @@ def method(): [3 lines of pre-context] -[old_code] +[new_code] +[new_code] [3 lines of post-context] *** End Patch
关键规则:
@@ 操作符@@ 语句跳转到正确上下文优势:
insert_edit_into_file 更快格式:
// ...existing code... changed code // ...existing code... changed code // ...existing code...
关键规则:
示例:
typescriptclass Person {
// ...existing code...
age: number;
// ...existing code...
getAge() {
return this.age;
}
}
关键规则:
insert_edit_into_file 失败时使用应该使用:
不应该使用:
关键流程:
方法:
方法:
在完成前:
报告:
使用场景:
特点:
使用场景:
特点:
规则:
GPT-5/5-Mini 规范:
##)作为顶级部分###)作为子部分标题顺序(适用时):
规则:
# 开头的注释是可以的不要:
| 功能特性 | GPT-5 | GPT-5-Mini | GPT-4.1 | GPT-4o | Claude-4 | Gemini-2.5 |
|---|---|---|---|---|---|---|
| Agent 模式 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| apply_patch | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| replace_string_in_file | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ |
| 任务管理 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 工程思维提示 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 质量门控 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 响应模式 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 进度检查点 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 要求理解 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| 笔记本支持 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
| 输出格式优化 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
基础 Prompt.txt ↓ GPT-4o / Claude-4 / Gemini-2.5(简化 Agent) ↓ GPT-4.1(添加 apply_patch) ↓ GPT-5 / GPT-5-Mini(完整功能集)
semantic_search(语义搜索)
list_code_usages(代码使用列表)
grep_search(文本搜索)
file_search(文件搜索)
**/*.{js,ts} - 匹配所有 js/ts 文件src/** - 匹配 src 文件夹下的所有文件**/foo/**/*.js - 匹配任何 foo 文件夹下的所有 js 文件get_vscode_api(VS Code API 参考)
read_file(读取文件)
list_dir(列出目录)
/ 结尾的是文件夹,否则是文件insert_edit_into_file(插入编辑)
apply_patch(应用补丁)(高级模型)
insert_edit_into_file 更快*** Update File: 和 @@ 操作符replace_string_in_file(替换字符串)(简化模型)
run_in_terminal(在终端运行)
isBackground=truegit --no-pager 或添加 | cat)get_terminal_output(获取终端输出)
run_in_terminal 启动的终端命令的输出get_errors(获取错误)
test_search(测试搜索)
create_new_workspace(创建新工作区)
get_project_setup_info(获取项目设置信息)
install_extension(安装扩展)
create_new_jupyter_notebook(创建新 Jupyter 笔记本)
manage_todo_list(管理任务列表)
fetch_webpage(获取网页)
get_changed_files(获取更改的文件)
run_in_terminal 运行 git 命令update_user_preferences(更新用户偏好)
edit_notebook_file(编辑笔记本文件)
insert_edit_into_file 或执行 Jupyter 相关命令run_notebook_cell(运行笔记本单元格)
copilot_getNotebookSummary(获取笔记本摘要)
输入信息:
recently_viewed_code_snippets:开发者最近查看的代码片段current_file_content:当前文件的内容edit_diff_history:编辑差异历史area_around_code_to_edit:要编辑区域周围的代码<|cursor|>:光标位置处理流程:
格式:
#|)<|code_to_edit|> 和 <|/code_to_edit|>)示例:
输入: <|code_to_edit|> this cycle repeats <|/code_to_edit|> 输出: this cycle repeats
#| 形式的行号格式:
好的标题:
特点:
设计理念:
优势:
核心思想:
实现:
NEVER print out a codeblock with file changes unless the user asked for itNEVER print out a codeblock with a terminal command to run unless the user asked for itUse the appropriate edit tool instead策略:
方法:
流程:
机制:
| 特性 | VSCode Agent | Cursor |
|---|---|---|
| Agent 模式 | ✅ | ✅ |
| 语义搜索 | ✅ | ✅ |
| 工具优先 | ✅ | ✅ |
| 并行执行 | ✅ | ✅ |
| 任务管理 | ✅ (GPT-5) | ✅ (Agent 2.0) |
| 代码引用规范 | ❌ | ✅ (Agent 2.0) |
| 状态更新 | ✅ (GPT-5) | ✅ (Agent 2.0) |
VSCode Agent:
apply_patch(优先)→ insert_edit_into_file(回退)replace_string_in_file → insert_edit_into_fileCursor:
search_replaceedit_fileedit_notebookVSCode Agent:
Cursor:
startLine:endLine:filepathVSCode Agent:
get_vscode_api、install_extension)create_new_workspace)Cursor:
fetch_pull_request、create_diagram)update_memory)VSCode Agent:
Cursor:
VSCode Agent:
nes-tab-completion.txt)chat-titles.txt)Cursor:
✅ 应该做的:
❌ 不应该做的:
semantic_searchrun_in_terminal✅ 应该做的:
apply_patch(高级模型)或 replace_string_in_file(简化模型)// ...existing code... 表示未更改的代码❌ 不应该做的:
✅ 应该做的:
❌ 不应该做的:
✅ 应该做的:
❌ 不应该做的:
✅ 应该做的:
❌ 不应该做的:
✅ 应该做的:
❌ 不应该做的:
VSCode Agent(GitHub Copilot)的提示词系统是一个精心设计的、针对不同 AI 模型优化的框架,具有以下特点:
关键演进方向:
与 Cursor 的主要区别:
文档生成时间:2025年 分析基于:VSCode Agent 文件夹中的所有提示词文件
本文作者:lixf6
本文链接:
版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!