1
2
3
Copilot新功能
1,将会话保存成reusable prompt
/savePrompt
subAgent
不是异步或在后台运行的, 启用:先启用 runSubagent 工具, Use a subagent to research the best authentication methods for web applications. Summarize the findings. Run #runSubagent to research the user’s task comprehensively using read-only tools. Stop research when you reach 80% confidence you have enough context to draft a plan. Return this context. 让ai使用自定义或内建的agent来充当subagent示例: Run the research agent as a subagent to research the best auth methods for this project. Use the plan agent in a subagent to create an implementation plan for myfeature. Then save the plan in plans/myfeature.plan.md
代理任务
代理任务给 Copilot coding agent 选择Delegate to Agent 即可,可以从列表里面选择要处理的agent
Copilot coding agent
可以通过将issue指派给copilot,或在vscode里面发起
最后会创建一个pr,然后可以在pr里面评论at它让它继续修复 vscode还需要安装一个Github Pull Request插件
instructions files
可以通过glob patterns有条件地应用 agent.md文件,可以应用到特定目录 可以使用markdown链接引用特定的上下文 可以把 instructions 文件拆成几个 如:
1
2
Apply the [general coding guidelines](./general-coding.instructions.md) to all code.
要在指令文件里面引用agent tools:#tool:<tool-name>,如#tool:githubRepo
使用AGENTS.md
更通用,支持嵌套,需要设置里面开启 chat.useNestedAgentsMdFiles 其实instructions files也可以通过applyTo设置应用到不同的folder structure 还可以在settings.json里面通过txt或file key进行配置
1
2
3
4
5
6
7
8
9
{
"github.copilot.chat.pullRequestDescriptionGeneration.instructions": [
{ "text": "Always include a list of key changes." }
],
"github.copilot.chat.reviewSelection.instructions": [
{ "file": "guidance/backend-review-guidelines.md" },
{ "file": "guidance/frontend-review-guidelines.md" }
]
}
可以在prompt文件和自定义agents里面Reuse and reference instructions files
prompt
使用/使用, argument-hint 提示 可以打开 chat.promptFilesRecommendations 让它提示你使用合适的prompt命令 tips: 定义好输出格式,提示示例,可以引用instructions files 还可以使用agent引用自定义的agent
自定义agents
1
2
3
4
5
.github/agents 目录下
use handoffs to create guided workflows between agents,需要手点,会在响应完成后出现buttons
之前叫 custom chat modes(.github/chatmodes/*.chatmode.md)
通过label定义button的名字,prompt字段定义要发送的提示词
也可以引用 instructions files
https://github.com/github/awesome-copilot/tree/main