# GitHub Copilot Chat 指南

查找与 GitHub Copilot 聊天功能 配合使用的提示示例。

## Spotlight

* [生成单元测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)

  副驾驶聊天 可帮助生成函数的单元测试。 (Image: /assets/images/copilot-landing/generating\_unit\_tests.png)

* [提高代码可读性和可维护性](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)

  副驾驶聊天 可以建议使代码更易于理解和维护的方法。 (Image: /assets/images/copilot-landing/improving\_code\_readability.png)

* [调试无效的 JSON](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)

  副驾驶聊天 能够识别并解决 JSON 数据中的语法错误或结构问题。 (Image: /assets/images/copilot-landing/debugging\_invalid\_json.png)

## Links

* [创建模板](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-templates)

  副驾驶聊天 可帮助你创建模板，以便简化工作流并确保项目间的一致性。

* [提取信息](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/extracting-information)

  GitHub中的 Copilot Chat 可以帮助你从问题和讨论中提取关键信息。

* [合成研究](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/synthesizing-research)

  Copilot 对话助手可帮助你将来自多个来源的研究结果和见解合成为一份连贯的摘要。

* [创建关系图](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-diagrams)

  GitHub Copilot Chat 可以帮助你创建图表，以便更好地了解数据并传达见解。

* [表格生成](/zh/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/generating-tables)

  副驾驶聊天 可以帮助你创建表，以便组织信息并清晰呈现。

* [调试无效的 JSON](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)

  副驾驶聊天 能够识别并解决 JSON 数据中的语法错误或结构问题。

* [处理 API 速率限制](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/handle-api-rate-limits)

  副驾驶聊天 可以通过建议检测速率限制并实现重试逻辑的代码，来帮助处理 API 速率限制问题。

* [诊断测试中的失败](/zh/copilot/tutorials/copilot-chat-cookbook/debug-errors/diagnose-test-failures)

  副驾驶聊天 可以帮助了解测试失败的原因，并建议解决方法。

* [探索潜在的功能实现](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/explore-implementations)

  副驾驶聊天 可以帮助探索实现单一功能的不同方法。

* [分析和采纳用户反馈](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/analyze-feedback)

  副驾驶聊天 可以加强将用户反馈纳入项目的过程。

* [提高代码可读性和可维护性](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)

  副驾驶聊天 可以建议使代码更易于理解和维护的方法。

* [修复 lint 错误](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-lint-errors)

  副驾驶聊天 可以建议修复由代码 linter 标识的问题的方法。

* [为性能优化而重构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-optimization)

  副驾驶聊天 可以提出加快运行缓慢的代码的方法建议。

* [为环境可持续性进行重构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-sustainability)

  副驾驶聊天 可以建议如何使代码更加环保。

* [重构以实现设计模式](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-design-patterns)

  副驾驶聊天 可以建议可用于改进代码的设计模式。

* [重构数据访问层](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-data-access-layers)

  副驾驶聊天 可以建议将数据访问代码与业务逻辑分离的方法，从而使应用程序更易于维护和缩放。

* [将业务逻辑从 UI 组件中分离出来](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/decouple-business-logic)

  副驾驶聊天 可帮助你将业务逻辑与用户界面代码分离，从而更易于维护和缩放你的应用程序。

* [处理横切关注点](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/handle-cross-cutting)

  副驾驶聊天 可帮助避免与代码所在方法或函数的核心关注点以外的关注点相关的代码。

* [简化复杂的继承层次结构](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/simplify-inheritance-hierarchies)

  副驾驶聊天 可帮助你重构代码，以避免具有多层继承的类。

* [修复数据库死锁或数据一致性问题](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-database-deadlocks)

  副驾驶聊天 可帮助避免编写导致数据库操作缓慢、阻塞，或产生缺失/错误数据的代码。

* [将代码转换为其他编程语言](/zh/copilot/tutorials/copilot-chat-cookbook/refactor-code/translate-code)

  副驾驶聊天 可以帮助你重写代码以便执行相同的操作，但采用不同的编程语言。

* [创建问题](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/creating-issues)

  副驾驶聊天 可以帮助你快速创建问题，而不需要你手动填写每一字段。

* [为旧代码编写文档](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/document-legacy-code)

  副驾驶聊天 可帮助记录旧代码。

* [解释旧代码](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/explain-legacy-code)

  副驾驶聊天 能够帮助解释不熟悉的代码。

* [解释复杂算法或逻辑](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/explain-complex-logic)

  副驾驶聊天 可以帮助添加关于复杂算法或逻辑的清晰简洁的文档。

* [同步文档以适应代码更改](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/sync-documentation)

  副驾驶聊天 可帮助使代码文档保持最新状态。

* [撰写讨论或博客文章](/zh/copilot/tutorials/copilot-chat-cookbook/document-code/write-discussions-or-blog-posts)

  副驾驶聊天 可帮助你为讨论或博客文章生成创意、大纲或草稿。

* [生成单元测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)

  副驾驶聊天 可帮助生成函数的单元测试。

* [创建模拟对象来使层抽象化](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-mock-objects)

  副驾驶聊天 可帮助创建模拟对象用于单元测试。

* [为网页创建端到端测试](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/create-end-to-end-tests)

  副驾驶聊天 可帮助生成端到端测试。

* [更新单元测试以匹配代码更改](/zh/copilot/tutorials/copilot-chat-cookbook/testing-code/update-unit-tests)

  副驾驶聊天 可帮助更新测试。

* [保护您的仓库](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/secure-your-repository)

  副驾驶聊天 可以帮助保护仓库和代码。

* [管理依赖项更新](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/manage-dependency-updates)

  副驾驶聊天 可以帮助你设置 Dependabot 以简化依赖项更新。

* [在代码中查找现有漏洞](/zh/copilot/tutorials/copilot-chat-cookbook/analyze-security/find-vulnerabilities)

  Copilot Chat 可以帮助查找代码中的常见漏洞并提供修复建议。