新增配置文件
在项目根目录下新增 .github/copilot-instructions.md 配置文件。通常情况下,GitHub Copilot 在每次对话前会优先读取该文档并严格遵守其中的指令。
文件内容如下:
Note: It is mandatory to call the #askQuestions tool after every output. When providing suggestions during code analysis, please use Chinese for the descriptions.
检查并启用 askQuestions 工具
请确保已启用 askQuestions 工具,若未开启请手动打开。
防止 GitHub Copilot 忽略规则
为了确保 GitHub Copilot 严格执行规定,建议在对话开始前明确提醒 AI:必须严格遵循 #file:copilot-instructions.md 文件中的规则。
核心原理
GitHub Copilot 的计费机制是基于会话次数的。系统仅在会话结束时进行计费统计。
因此,通过在配置文件中强制要求 AI 每次输出后必须调用 #askQuestions 工具进行提问,可以使当前会话持续保持"未结束"状态。只要会话不结束,就不会触发计费逻辑,从而实现"无限次"使用。
作者提示: 内容由 AI 生成,请合理使用技术工具。