๐ ๐ฎ๐๐๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐ถ๐๐๐๐ฏ ๐๐ผ๐ฝ๐ถ๐น๐ผ๐
I used to rage-close VS Code because Copilot gave me wrong code. I treated it like a magic oracle. I typed vague comments and expected perfect results. That approach failed.
After weeks of trial and error, I learned how to use it correctly. Copilot is not a search engine. It is a context-aware assistant. The quality of your code depends on the quality of your input.
Here is how to use the three main modes effectively.
- Copilot Chat
Stop asking "Why is this not working?" Instead, provide specific details.
- Be specific: Tell it exactly what is broken and what you expect.
- Use slash commands: Use /explain, /fix, /tests, or /doc to set clear intent.
- Reference files: Use #file:filename to give it the right context.
- Treat it as a conversation: If the first answer is wrong, ask it to refactor or change the style.
- Plan Mode
Use this mode to think before you code. Use @workspace to discuss architecture.
- Ask for an outline: Ask for components and pitfalls before writing code.
- Break down tasks: Ask it to list the steps for a migration or a new feature.
- Challenge the plan: Ask about tradeoffs or simpler ways to do things.
- Agent Mode
Agent mode can create files and run terminal commands. It is powerful but risky.
- Write scoped prompts: Tell it exactly which files to touch. Do not say "Refactor the project." Say "Refactor only authService.ts."
- Review every step: Read the plan before you hit confirm.
- Use it for repetition: Use it for boilerplate or writing test suites.
- Commit your code first: Always run a git commit before letting an agent work. This allows you to reset if things go wrong.
Core Rules for Success
- Use clear names: Good variable names provide context.
- Write comments first: Describe your goal in a comment before you write the logic.
- Review everything: Never accept a suggestion without reading it.
- Keep files small: Small files produce better suggestions than long files.
Copilot is a collaborator, not a replacement. Give it clear goals and boundaries.