1) Add a repository-level Copilot instruction file
Place project-specific guidance where Copilot will read it automatically: create a Markdown file in the repository’s.github/ folder named copilot-instructions.md (or create a Markdown file titled “Copilot Instructions” inside .github). Use this file to state coding standards, preferred patterns, and generation preferences so Copilot generates code aligned with your project.
Example: create the .github directory
.github/copilot-instructions.md with your project’s conventions — formatting, naming, import ordering, docstring expectations, and any edge-case guidance.
Name the file
.github/copilot-instructions.md and commit it to the repository so Copilot can discover and apply it automatically.copilot-instructions.md (practical starting point)
2) Test how Copilot responds: editor inline suggestions vs. Copilot Chat
Copilot behaves differently depending on how you prompt it:- Inline (editor) suggestions often aim for brevity and fast completion. They are great for small, routine edits.
- Copilot Chat usually produces more thorough results — typed signatures, docstrings, and explanatory comments — especially when you provide a detailed prompt or reference the repository instruction file.
- Try the same prompt in Copilot Chat — it often respects repository-level guidance more fully.
- Make inline prompts slightly more explicit (add a short comment specifying style or types).
3) Use the Completions panel to compare suggestions
The Completions panel displays multiple alternative implementations. Use it to compare different approaches (concise vs. documented, typed vs. untyped), then accept the variant that best matches your codebase. Workflow:- Open the Completions panel in the Copilot UI.
- Page through suggestions to review variations.
- Accept the suggestion that fits style, performance, or readability goals — you can also edit the accepted suggestion afterward.
4) Keyboard shortcuts and keybindings
Speed up acceptance and navigation by learning or customizing a few keybindings. VS Code lets you view and remap Copilot-related shortcuts from the Keyboard Shortcuts panel. Common actions you may want shortcuts for:- Open Copilot Chat
- Toggle Copilot inline suggestions
- Open the Completions panel
- Accept the current suggestion
- Cycle through alternative suggestions
- In VS Code: File > Preferences > Keyboard Shortcuts (or press
Ctrl+K Ctrl+S/Cmd+K Cmd+S) - See Copilot command names in the Keyboard Shortcuts UI

5) Model selection and context windows
Model choice and the editor context you expose both affect suggestion quality:- Inside Copilot Chat you can select different underlying models (e.g., GPT-4o or other code-optimized models). Test models on representative tasks and keep the one that balances accuracy, conciseness, and code quality for your workflows.
- Limit the number of open files/tabs to the modules relevant to the task. Copilot’s context window is finite — opening too many unrelated files can dilute suggestion relevance.
Avoid opening too many files at once: Copilot has a limited context window. Close unrelated tabs to improve suggestion relevance for the code you’re actively editing.
- Focus on the directory or package you are editing (e.g., database layers and config when making DB changes).
- If suggestions degrade, close non-essential tabs and re-run generation.
Next steps: comment-driven development and a sample project
With a repository-level instruction file and familiarity with Completions and Chat, you can scale from small edits to larger features using comment-driven development:- Start a small sample project (for example, a fake data generator).
- Use inline comments to scaffold small functions and use Copilot to complete them.
- Switch to Copilot Chat for larger tasks or when you want full docstrings and typed signatures.
- Iterate: accept a suggestion, refactor, re-prompt with clearer constraints, and repeat.