Before You Write a
Single Line of Code
How to set up VS Code so your AI assistant actually understands your project, your stack, and your standards.
VS Code is your coding workspace
It is the application where you write code. Think of it as a capable text editor that understands programming languages, shows your file tree, runs your terminal, and connects to AI tools like GitHub Copilot.
Out of the box, Copilot can see the file you have open. But it knows nothing about your project's purpose, your team's conventions, or what you are building.
Copilot is flying blind
Without context, Copilot gives generic answers. It does not know your stack. It guesses at your conventions. It suggests patterns that may be completely wrong for your project.
You end up rewriting its output on every request. That defeats the point.
Copilot sees nothing. Every suggestion is a guess.
One file changes everything
GitHub Copilot automatically reads .github/copilot-instructions.md whenever you open the folder. No extra configuration needed.
Whatever you write in that file becomes Copilot's permanent context for this project. Every suggestion, every chat answer, every completion starts from this foundation.
Create the file once. Every conversation after that is smarter.
Four sections. That is it.
You do not need a long document. Copilot reads the whole file on every request, so short and specific beats long and vague every time.
Monthly customer and account
reporting. Refreshes from the enterprise
data warehouse. Audience: regional
managers and the compliance team.
- Database: SQL Server 2022
- Reporting: Excel + Power Query M
- Scripts: T-SQL, PowerShell 7
- ETL: SSIS packages in azure-pipelines/
- Daily refresh: EXEC usp_refresh_daily
- Monthly report: macro RunMonthlyReport
- Common query: queries/customer_lookup.sql
- QA pipeline: scripts/qa/run_all.sql
- Lowercase names with underscores (customer_id, not CustomerID)
- Always alias joined tables (c, a, b)
- No SELECT *, list columns explicitly
- T-SQL date helpers, never inline GETDATE math
Specific vs Vague
Copilot cannot act on vague instructions. It needs concrete facts.
Please write efficient queries.
Use good naming.
Make reports look professional.
Tables: customers, orders, stores
Style: lowercase_with_underscores, alias every join
Dates: always use fn_period_start helper
Ask anything. Get a real answer.
Once the instructions file is in place, Copilot Chat stops being generic. It knows your stack. It follows your conventions automatically, without you having to repeat them.
You stop explaining your setup at the start of every conversation. The file does that for you, on every request, forever.
customers, orders, and stores tables, your lowercase_with_underscores naming, and your standard date helper. Want me to write it?query.sql using your conventions.tables and columns (customer_id, not CustomerID).
Sales data lives in three tables: customers (customer_id,
customer_name), orders (order_id, customer_id, store_id,
order_total, order_date), and stores (store_id, store_name).
For date math use DATEADD and GETDATE(), not DATE_SUB or NOW().
Show me the top 10 customers by order total,
grouped by store, for last month.
grouped by store, for last month.
There are five layers of context
The instructions file is Layer 1. As projects grow, Copilot can draw from additional context layers. Each one is opt-in - add them when you need them.
Same question. Completely different answer.
Generic. Slow. Requires cleanup.
- -Copilot suggests jQuery when your project uses React
- -Generated code uses .then() chains, your team uses async/await
- -You explain your stack from scratch in every chat message
- -Every suggestion needs manual review against your conventions
- -AI is faster to type, but slower to trust
Specific. Usable. Already correct.
- +Suggestions match your exact stack on every request
- +async/await by default, because you wrote that in the file
- +You ask what you need. No preamble, no setup.
- +Standards are enforced by context, not by memory
- +Copilot produces code you can actually commit
You are 5 minutes away from a Copilot that knows your project
-
1Create .github/copilot-instructions.md. In your project root, create a .github folder, then create the file inside it.
-
2Write the four sections. Project identity, tech stack, run commands, code standards. Two to three lines each is enough to start.
-
3Open Copilot Chat and ask anything. Press Ctrl+Shift+I. Notice the difference immediately.
Where this comes from
Every claim about Copilot behavior on this page links to its source in the official GitHub or Microsoft documentation. Verify anything you want to. The patterns shown here are not invented; they are what the vendors document.
-
[1]VS Code Docs Use custom instructions in VS Code
Documents how
code.visualstudio.com/docs/copilot/customization/custom-instructions.github/copilot-instructions.mdis loaded automatically, the priority order with AGENTS.md and CLAUDE.md, and what content belongs in the file. Backs the entire premise of scenes 4 and 5. -
[2]VS Code Docs Customize AI in Visual Studio Code (overview)
Umbrella reference for every Copilot customization surface. Backs the framing in scene 7 about additional context layers (open files, chat selection, workspace index, personal instructions).
code.visualstudio.com/docs/copilot/customization/overview -
[3]VS Code Docs Chat in VS Code (Copilot Chat)
Reference for Copilot Chat behavior, panel keyboard shortcut, and how chat selection scoping works. Backs scene 6.
code.visualstudio.com/docs/copilot/copilot-chat