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
Copy file name to clipboardExpand all lines: docs/copilot/guides/context-engineering-guide.md
+26-20Lines changed: 26 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,25 +14,30 @@ Context engineering is a systematic approach to providing AI agents with targete
14
14
15
15
The high-level workflow for context engineering in VS Code consists of the following steps:
16
16
17
-
1. Curate project-wide context in custom instructions
18
-
1. Generate an implementation plan for the feature using a planning chat mode and prompt
19
-
1. Generate the implementation code from the implementation plan
17
+
1. Curate project-wide context: use custom instructions to include relevant documentation (for example, architecture, design, contributor guidelines) as context to all chat interactions.
18
+
1. Generate implementation plan: create a planning persona by using a custom chat mode and a prompt to generate a detailed feature implementation plan.
19
+
1. Generate implementation code: use custom instructions to generate code based on the implementation plan that adheres to your coding guidelines.
20
20
21
-
Workflow overview:
21
+
As you work through the steps, you can iterate and refine the output with follow-up prompts in the chat.
22
22
23
+
The following diagram illustrates a context engineering workflow in VS Code:
24
+
25
+

@@ -56,7 +62,7 @@ To ground the AI agent in the specifics of the project, collect key project info
56
62
> *`Generate a PRODUCT.md file that describes the product functionality of the project.`
57
63
> *`Generate a CONTRIBUTING.md file that describes how to contribute to the project.`
58
64
59
-
1. Create a `.github/copilot-instructions.md` file at the root of your repository.
65
+
1. Create a `.github/copilot-instructions.md`[instructions file](/docs/copilot/customization/custom-instructions.md#use-a-githubcopilot-instructionsmd-file) at the root of your repository.
60
66
61
67
The instructions in this file are automatically included in all chat interactions as context for the AI agent.
62
68
@@ -78,7 +84,7 @@ To ground the AI agent in the specifics of the project, collect key project info
78
84
79
85
Once you have the project-specific context in place, you can use AI to prompt the creation of an implementation plan for a new feature or bug fix. Generating an implementation plan is an iterative process that might require multiple rounds of refinement to ensure its complete and accurate.
80
86
81
-
With a custom chat mode for planning, you can create a dedicated persona with planning-specific guidelines and tools (for example, read-only access to the codebase).
87
+
With a [custom chat mode](/docs/copilot/customization/custom-chat-modes.md) for planning, you can create a dedicated persona with planning-specific guidelines and tools (for example, read-only access to the codebase).
82
88
83
89
1. Create a planning document template `plan-template.md` that defines the structure and sections of the implementation plan document.
84
90
@@ -115,7 +121,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
115
121
Outline how the feature will be tested and validated.
116
122
```
117
123
118
-
1. Create a planning chat mode `.github/chatmodes/plan.chatmode.md` that defines the planning persona. In planning mode, the agent operates is instructed not to perform implementation tasks, but to focus on creating the implementation plan.
124
+
1. Create a planning [chat mode](/docs/copilot/customization/custom-chat-modes.md)`.github/chatmodes/plan.chatmode.md` that defines the planning persona. In planning mode, the agent operates is instructed not to perform implementation tasks, but to focus on creating the implementation plan.
119
125
120
126
To create a chat mode, run the **Chat: Configure Chat Modes** > **Create New custom chat mode file** command in the Command Palette.
121
127
@@ -180,7 +186,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
180
186
181
187
You can also reference a GitHub issue to provide specific context: `Implement the feature described in issue #43`. Make sure to
182
188
183
-
1. Optionally, create a prompt file `.github/prompts/plan.prompt.md` that invokes plan mode and instructs the agent to create an implementation plan from a provided feature request.
189
+
1. Optionally, create a [prompt file](/docs/copilot/customization/prompt-files.md)`.github/prompts/plan.prompt.md` that invokes plan mode and instructs the agent to create an implementation plan from a provided feature request.
184
190
185
191
By using a prompt file, you can easily instruct the agent to create an implementation plan by using a slash command, such as `/plan`.
186
192
@@ -204,7 +210,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
204
210
205
211
After you have generated and refined the implementation plan, you can now use AI to implement the feature by generating code from the implementation plan.
206
212
207
-
If you have specific coding guidelines and practices for your project, you can create custom instructions that are applied automatically in all chat interactions.
213
+
If you have specific coding guidelines and practices for your project, you can create [custom instructions](/docs/copilot/customization/custom-instructions.md) that are applied automatically in all chat interactions.
208
214
209
215
1. Create a `.github/instructions/coding-guidelines.instructions.md` Markdown file that describes the coding standards and guidelines for your project.
210
216
@@ -253,7 +259,7 @@ If you have specific coding guidelines and practices for your project, you can c
253
259
254
260
For example, enter a chat prompt like `implement it based on #<my-plan>.md`, which references the implementation plan file.
255
261
256
-
1. Optionally, create a custom chat mode `.github/chatmodes/implement.chatmode.md` specialized in implementing code based on a plan.
262
+
1. Optionally, create a [custom chat mode](/docs/copilot/customization/custom-chat-modes.md)`.github/chatmodes/implement.chatmode.md` specialized in implementing code based on a plan.
257
263
258
264
You might want to configure the `model` metadata property to use a language model that is optimized for code generation.
0 commit comments