๐ ๐ฎ๐๐๐ฒ๐ฟ๐ถ๐ป๐ด ๐๐ถ๐๐๐๐ฏ ๐๐ผ๐ฝ๐ถ๐น๐ผ๐
I used to get frustrated with GitHub Copilot. It would suggest wrong code and ruin my workflow. I treated it like a magic tool. I wrote vague comments and expected perfect results. That was a mistake.
Copilot is not a search engine. It is a context-aware assistant. It works best when you provide clear information.
Here is how to use the three main modes effectively.
- Copilot Chat
Stop asking vague questions like "why is this broken?" Copilot needs details.
โข Be specific. Instead of "fix this," say "this React hook runs on every render. How do I make it only run when userId changes?" โข Use slash commands. Use /explain for logic, /fix for bugs, and /tests for unit tests. โข Reference files. Use #file:filename to give Copilot the right context. โข Talk to it. Treat it like a pair programmer. Ask it to refactor or change a specific part of the response.
- Plan Mode
Use this to think before you code. Use @workspace to discuss architecture.
โข Ask for an outline. Ask for the architecture and potential pitfalls before writing code. โข Break down tasks. Ask Copilot to list the steps to migrate a database or API. โข Challenge the plan. Ask if there is a simpler way or what the tradeoffs are.
- Agent Mode
This mode can edit files and run terminal commands. It is powerful but risky.
โข Use tight boundaries. Never say "refactor the project." Say "refactor only authService.ts to use async/await." โข Review every step. Read the plan Copilot shows you before you click confirm. โข Use it for repetitive work. It is great for boilerplate code and writing test suites. โข Commit your code first. Always run a git commit before letting an agent make changes. This makes it easy to undo mistakes.
Summary for better results:
- Use clear variable names.
- Write comments before you write the code.
- Review every suggestion. Do not just hit tab.
- Keep files small and focused.
Copilot is a collaborator. Give it clear goals and good context. It will speed up your work.
Optional learning community: https://t.me/GyaanSetuAi