# GitHub Copilot Chat Cookbook

Find examples of prompts to use with GitHub Copilot Chat.

## Spotlight

* [Generating unit tests](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)

  Copilot Chat can help with generating unit tests for a function. (Image: /assets/images/copilot-landing/generating\_unit\_tests.png)

* [Improving code readability and maintainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)

  Copilot Chat can suggest ways to make your code easier to understand and maintain. (Image: /assets/images/copilot-landing/improving\_code\_readability.png)

* [Debugging invalid JSON](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)

  Copilot Chat can identify and resolve syntax errors or structural issues in JSON data. (Image: /assets/images/copilot-landing/debugging\_invalid\_json.png)

## Links

* [Creating templates](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-templates)

  Copilot Chat can help you create templates to streamline your workflow and ensure consistency across your projects.

* [Extracting information](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/extracting-information)

  Copilot Chat in GitHub can help you extract key information from issues and discussions.

* [Synthesizing research](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/synthesizing-research)

  Copilot Chat can help you synthesize research findings and insights from multiple sources into a cohesive summary.

* [Creating diagrams](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-diagrams)

  GitHub Copilot Chat can help you create diagrams to better understand your data and communicate insights.

* [Generating tables](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/generating-tables)

  Copilot Chat can help you create tables to organize information and present it clearly.

* [Debugging invalid JSON](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)

  Copilot Chat can identify and resolve syntax errors or structural issues in JSON data.

* [Handling API rate limits](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/handle-api-rate-limits)

  Copilot Chat can help handle API rate limits by suggesting code that detects them and implements retry logic.

* [Diagnosing test failures](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/diagnose-test-failures)

  Copilot Chat can help you understand why a test is failing and suggest how to fix it.

* [Exploring potential feature implementations](/en/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/explore-implementations)

  Copilot Chat can help explore different approaches for implementing a single feature.

* [Analyzing and incorporating user feedback](/en/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/analyze-feedback)

  Copilot Chat can enhance the process of incorporating user feedback into your project.

* [Improving code readability and maintainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)

  Copilot Chat can suggest ways to make your code easier to understand and maintain.

* [Fixing lint errors](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-lint-errors)

  Copilot Chat can suggest ways to fix issues identified by a code linter.

* [Refactoring for performance optimization](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-optimization)

  Copilot Chat can suggest ways to speed up slow-running code.

* [Refactoring for environmental sustainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-sustainability)

  Copilot Chat can suggest ways to make code more environmentally friendly.

* [Refactoring to implement a design pattern](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-design-patterns)

  Copilot Chat can suggest design patterns that you can use to improve your code.

* [Refactoring data access layers](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-data-access-layers)

  Copilot Chat can suggest ways to decouple your data access code from your business logic, making an application easier to maintain and scale.

* [Decoupling business logic from UI components](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/decouple-business-logic)

  Copilot Chat can help you separate your business logic from your user interface code, making it easier to maintain and scale your application.

* [Handling cross-cutting concerns](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/handle-cross-cutting)

  Copilot Chat can help you avoid code that relates to a concern other than the core concern of the method or function in which the code is located.

* [Simplifying complex inheritance hierarchies](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/simplify-inheritance-hierarchies)

  Copilot Chat can help you to refactor code to avoid classes with multiple layers of inheritance.

* [Fixing database deadlocks or data integrity issues](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-database-deadlocks)

  Copilot Chat can help you avoid code that causes slow or blocked database operations, or tables with missing or incorrect data.

* [Translating code to a different programming language](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/translate-code)

  Copilot Chat can help you rewrite code to perform the same operations but in a different programming language.

* [Creating issues](/en/copilot/tutorials/copilot-chat-cookbook/document-code/creating-issues)

  Copilot Chat can help you quickly create issues without filling out every field manually.

* [Documenting legacy code](/en/copilot/tutorials/copilot-chat-cookbook/document-code/document-legacy-code)

  Copilot Chat can help with documenting legacy code.

* [Explaining legacy code](/en/copilot/tutorials/copilot-chat-cookbook/document-code/explain-legacy-code)

  Copilot Chat can help with explaining unfamiliar code.

* [Explaining complex algorithms or logic](/en/copilot/tutorials/copilot-chat-cookbook/document-code/explain-complex-logic)

  Copilot Chat can help add clear and concise documentation on complex algorithms or logic.

* [Syncing documentation with code changes](/en/copilot/tutorials/copilot-chat-cookbook/document-code/sync-documentation)

  Copilot Chat can help with keeping code documentation up-to-date.

* [Writing discussions or blog posts](/en/copilot/tutorials/copilot-chat-cookbook/document-code/write-discussions-or-blog-posts)

  Copilot Chat can help you generate ideas, outline, or draft discussions or blog posts.

* [Generating unit tests](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)

  Copilot Chat can help with generating unit tests for a function.

* [Creating mock objects to abstract layers](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/create-mock-objects)

  Copilot Chat can help with creating mock objects that you can use for unit tests.

* [Creating end-to-end tests for a webpage](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/create-end-to-end-tests)

  Copilot Chat can help with generating end-to-end tests.

* [Updating unit tests to match code changes](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/update-unit-tests)

  Copilot Chat can help with updating your tests.

* [Securing your repository](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/secure-your-repository)

  Copilot Chat can help you to secure your repository and your code.

* [Managing dependency updates](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/manage-dependency-updates)

  Copilot Chat can help you get set up with Dependabot to streamline dependency updates.

* [Finding existing vulnerabilities in code](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/find-vulnerabilities)

  Copilot Chat can help find common vulnerabilities in your code and suggest fixes.