Context Engineering - One Sheet
Welcome to the Context Engineering with AI workshop. This is a dry run of a training we’ll be giving to Riot Games in February. Please share any feedback or suggestions you have to improve the content or delivery in a comment below!
Agenda
Throughout the workshop, we’ll be exploring various topics and concepts related to Context Engineering. We’ll then take time to refine and optimize a copilot-instructions.md file for a codebase of your choosing.
Introduction to Context (
10 mins)Codebase Setup & Instructions Files (
15 mins)Context Theory & Basics (
30 mins)What Makes a Great Context File
Building Context Files
Maintaining Context Files
Token Mangement
copilot-instructions.mdIteration (1 hr)
Codebase Setup
In this section you’ll be setting up your codebase in preparation for creating and refining a copilot-instructions.md file. If you don’t have a codebase in mind, we’ll be using a demo project called TaskFlow.
Open your codebase in VS Code and make sure you can run it.
Set up VS Code with Copilot in Agent Mode
Group Discovery
Create Groups Based on Codebase
Participants should have selected a codebase they want to generate a context file for before the training began.
Group up with others who are working on the same codebase.
If there’s a large number of people working on the same codebase (10+), form subgroups.
Choose a Partner
Find a pair programming partner that’s working on the same codebase as you.
Create a Shared Collaboration Document
Open a shared document in Google Docs, Confluence, or another collaborative tool your team prefers.
Create one document for each codebase (or each codebase sub-group) using the template below:
Initial Instructions Generation
One member of your codebase group should follow the steps below to generate a copilot-instructions.md file that your group can use going forward in the workshop.
Bitovi's Intructions Generator
Open your AI agent
Run the kickoff prompt
{output_folder} = .results {final_output_file} = /.github/copilot-instructions.md You are assisting with generating a {final_output_file} file using a multi-step prompt chain. 1. Open this repository on GitHub: https://github.com/bitovi/ai-enablement-prompts. 2. Navigate to the `/understanding-code/instruction-generation` folder within the repo. 3. Review all the prompt files in this folder WITHOUT executing them. - This will help you understand the full scope of the prompt chain. 4. Confirm you have a full understanding of the prompt chain sequence. 5. Once you're familiar with the flow, begin executing the prompts in numerical order: - 1-determine-techstack.md - 2-categorize-files.md - 3-identify-architecture.md - 4-domain-deep-dive.md - 5-styleguide-generation.md - 6-build-instructions.md 6. For each step, output results into a corresponding `{output_folder}/` folder. - Mirror the step’s filename e.g., `1-determine-techstack.md` > `{output_folder}/1-determine-techstack.md`. Stop ONLY when: - All `instruction-generation` steps are complete - A full `{final_output_file}` can be generated.
Wait for Copilot to finish
It should take ~10 minutes for Copilot to analyze the whole codebase and output the final file. While it runs, we’ll continue on with the workshop.
Add Instructions to Group Document
The member of the group that generated the instructions file should add it to the collaboration document once it’s done generating.
This will be the starting point for everyone working on the codebase.
Core Context Engineering Concepts
Follow along with the presentation and slides to learn the basics of context engineering.
Copilot Instructions Iteration
In this phase, each team member will independently test and refine their team’s copilot-instructions.md file using real examples from their codebase. The goal is to observe how Copilot performs with the current instructions, identify gaps or misunderstandings, and iteratively improve the file so Copilot becomes more effective and consistent.
✏️ Steps
Select a Feature, Bug, or Issue
Choose one or more past items from your project’s commit history.
Ideally, pick something you or your team have already solved — this gives you a clear benchmark for what a successful Copilot result looks like.
Each team member should pick a different issue if possible (but overlap is okay if multiple people want to explore the same example).
Summarize the Feature/Bug/Issue
The end goal is to have Copilot attempt this change on its own. You’ll need to a short summary of what is expected of Copilot or a description of the bug that needs fixing.
This can be the original ticket for the issue, or something you write up quickly in the shared group doc.
Review the Current Instructions File
Open your team’s generated
copilot-instructions.mdfile.Skim through it to familiarize yourself with how it describes the project’s architecture, components, and conventions.
Note any missing information that might confuse Copilot for your chosen task.
Attempt the Task with Copilot
Use Copilot in Agent Mode and ask it to implement or fix the feature/bug, being sure to include the summary you compiled from step 2 — for example:
“Using the project’s conventions, implement the fix for issue #123 that resolves the data validation bug. {SUMMARY}”
Observe how Copilot responds. Does it understand the architecture? Does it reference the right components? Does it make logical design decisions?
Record Observations and Results
In your team’s shared document, under your individual section, write down:
What worked well (e.g., “Copilot understood the data model and used existing helpers”)
What didn’t (e.g., “Didn’t recognize our API structure”)
Any unclear or missing information in the instructions file.
Be specific — your notes will help the whole team improve the shared file later.
Modify and Refine the Instructions File
Make targeted edits to
copilot-instructions.mdto fill in gaps or clarify misunderstood details.Add or adjust sections (like architecture notes, naming conventions, or module overviews) as needed.
Keep the file concise — focus on improving clarity and coverage, not just adding more text.
Re-Test with the Updated Instructions
Re-run your Copilot prompt using the modified file.
See if Copilot’s behavior improves — is it more accurate, aligned, or context-aware?
Repeat this cycle (test → observe → refine) as time allows.
Maintain a Changelog of Revisions
In your individual notes, log each change you made to the instructions file:
What you changed
Why you changed it
What effect it had
This changelog will later help your team merge everyone’s findings into a single, final version.
Final Instructions File Synthesis
Now that each team member has tested and refined their own version of the copilot-instructions.md file, it’s time to come back together as a group. The goal of this phase is to consolidate what everyone learned, identify the most effective improvements, and merge them into a single, unified version of your instructions file that your team can continue to use and evolve.
Steps
Regroup and Share Findings
Rejoin your team in your shared collaboration document.
Each pair briefly summarizes their iteration results:
What issues or features they worked on
What Copilot did well
What problems or misunderstandings they encountered
What specific changes they made to improve the instructions
Compare and Discuss Changes
As a team, review everyone’s changelog entries and notes.
Identify patterns — for example:
Were there recurring issues across multiple features?
Did certain edits (like clarifying module names or adding architecture notes) consistently help?
Did anyone’s changes unintentionally make Copilot worse?
Use this conversation to surface the edits that made the biggest positive difference.
Merge the Best Improvements
Open a clean copy of your shared
copilot-instructions.mdfile.Collaboratively integrate the strongest insights and modifications from everyone’s iterations.
Remove redundancies or conflicting sections as needed.
Aim for clarity and completeness, not just length — your goal is a balanced, maintainable file that captures the most useful context.
Document the Final Version
Paste or link the final version of your file into the Final Version section of your shared document.
Add a short summary of the key takeaways — what changed, why, and how it improved Copilot’s behavior.
(Optional) Include a brief changelog summary highlighting the most impactful edits for future reference.