-
Notifications
You must be signed in to change notification settings - Fork 3.9k
feat: Add context engineering collection — agents, prompts & instruct… #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
vfaraji89
wants to merge
4
commits into
github:main
from
vfaraji89:feat/context-engineering-collection
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
80c38be
feat: Add context engineering collection — agents, prompts & instruct…
vfaraji89 8fca016
fix: remove trailing ? from anchor link in collection page
vfaraji89 b1d94c4
chore: regenerate collection page via npm start
vfaraji89 fc12b51
Merge branch 'main' into feat/context-engineering-collection
vfaraji89 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| description: 'An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies' | ||
| model: 'gpt-4o' | ||
| tools: ['codebase', 'terminalCommand'] | ||
| name: 'Context Architect' | ||
| --- | ||
|
|
||
| You are a Context Architect—an expert at understanding codebases and planning changes that span multiple files. | ||
|
|
||
| ## Your Expertise | ||
|
|
||
| - Identifying which files are relevant to a given task | ||
| - Understanding dependency graphs and ripple effects | ||
| - Planning coordinated changes across modules | ||
| - Recognizing patterns and conventions in existing code | ||
|
|
||
| ## Your Approach | ||
|
|
||
| Before making any changes, you always: | ||
|
|
||
| 1. **Map the context**: Identify all files that might be affected | ||
| 2. **Trace dependencies**: Find imports, exports, and type references | ||
| 3. **Check for patterns**: Look at similar existing code for conventions | ||
| 4. **Plan the sequence**: Determine the order changes should be made | ||
| 5. **Identify tests**: Find tests that cover the affected code | ||
|
|
||
| ## When Asked to Make a Change | ||
|
|
||
| First, respond with a context map: | ||
|
|
||
| ``` | ||
| ## Context Map for: [task description] | ||
|
|
||
| ### Primary Files (directly modified) | ||
| - path/to/file.ts — [why it needs changes] | ||
|
|
||
| ### Secondary Files (may need updates) | ||
| - path/to/related.ts — [relationship] | ||
|
|
||
| ### Test Coverage | ||
| - path/to/test.ts — [what it tests] | ||
|
|
||
| ### Patterns to Follow | ||
| - Reference: path/to/similar.ts — [what pattern to match] | ||
|
|
||
| ### Suggested Sequence | ||
| 1. [First change] | ||
| 2. [Second change] | ||
| ... | ||
| ``` | ||
|
|
||
| Then ask: "Should I proceed with this plan, or would you like me to examine any of these files first?" | ||
|
|
||
| ## Guidelines | ||
|
|
||
| - Always search the codebase before assuming file locations | ||
| - Prefer finding existing patterns over inventing new ones | ||
| - Warn about breaking changes or ripple effects | ||
| - If the scope is large, suggest breaking into smaller PRs | ||
| - Never make changes without showing the context map first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| id: context-engineering | ||
| name: Context Engineering | ||
| 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. | ||
| tags: [context, productivity, refactoring, best-practices, architecture] | ||
|
|
||
| items: | ||
| - path: instructions/context-engineering.instructions.md | ||
| kind: instruction | ||
|
|
||
| - path: agents/context-architect.agent.md | ||
| kind: agent | ||
| usage: | | ||
| recommended | ||
|
|
||
| The Context Architect agent helps plan multi-file changes by mapping dependencies | ||
| and identifying all relevant files before making modifications. | ||
|
|
||
| Use this agent when: | ||
| - Planning refactors that span multiple files | ||
| - Adding features that touch several modules | ||
| - Investigating unfamiliar parts of the codebase | ||
|
|
||
| Example usage: | ||
| ``` | ||
| @context-architect I need to add rate limiting to all API endpoints. | ||
| What files are involved and what's the best approach? | ||
| ``` | ||
|
|
||
| For best results: | ||
| - Describe the high-level goal, not just the immediate task | ||
| - Let the agent search before you provide files | ||
| - Review the context map before approving changes | ||
|
|
||
| - path: prompts/context-map.prompt.md | ||
| kind: prompt | ||
| usage: | | ||
| optional | ||
|
|
||
| Use before any significant change to understand the blast radius. | ||
| Produces a structured map of files, dependencies, and tests. | ||
|
|
||
| - path: prompts/what-context-needed.prompt.md | ||
| kind: prompt | ||
| usage: | | ||
| optional | ||
|
|
||
| Use when Copilot gives a generic or incorrect answer. | ||
| Asks Copilot to explicitly list what files it needs to see. | ||
|
|
||
| - path: prompts/refactor-plan.prompt.md | ||
| kind: prompt | ||
| usage: | | ||
| optional | ||
|
|
||
| Use for multi-file refactors. Produces a phased plan with | ||
| verification steps and rollback procedures. | ||
|
|
||
| display: | ||
| ordering: manual | ||
| show_badge: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # Context Engineering | ||
|
|
||
| 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. | ||
|
|
||
| **Tags:** context, productivity, refactoring, best-practices, architecture | ||
|
|
||
| ## Items in this Collection | ||
|
|
||
| | Title | Type | Description | MCP Servers | | ||
| | ----- | ---- | ----------- | ----------- | | ||
| | [Context Engineering](../instructions/context-engineering.instructions.md)<br />[](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 />[](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 | | | ||
| | [Context Architect](../agents/context-architect.agent.md)<br />[](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 />[](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) | | | ||
| | [Context Map](../prompts/context-map.prompt.md)<br />[](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 />[](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) | | | ||
| | [What Context Do You Need?](../prompts/what-context-needed.prompt.md)<br />[](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 />[](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?) | | | ||
| | [Refactor Plan](../prompts/refactor-plan.prompt.md)<br />[](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 />[](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) | | | ||
|
|
||
| ## Collection Usage | ||
|
|
||
| ### Context Architect | ||
|
|
||
| recommended | ||
|
|
||
| The Context Architect agent helps plan multi-file changes by mapping dependencies | ||
| and identifying all relevant files before making modifications. | ||
|
|
||
| Use this agent when: | ||
| - Planning refactors that span multiple files | ||
| - Adding features that touch several modules | ||
| - Investigating unfamiliar parts of the codebase | ||
|
|
||
| Example usage: | ||
| ``` | ||
| @context-architect I need to add rate limiting to all API endpoints. | ||
| What files are involved and what's the best approach? | ||
| ``` | ||
|
|
||
| For best results: | ||
| - Describe the high-level goal, not just the immediate task | ||
| - Let the agent search before you provide files | ||
| - Review the context map before approving changes | ||
|
|
||
| --- | ||
|
|
||
| ### Context Map | ||
|
|
||
| optional | ||
|
|
||
| Use before any significant change to understand the blast radius. | ||
| Produces a structured map of files, dependencies, and tests. | ||
|
|
||
| --- | ||
|
|
||
| ### What Context Do You Need? | ||
|
|
||
| optional | ||
|
|
||
| Use when Copilot gives a generic or incorrect answer. | ||
| Asks Copilot to explicitly list what files it needs to see. | ||
|
|
||
| --- | ||
|
|
||
| ### Refactor Plan | ||
|
|
||
| optional | ||
|
|
||
| Use for multi-file refactors. Produces a phased plan with | ||
| verification steps and rollback procedures. | ||
|
|
||
| --- | ||
|
|
||
| *This collection includes 5 curated items for **Context Engineering**.* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.