Write better prompts
Most disappointing Copilot answers come from vague requests. Copilot can only work with what you tell it, so a prompt that names the goal, the context and the format you want will almost always beat a one-line question.
The four parts of a good prompt
Microsoft's own prompting guidance breaks a prompt into four parts. You don't need all four every time, but the more you include, the better the result.
- Goal: what you want. "Draft," "summarize," "compare," "list."
- Context: why you need it and who it's for. "For a client update," "for a non-technical audience."
- Source: which information to use. A specific file, email thread, meeting or dataset.
- Expectations: how it should look. Length, tone, format (table, bullets, email).
Before and after
Vague
Write an update about the project.
Specific
Draft a short status email to the leadership team about the website migration. Use the notes from yesterday's project sync and the timeline in Migration Plan.docx. Keep it under 150 words, lead with any risks to the launch date, and end with the next two milestones as bullets.
The second prompt gives Copilot a goal (status email), context (leadership audience), sources (a meeting and a document) and expectations (length, structure, emphasis).
Iterate instead of starting over
Treat the first answer as a draft. Follow-ups such as "make it more concise," "turn this into a table" or "what did I miss?" keep the context you've already built, so they're faster than rewriting the original prompt.
Prompting GitHub Copilot
The same principles apply to code, but your editor is part of the prompt. GitHub's prompt engineering guide recommends:
- Start with the big picture, then list specific requirements.
- Give an example of the input and output you expect.
- Keep relevant files open and close unrelated ones, so suggestions use the right context.
- Break complex tasks into smaller, testable steps.