The video explains how to customize GitHub Copilot in Visual Studio Code by providing high-level project context through a “copilot instructions” markdown file and relevant files like the Prisma schema, which guide Copilot to generate more accurate and consistent code suggestions. It emphasizes organizing these customizations in the project settings and the GitHub folder to improve collaboration, productivity, and adherence to coding standards.
The video explains how to customize GitHub Copilot in Visual Studio Code to better suit your project needs. It emphasizes the importance of providing context to Copilot through various means, such as referencing specific files and using the “copilot instructions” markdown file. This helps Copilot generate more relevant and accurate code suggestions by understanding the overall project structure and specific coding preferences.
The presenter highlights the use of the “copilot instructions” markdown file, which resides in the GitHub folder of the project. This file contains high-level descriptions of the project, including its purpose, structure, and coding conventions. By including this file, developers can guide Copilot to follow certain patterns, such as preferring functional React components over class-based ones, ensuring consistency across the codebase.
It is noted that the instructions provided in the markdown file are used only in chat interactions, not for code completion or suggestions. These instructions are included in every chat call, so they should be concise and relevant to avoid exceeding token limits. The presenter advises focusing on high-level, project-wide information that is applicable across multiple interactions, which helps maintain clarity and efficiency.
The video also discusses the importance of including relevant files, such as the Prisma schema, to help Copilot understand the database structure and generate appropriate code. These files can be added through the project settings JSON, allowing for persistent inclusion of critical files that influence code generation. This approach ensures that Copilot has the necessary context for complex tasks involving database interactions or other schema-dependent code.
Finally, the presenter explains how to set up and organize these customizations, including placing the “copilot instructions” file in the GitHub folder and configuring the settings JSON for additional files. These practices make the customization process scalable and shareable among team members, ultimately improving collaboration and code quality. The overall message is that thoughtful configuration of Copilot can significantly enhance productivity and consistency in software development projects.