← Back to Main Page

Craft Prompts That Get Better Results

Posted on May 23, 2025

Sometimes, a short prompt works just fine—but when Copilot’s suggestions miss the mark, it’s time to sharpen your prompt game. The key? Be specific, add context, and guide it like you would a junior dev. Let’s break it down!

ProTip
Use Structured Prompts to Guide Copilot to the Right Solution
Large language models respond better when you spell out what you want with more clarity. You don’t need fancy language—just think step-by-step, and stay focused.
Here’s a simple formula to use:
[Goal] + [Tech/Context] + [Constraints or Style]
Examples of Clear, Effective Prompts:
1️⃣ Task + Context:
# Write a Python function that parses a CSV and returns rows where age > 30
Simple, direct, and goal-focused.
2️⃣ Structure it step-by-step:
# Step-by-step:
# 1. Read a CSV file
# 2. Filter rows by a column value
# 3. Return filtered list
This often results in cleaner, better-organized code.
3️⃣ Style or Approach Guidance:
// Write a TypeScript function that uses map/filter instead of a for loop
Perfect for shaping the style of Copilot’s output.

4️⃣ Use a Persona-Based Prompt
// Act like a senior front-end engineer writing a reusable button component in React with TypeScript and Tailwind
Giving Copilot a role helps it follow conventions and patterns a real expert might use.
5️⃣ Use a Context-Framing Prompt
# This YAML defines a GitHub Actions workflow that runs tests on every push to the main branch using Node.js 18
Giving Copilot a quick summary of what the file is for helps generate accurate boilerplate that fits your workflow.

Prompt Debugging Tip:
If the output isn’t quite right, reword your comment with more details or add one step at a time. Think of it like teaching a new teammate—specific instructions lead to better results.

Quick Takeaway
When Copilot feels off, it’s not stuck—it just needs a better prompt. Add structure, be specific, and watch the quality improve.