Randy Pagels shares actionable advice on how developers can improve their results with GitHub Copilot by avoiding vague prompts and leveraging precise language and clear context.

Avoid These Common Prompts

Posted on Jul 4, 2025 by Randy Pagels

When it comes to using GitHub Copilot, the prompts you provide make all the difference. Generic or vague requests often limit Copilot’s ability to help, resulting in suggestions that are bland, inaccurate, or unhelpful.

Prompts to Avoid

Consider skipping prompts like:

  • “Write a function” (without supplying details)
  • “Fix this code” (with no supporting context)
  • “Make this better”
  • “Generate unit tests” (without requirements or relevant examples)
  • “Explain this code” (offering no specific method, file, or details)

While Copilot can generate something from these commands, you’re losing out on the tool’s real power. Copilot’s effectiveness is directly linked to the explicitness of your instructions.

Pro Tips For Better Prompting

Be specific:

  • Name the programming language and frameworks (e.g., “Write a Python function to…”)
  • Provide constraints (such as “using recursion”, “that handles errors”, or “for all edge cases”)
  • If possible, offer code samples, describe the expected input and output, and explain your goals (e.g., “Given an array of user records, filter…”)
  • For bug fixes, supply error messages, stack traces, and the relevant code block

Better Examples

Instead of generic prompts, try:

  • “In Python, write a function to find all unique values in a list, ignoring case.”
  • “Fix the following code to handle division by zero errors.”
  • “Generate unit tests for my ‘parseInvoice’ function to cover edge cases.”

Key Takeaway

The more specific you are with GitHub Copilot, the more accurate and helpful its suggestions become. Build context and clarity into your prompts for the best developer experience.

This post appeared first on “Randy Pagels’s Blog”. Read the entire article here