Skip to content

Commit 77f3a2f

Browse files
committed
Add links and workflow image
1 parent 1de691d commit 77f3a2f

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

docs/copilot/guides/context-engineering-guide.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,30 @@ Context engineering is a systematic approach to providing AI agents with targete
1414

1515
The high-level workflow for context engineering in VS Code consists of the following steps:
1616

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.
2020

21-
Workflow overview:
21+
As you work through the steps, you can iterate and refine the output with follow-up prompts in the chat.
2222

23+
The following diagram illustrates a context engineering workflow in VS Code:
24+
25+
![Diagram that shows the context engineering workflow in VS Code consisting of three main steps.](../images/context-engineering-guide/context-engineering-workflow.png)
26+
27+
<!--
2328
```mermaid
2429
flowchart TD
2530
%% Nodes
26-
C1(["Project description"]) --> curate[Curate project context]
27-
C2(["Architecture"]) --> curate
28-
C3(["Other"]) --> curate
29-
task(["Task context"]) --> plan["Generate plan"]
30-
curate --> plan
31-
plan --> P(["&lt;feature&gt;-plan.md"])
32-
T([Plan template]) --> P(["&lt;feature&gt;-plan.md"])
33-
P --> implement["Generate code"]
34-
implement --> code(["&lt;code&gt;"])
35-
C4([Coding guidelines]) --> code
31+
C1(["Project description"]) --&gt; curate[Curate project context]
32+
C2(["Architecture"]) --&gt; curate
33+
C3(["Other"]) --&gt; curate
34+
task(["Task context"]) --&gt; plan["Generate plan"]
35+
curate --&gt; plan
36+
plan --&gt; P(["&lt;feature&gt;-plan.md"])
37+
T([Plan template]) --&gt; P(["&lt;feature&gt;-plan.md"])
38+
P --&gt; implement["Generate code"]
39+
implement --&gt; code(["&lt;code&gt;"])
40+
C4([Coding guidelines]) --&gt; code
3641
3742
%% Styles
3843
classDef input fill:#f5f5f5,stroke:#616161,stroke-width:2px;
@@ -43,6 +48,7 @@ flowchart TD
4348
class curate,plan,implement process;
4449
class P,code output;
4550
```
51+
-->
4652

4753
## Step 1: Curate project-wide context
4854

@@ -56,7 +62,7 @@ To ground the AI agent in the specifics of the project, collect key project info
5662
> * `Generate a PRODUCT.md file that describes the product functionality of the project.`
5763
> * `Generate a CONTRIBUTING.md file that describes how to contribute to the project.`
5864
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.
6066

6167
The instructions in this file are automatically included in all chat interactions as context for the AI agent.
6268

@@ -78,7 +84,7 @@ To ground the AI agent in the specifics of the project, collect key project info
7884

7985
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.
8086

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).
8288

8389
1. Create a planning document template `plan-template.md` that defines the structure and sections of the implementation plan document.
8490

@@ -115,7 +121,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
115121
Outline how the feature will be tested and validated.
116122
```
117123

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.
119125

120126
To create a chat mode, run the **Chat: Configure Chat Modes** > **Create New custom chat mode file** command in the Command Palette.
121127

@@ -180,7 +186,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
180186

181187
You can also reference a GitHub issue to provide specific context: `Implement the feature described in issue #43`. Make sure to
182188

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.
184190

185191
By using a prompt file, you can easily instruct the agent to create an implementation plan by using a slash command, such as `/plan`.
186192

@@ -204,7 +210,7 @@ With a custom chat mode for planning, you can create a dedicated persona with pl
204210

205211
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.
206212

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.
208214

209215
1. Create a `.github/instructions/coding-guidelines.instructions.md` Markdown file that describes the coding standards and guidelines for your project.
210216

@@ -253,7 +259,7 @@ If you have specific coding guidelines and practices for your project, you can c
253259

254260
For example, enter a chat prompt like `implement it based on #<my-plan>.md`, which references the implementation plan file.
255261

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.
257263

258264
You might want to configure the `model` metadata property to use a language model that is optimized for code generation.
259265

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)