{"meta":{"title":"GitHub Copilot Chat Cookbook","intro":"Find examples of prompts to use with GitHub Copilot Chat.","product":"GitHub Copilot","breadcrumbs":[{"href":"/en/copilot","title":"GitHub Copilot"},{"href":"/en/copilot/tutorials","title":"Tutorials"},{"href":"/en/copilot/tutorials/copilot-chat-cookbook","title":"GitHub Copilot Chat Cookbook"}],"documentType":"subcategory"},"body":"# GitHub Copilot Chat Cookbook\n\nFind examples of prompts to use with GitHub Copilot Chat.\n\n## Spotlight\n\n* [Generating unit tests](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)\n\n  Copilot Chat can help with generating unit tests for a function. (Image: /assets/images/copilot-landing/generating\\_unit\\_tests.png)\n\n* [Improving code readability and maintainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)\n\n  Copilot Chat can suggest ways to make your code easier to understand and maintain. (Image: /assets/images/copilot-landing/improving\\_code\\_readability.png)\n\n* [Debugging invalid JSON](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)\n\n  Copilot Chat can identify and resolve syntax errors or structural issues in JSON data. (Image: /assets/images/copilot-landing/debugging\\_invalid\\_json.png)\n\n## Links\n\n* [Creating templates](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-templates)\n\n  Copilot Chat can help you create templates to streamline your workflow and ensure consistency across your projects.\n\n* [Extracting information](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/extracting-information)\n\n  Copilot Chat in GitHub can help you extract key information from issues and discussions.\n\n* [Synthesizing research](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/synthesizing-research)\n\n  Copilot Chat can help you synthesize research findings and insights from multiple sources into a cohesive summary.\n\n* [Creating diagrams](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/creating-diagrams)\n\n  GitHub Copilot Chat can help you create diagrams to better understand your data and communicate insights.\n\n* [Generating tables](/en/copilot/tutorials/copilot-chat-cookbook/communicate-effectively/generating-tables)\n\n  Copilot Chat can help you create tables to organize information and present it clearly.\n\n* [Debugging invalid JSON](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/debug-invalid-json)\n\n  Copilot Chat can identify and resolve syntax errors or structural issues in JSON data.\n\n* [Handling API rate limits](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/handle-api-rate-limits)\n\n  Copilot Chat can help handle API rate limits by suggesting code that detects them and implements retry logic.\n\n* [Diagnosing test failures](/en/copilot/tutorials/copilot-chat-cookbook/debug-errors/diagnose-test-failures)\n\n  Copilot Chat can help you understand why a test is failing and suggest how to fix it.\n\n* [Exploring potential feature implementations](/en/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/explore-implementations)\n\n  Copilot Chat can help explore different approaches for implementing a single feature.\n\n* [Analyzing and incorporating user feedback](/en/copilot/tutorials/copilot-chat-cookbook/analyze-functionality/analyze-feedback)\n\n  Copilot Chat can enhance the process of incorporating user feedback into your project.\n\n* [Improving code readability and maintainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/improve-code-readability)\n\n  Copilot Chat can suggest ways to make your code easier to understand and maintain.\n\n* [Fixing lint errors](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-lint-errors)\n\n  Copilot Chat can suggest ways to fix issues identified by a code linter.\n\n* [Refactoring for performance optimization](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-optimization)\n\n  Copilot Chat can suggest ways to speed up slow-running code.\n\n* [Refactoring for environmental sustainability](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-for-sustainability)\n\n  Copilot Chat can suggest ways to make code more environmentally friendly.\n\n* [Refactoring to implement a design pattern](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-design-patterns)\n\n  Copilot Chat can suggest design patterns that you can use to improve your code.\n\n* [Refactoring data access layers](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/refactor-data-access-layers)\n\n  Copilot Chat can suggest ways to decouple your data access code from your business logic, making an application easier to maintain and scale.\n\n* [Decoupling business logic from UI components](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/decouple-business-logic)\n\n  Copilot Chat can help you separate your business logic from your user interface code, making it easier to maintain and scale your application.\n\n* [Handling cross-cutting concerns](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/handle-cross-cutting)\n\n  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.\n\n* [Simplifying complex inheritance hierarchies](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/simplify-inheritance-hierarchies)\n\n  Copilot Chat can help you to refactor code to avoid classes with multiple layers of inheritance.\n\n* [Fixing database deadlocks or data integrity issues](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/fix-database-deadlocks)\n\n  Copilot Chat can help you avoid code that causes slow or blocked database operations, or tables with missing or incorrect data.\n\n* [Translating code to a different programming language](/en/copilot/tutorials/copilot-chat-cookbook/refactor-code/translate-code)\n\n  Copilot Chat can help you rewrite code to perform the same operations but in a different programming language.\n\n* [Creating issues](/en/copilot/tutorials/copilot-chat-cookbook/document-code/creating-issues)\n\n  Copilot Chat can help you quickly create issues without filling out every field manually.\n\n* [Documenting legacy code](/en/copilot/tutorials/copilot-chat-cookbook/document-code/document-legacy-code)\n\n  Copilot Chat can help with documenting legacy code.\n\n* [Explaining legacy code](/en/copilot/tutorials/copilot-chat-cookbook/document-code/explain-legacy-code)\n\n  Copilot Chat can help with explaining unfamiliar code.\n\n* [Explaining complex algorithms or logic](/en/copilot/tutorials/copilot-chat-cookbook/document-code/explain-complex-logic)\n\n  Copilot Chat can help add clear and concise documentation on complex algorithms or logic.\n\n* [Syncing documentation with code changes](/en/copilot/tutorials/copilot-chat-cookbook/document-code/sync-documentation)\n\n  Copilot Chat can help with keeping code documentation up-to-date.\n\n* [Writing discussions or blog posts](/en/copilot/tutorials/copilot-chat-cookbook/document-code/write-discussions-or-blog-posts)\n\n  Copilot Chat can help you generate ideas, outline, or draft discussions or blog posts.\n\n* [Generating unit tests](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/generate-unit-tests)\n\n  Copilot Chat can help with generating unit tests for a function.\n\n* [Creating mock objects to abstract layers](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/create-mock-objects)\n\n  Copilot Chat can help with creating mock objects that you can use for unit tests.\n\n* [Creating end-to-end tests for a webpage](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/create-end-to-end-tests)\n\n  Copilot Chat can help with generating end-to-end tests.\n\n* [Updating unit tests to match code changes](/en/copilot/tutorials/copilot-chat-cookbook/testing-code/update-unit-tests)\n\n  Copilot Chat can help with updating your tests.\n\n* [Securing your repository](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/secure-your-repository)\n\n  Copilot Chat can help you to secure your repository and your code.\n\n* [Managing dependency updates](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/manage-dependency-updates)\n\n  Copilot Chat can help you get set up with Dependabot to streamline dependency updates.\n\n* [Finding existing vulnerabilities in code](/en/copilot/tutorials/copilot-chat-cookbook/analyze-security/find-vulnerabilities)\n\n  Copilot Chat can help find common vulnerabilities in your code and suggest fixes."}