You can make GitHub Copilot obey coding & formatting conventions using a markdown file

Instead of repeatedly correcting GitHub Copilot’s suggestions, you can create a markdown file with your project’s coding conventions and drag it into Copilot’s context window to guide its behavior.

How it works:

Create a markdown file (e.g., .github/copilot-instructions.md) with your project guidelines:

# Coding Conventions

- Focus on readability, not excessive performance optimization
- This project uses `uv`, not `poetry`
- Use single quotes for strings
- Prefer explicit type hints
- Write descriptive variable names

# Meta instruction
If I clarify something that could have been added here, suggest the change.

Then drag this file into GitHub Copilot’s Agent mode context window.

What to include:

Why this works:

Copilot can now reference your conventions when generating code, significantly reducing:

The feedback loop:

Including “if I clarify something that could have been added here, suggest the change” creates a self-improving system where Copilot helps refine its own instructions based on your corrections.

Original source