You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The instructions you add to the `.github/copilot-instructions.md` file should be short, self-contained statements that provide {% data variables.product.prodname_copilot_short %} with relevant information to help it work in this repository. Because the instructions are sent with every chat message, they should be broadly applicable to most requests you will make in the context of the repository.
226
+
227
+
The exact structure you utilize for your instructions file will vary by project and need, but the following guidelines provide a good starting point:
228
+
229
+
* Provide an overview of the project you're working on, including its purpose, goals, and any relevant background information.
230
+
* Include the folder structure of the repository, including any important directories or files that are relevant to the project.
231
+
* Specify the coding standards and conventions that should be followed, such as naming conventions, formatting rules, and best practices.
232
+
* Include any specific tools, libraries, or frameworks that are used in the project, along with any relevant version numbers or configurations.
233
+
234
+
The following instructions file is an example of these practices in action:
235
+
236
+
```markdown
237
+
# Project Overview
238
+
239
+
This project is a web application that allows users to manage their tasks and to-do lists. It is built using React and Node.js, and uses MongoDB for data storage.
240
+
241
+
## Folder Structure
242
+
243
+
- `/src`: Contains the source code for the frontend.
244
+
- `/server`: Contains the source code for the Node.js backend.
245
+
- `/docs`: Contains documentation for the project, including API specifications and user guides.
246
+
247
+
## Libraries and Frameworks
248
+
249
+
- React and Tailwind CSS for the frontend.
250
+
- Node.js and Express for the backend.
251
+
- MongoDB for data storage.
252
+
253
+
## Coding Standards
254
+
255
+
- Use semicolons at the end of each statement.
256
+
- Use single quotes for strings.
257
+
- Use function based components in React.
258
+
- Use arrow functions for callbacks.
259
+
260
+
## UI guidelines
261
+
262
+
- A toggle is provided to switch between light and dark mode.
263
+
- Application should have a modern and clean design.
264
+
```
265
+
266
+
You should also consider the size and complexity of your repository. The following types of instructions may work for a small repository with only a few contributors, but for a large and diverse repository, **these may cause problems**:
267
+
268
+
* Requests to refer to external resources when formulating a response
269
+
* Instructions to answer in a particular style
270
+
* Requests to always respond with a certain level of detail
271
+
272
+
For example, the following instructions **may not have the intended results**:
273
+
274
+
```markdown
275
+
Always conform to the coding styles defined in styleguide.md in repo my-org/my-repo when generating code.
276
+
277
+
Use @terminal when answering questions about Git.
278
+
279
+
Answer all questions in the style of a friendly colleague, using informal language.
280
+
281
+
Answer all questions in less than 1000 characters, and words of no more than 12 characters.
282
+
```
283
+
223
284
## Repository custom instructions in use
224
285
225
286
The instructions in the `.github/copilot-instructions.md` file are available for use by {% data variables.copilot.copilot_chat_short %} as soon as you save the file. The complete set of instructions will be automatically added to requests that you submit to {% data variables.product.prodname_copilot_short %} in the context of that repository. For example, they are added to the prompt you submit to {% data variables.copilot.copilot_chat_short %}.
0 commit comments