đ Turbocharge Your Coding with Copilotâs Custom Instructions in VS Code
Custom Instructions helps you fine tune your Copilot experience, with better, more relevant results and smaller prompts!

If youâve ever wished your AI coding assistant understood your quirks, coding style, or deep-seated aversion to semicolons (looking at you, Python devs), then GitHub Copilotâs Custom Instructions in VS Code are about to rock your world. Yes, my friends, AI has leveled upâitâs no longer just a helpful sidekick, but a mind-reading, code-completing, syntax-slaying genius that works your way.
đ¤ What Are Custom Instructions?
Think of Custom Instructions like a secret cheat code for Copilot. Instead of getting generic, one-size-fits-all code suggestions, you can now train Copilot to tailor its responses based on your preferences, tone, and coding habits. Want Copilot to comment like a pirate? Done. Prefer it to write super-verbose documentation? You got it. Need it to stop suggesting tabs when youâre clearly a spaces person? Justice has been served.
đ§ How to Set Up Custom Instructions
Setting up Custom Instructions in VS Code is easier than debugging a missing semicolon (sorry, JavaScript devs). Hereâs how you do it:
- Create a directory called
.github
and, within that directory, addcopilot-instructions.md
. - Add some styling instructions for the language of your choice.
- Make Copilot your own using some personalization!
Basically, youâre giving Copilot a mini biography of your coding style. Itâs like writing your Tinder bio, but instead of dates, you get perfectly formatted code.
Here's an example for JavaScript:
# Javascript
This project uses JavaScript with the following styles:
- All models will be classes with singular naming (i.e. `User` for the `users` table)
- All code files will be lower case with underscores.
- Markdown files will be lower case with hyphens.
- All application logic will go in the `lib` directory. Copilot should NEVER generate the code for logic. Only COMMENTS as to what should go where.
- All database-related stuff will go in the `db` directory (models, schema, SQLite files)
- All configuration will be done with environment variables, using a `.env` file.
- Do not export a class directly, use module method instead to create the instance you need (aka "factory")
đđź The Best Prompt...
Is the one you don't have to write! The more Copilot knows about you and your project, the more targeted the responses will be.
For instance: let Copilot know about your stack, and also some basic specs. In the same file, add this:
## Spec
This is an ecommerce store that will deliver both digital and physical goods. To that end, we need to track:
- `products` with a sku, name, price, description, and type (digital, hardware, kitchenware, clothing, etc).
- `inventory` that tracks products and their stock levels as well as location. For digital products, this should indicate download URL.
- `orders` with a unique, random `number`, `total` in pennies, `date`, `status`, `transaction_id` if it's checked out.
- `customers` with unique email, name, lifetime value
## The Stack
This will be a web application and also an API, using the following:
- Express.js for the server
- EJS for the view engine
- Tailwind CSS for styling
- Best practices for logging and monitoring
- Stripe for payment processing
- Use SQLite for development database, PostgreSQL for production.
- Use Sequelize for the ORM
Now that Copilot knows this, your code will come back more fully formed. You can even use a SQL file so Copilot knows your database schema! More on that in the next newsletter.
đ¨ Make Copilot Code in Your Style
Do you love writing clean, minimalist functions? Or do you prefer code so heavily documented that even your past self (who forgot everything) can understand it? With Custom Instructions, Copilot will match your tone and coding style.
Example:
đŤ Before Custom Instructions:
function add(a, b) {
return a + b;
}
â After Custom Instructions (if you like detailed explanations):
/**
* Adds two numbers together and returns the sum.
* @param {number} a - The first number.
* @param {number} b - The second number.
* @returns {number} The sum of a and b.
*/
function add(a, b) {
return a + b;
}
Now your code doesnât just workâit talks.
đ Fun Customization Ideas
Why stop at basic preferences when you can have fun with it? Here are some wild ideas to try:
- Shakespearean Mode: âVerily, dear developer, might I suggest an alternative implementation?â
- Dad Joke Generator: âWhy did the JavaScript function break up? It didnât get called enough.â
- Overly Dramatic AI: âBehold! The loop that shall iterate through eternity⌠or at least until the condition is met.â
Your AI assistant, your rules.
đď¸ Speed Up Your Coding Workflow
With Copilot now fine-tuned to your style, youâll spend less time fixing suggestions and more time actually building cool things. Itâs like having a personal assistant who knows exactly how you like your coffeeâexcept itâs code, and you still need coffee.
đ¨âđť Better Collaboration with Teams
Working with a team? Custom Instructions help standardize code suggestions across different members. No more debates over tabs vs. spaces, camelCase vs. snake_case, or brackets on the same line vs. new line. Let Copilot enforce the teamâs style so you can argue about more important thingsâlike what to order for lunch.
Have some suggestions or thoughts? Let us know!