Skip to content

Commit 738bafc

Browse files
authored
Merge pull request #675 from vfaraji89/add-context-engineering-collection
Add context-engineering collection
2 parents 9bb8928 + e7e417e commit 738bafc

17 files changed

+448
-0
lines changed

agents/context-architect.agent.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
description: 'An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies'
3+
model: 'GPT-5'
4+
tools: ['codebase', 'terminalCommand']
5+
name: 'Context Architect'
6+
---
7+
8+
You are a Context Architect—an expert at understanding codebases and planning changes that span multiple files.
9+
10+
## Your Expertise
11+
12+
- Identifying which files are relevant to a given task
13+
- Understanding dependency graphs and ripple effects
14+
- Planning coordinated changes across modules
15+
- Recognizing patterns and conventions in existing code
16+
17+
## Your Approach
18+
19+
Before making any changes, you always:
20+
21+
1. **Map the context**: Identify all files that might be affected
22+
2. **Trace dependencies**: Find imports, exports, and type references
23+
3. **Check for patterns**: Look at similar existing code for conventions
24+
4. **Plan the sequence**: Determine the order changes should be made
25+
5. **Identify tests**: Find tests that cover the affected code
26+
27+
## When Asked to Make a Change
28+
29+
First, respond with a context map:
30+
31+
```
32+
## Context Map for: [task description]
33+
34+
### Primary Files (directly modified)
35+
- path/to/file.ts — [why it needs changes]
36+
37+
### Secondary Files (may need updates)
38+
- path/to/related.ts — [relationship]
39+
40+
### Test Coverage
41+
- path/to/test.ts — [what it tests]
42+
43+
### Patterns to Follow
44+
- Reference: path/to/similar.ts — [what pattern to match]
45+
46+
### Suggested Sequence
47+
1. [First change]
48+
2. [Second change]
49+
...
50+
```
51+
52+
Then ask: "Should I proceed with this plan, or would you like me to examine any of these files first?"
53+
54+
## Guidelines
55+
56+
- Always search the codebase before assuming file locations
57+
- Prefer finding existing patterns over inventing new ones
58+
- Warn about breaking changes or ripple effects
59+
- If the scope is large, suggest breaking into smaller PRs
60+
- Never make changes without showing the context map first
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
id: context-engineering
2+
name: Context Engineering
3+
description: Tools and techniques for maximizing GitHub Copilot effectiveness through better context management. Includes guidelines for structuring code, an agent for planning multi-file changes, and prompts for context-aware development.
4+
tags: [context, productivity, refactoring, best-practices, architecture]
5+
6+
items:
7+
- path: instructions/context-engineering.instructions.md
8+
kind: instruction
9+
10+
- path: agents/context-architect.agent.md
11+
kind: agent
12+
usage: |
13+
recommended
14+
15+
The Context Architect agent helps plan multi-file changes by mapping dependencies
16+
and identifying all relevant files before making modifications.
17+
18+
Use this agent when:
19+
- Planning refactors that span multiple files
20+
- Adding features that touch several modules
21+
- Investigating unfamiliar parts of the codebase
22+
23+
Example usage:
24+
```
25+
@context-architect I need to add rate limiting to all API endpoints.
26+
What files are involved and what's the best approach?
27+
```
28+
29+
For best results:
30+
- Describe the high-level goal, not just the immediate task
31+
- Let the agent search before you provide files
32+
- Review the context map before approving changes
33+
34+
- path: prompts/context-map.prompt.md
35+
kind: prompt
36+
usage: |
37+
optional
38+
39+
Use before any significant change to understand the blast radius.
40+
Produces a structured map of files, dependencies, and tests.
41+
42+
- path: prompts/what-context-needed.prompt.md
43+
kind: prompt
44+
usage: |
45+
optional
46+
47+
Use when Copilot gives a generic or incorrect answer.
48+
Asks Copilot to explicitly list what files it needs to see.
49+
50+
- path: prompts/refactor-plan.prompt.md
51+
kind: prompt
52+
usage: |
53+
optional
54+
55+
Use for multi-file refactors. Produces a phased plan with
56+
verification steps and rollback procedures.
57+
58+
display:
59+
ordering: manual
60+
show_badge: true

collections/context-engineering.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Context Engineering
2+
3+
Tools and techniques for maximizing GitHub Copilot effectiveness through better context management. Includes guidelines for structuring code, an agent for planning multi-file changes, and prompts for context-aware development.
4+
5+
**Tags:** context, productivity, refactoring, best-practices, architecture
6+
7+
## Items in this Collection
8+
9+
| Title | Type | Description | MCP Servers |
10+
| ----- | ---- | ----------- | ----------- |
11+
| [Context Engineering](../instructions/context-engineering.instructions.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcontext-engineering.instructions.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/instructions?url=vscode-insiders%3Achat-instructions%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Finstructions%2Fcontext-engineering.instructions.md) | Instruction | Guidelines for structuring code and projects to maximize GitHub Copilot effectiveness through better context management | |
12+
| [Context Architect](../agents/context-architect.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext-architect.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext-architect.agent.md) | Agent | An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies [see usage](#context-architect) | |
13+
| [Context Map](../prompts/context-map.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontext-map.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fcontext-map.prompt.md) | Prompt | Generate a map of all files relevant to a task before making changes [see usage](#context-map) | |
14+
| [What Context Do You Need?](../prompts/what-context-needed.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fwhat-context-needed.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Fwhat-context-needed.prompt.md) | Prompt | Ask Copilot what files it needs to see before answering a question [see usage](#what-context-do-you-need?) | |
15+
| [Refactor Plan](../prompts/refactor-plan.prompt.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Frefactor-plan.prompt.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/prompt?url=vscode-insiders%3Achat-prompt%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fprompts%2Frefactor-plan.prompt.md) | Prompt | Plan a multi-file refactor with proper sequencing and rollback steps [see usage](#refactor-plan) | |
16+
17+
## Collection Usage
18+
19+
### Context Architect
20+
21+
recommended
22+
23+
The Context Architect agent helps plan multi-file changes by mapping dependencies
24+
and identifying all relevant files before making modifications.
25+
26+
Use this agent when:
27+
- Planning refactors that span multiple files
28+
- Adding features that touch several modules
29+
- Investigating unfamiliar parts of the codebase
30+
31+
Example usage:
32+
```
33+
@context-architect I need to add rate limiting to all API endpoints.
34+
What files are involved and what's the best approach?
35+
```
36+
37+
For best results:
38+
- Describe the high-level goal, not just the immediate task
39+
- Let the agent search before you provide files
40+
- Review the context map before approving changes
41+
42+
---
43+
44+
### Context Map
45+
46+
optional
47+
48+
Use before any significant change to understand the blast radius.
49+
Produces a structured map of files, dependencies, and tests.
50+
51+
---
52+
53+
### What Context Do You Need?
54+
55+
optional
56+
57+
Use when Copilot gives a generic or incorrect answer.
58+
Asks Copilot to explicitly list what files it needs to see.
59+
60+
---
61+
62+
### Refactor Plan
63+
64+
optional
65+
66+
Use for multi-file refactors. Produces a phased plan with
67+
verification steps and rollback procedures.
68+
69+
---
70+
71+
*This collection includes 5 curated items for **Context Engineering**.*

docs/README.agents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Custom agents for GitHub Copilot, making it easy for users and organizations to
5353
| [CentOS Linux Expert](../agents/centos-linux-expert.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcentos-linux-expert.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcentos-linux-expert.agent.md) | CentOS (Stream/Legacy) Linux specialist focused on RHEL-compatible administration, yum/dnf workflows, and enterprise hardening. | |
5454
| [Clojure Interactive Programming](../agents/clojure-interactive-programming.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fclojure-interactive-programming.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fclojure-interactive-programming.agent.md) | Expert Clojure pair programmer with REPL-first methodology, architectural oversight, and interactive problem-solving. Enforces quality standards, prevents workarounds, and develops solutions incrementally through live REPL evaluation before file modifications. | |
5555
| [Comet Opik](../agents/comet-opik.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcomet-opik.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcomet-opik.agent.md) | Unified Comet Opik agent for instrumenting LLM apps, managing prompts/projects, auditing prompts, and investigating traces/metrics via the latest Opik MCP server. | opik<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code-0098FF?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscode?name=opik&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22opik-mcp%22%5D%2C%22env%22%3A%7B%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code_Insiders-24bfa5?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscodeinsiders?name=opik&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22opik-mcp%22%5D%2C%22env%22%3A%7B%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-Visual_Studio-C16FDE?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-visualstudio/mcp-install?%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22opik-mcp%22%5D%2C%22env%22%3A%7B%7D%7D) |
56+
| [Context Architect](../agents/context-architect.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext-architect.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext-architect.agent.md) | An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies | |
5657
| [Context7 Expert](../agents/context7.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext7.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcontext7.agent.md) | Expert in latest library versions, best practices, and correct syntax using up-to-date documentation | [context7](https://github.com/mcp/io.github.upstash/context7)<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code-0098FF?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscode?name=context7&config=%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-VS_Code_Insiders-24bfa5?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-vscodeinsiders?name=context7&config=%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D)<br />[![Install MCP](https://img.shields.io/badge/Install-Visual_Studio-C16FDE?style=flat-square)](https://aka.ms/awesome-copilot/install/mcp-visualstudio/mcp-install?%7B%22url%22%3A%22https%3A%2F%2Fmcp.context7.com%2Fmcp%22%2C%22headers%22%3A%7B%22CONTEXT7_API_KEY%22%3A%22%24%7B%7B%20secrets.COPILOT_MCP_CONTEXT7%20%7D%7D%22%7D%7D) |
5758
| [Create PRD Chat Mode](../agents/prd.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fprd.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fprd.agent.md) | Generate a comprehensive Product Requirements Document (PRD) in Markdown, detailing user stories, acceptance criteria, technical considerations, and metrics. Optionally create GitHub issues upon user confirmation. | |
5859
| [Critical thinking mode instructions](../agents/critical-thinking.agent.md)<br />[![Install in VS Code](https://img.shields.io/badge/VS_Code-Install-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcritical-thinking.agent.md)<br />[![Install in VS Code Insiders](https://img.shields.io/badge/VS_Code_Insiders-Install-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://aka.ms/awesome-copilot/install/agent?url=vscode-insiders%3Achat-agent%2Finstall%3Furl%3Dhttps%3A%2F%2Fraw.githubusercontent.com%2Fgithub%2Fawesome-copilot%2Fmain%2Fagents%2Fcritical-thinking.agent.md) | Challenge assumptions and encourage critical thinking to ensure the best possible solution and outcomes. | |

0 commit comments

Comments
 (0)