Instiq
Chapter 4 · Prompt Engineering and Context Crafting·v1.0.0·Updated 6/15/2026·~13 min

What's changed: New GH-300 Chapter 4 (effective prompts = structure [goal/context/expected output], how Copilot determines context, zero-shot/few-shot, select by relevance; principles & flow = clarity/specificity/iteration/decomposition, input+context→response→refine loop, chat-history use and caveats [irrelevant context/window consumption/new conversation])

4.2Prompt Principles, Process Flow, and Chat History

Key points

Understand prompt-engineering principles (clarity, specificity, iteration, decomposition), the prompt process flow, and how chat history is used in Copilot Chat—its benefits and caveats.

Good prompts share common principles: (1) clarity (avoid vague words; state what you want), (2) specificity (specify language, framework, constraints, output format), (3) iteration (don’t aim for perfect in one shot; adjust based on output), and (4) decomposition (break a big ask into small steps). These underpin Section 1’s practices.

4.2.1The prompt process flow

A Chat exchange follows an iterative flow: assemble input (your prompt) + context (selection/files/history), the model responds, and you refine with the next prompt based on what you see. Even if the first response is insufficient, you can narrow it down conversationally ("change this," "add this constraint") to improve quality. This is Chapter 3’s generation flow seen from the user’s side.

4.2.2Using chat history—benefits and caveats

Copilot Chat references conversation history as context, so it can respond building on prior turns—enabling continuous instructions like "add error handling to that function." But note caveats: (1) long history can mix in irrelevant past context, lowering accuracy (start a new conversation if needed); (2) history also consumes the context window; (3) restate explicitly when assumptions change. In short, history is useful, but deliberately managing context matters.

Exam point

Common: (1) Prompt principles = clarity, specificity, iteration, decomposition. (2) Chat improves via the loop input + context (selection/files/history) → response → refine with next prompt. (3) Chat history aids continuous instructions but, when long, mixes irrelevant context and consumes the window—start a new conversation if needed. (4) Don’t aim for one-shot perfection—iterate to narrow down.

Warning

Watch out: (1) Long chat history isn’t always beneficial—irrelevant past lowers accuracy and consumes the window. (2) Iteration isn’t "throwing many sloppy prompts"; it’s refining specifically based on output. (3) If the history drags old assumptions when things changed, start a new conversation. (4) Prompt techniques improve accuracy but don’t replace validation or responsible use (Chapter 1).

Diagram of clarity, specificity, iteration, and decomposition.
Manage history (long = noisy)

4.2.3Section summary

  • Prompt principles: clarity, specificity, iteration, decomposition
  • Chat improves via input + context → response → refine-with-next-prompt iteration
  • Chat history aids continuity but, when long, mixes irrelevant context/consumes the window—start anew if needed
  • Prompt techniques improve accuracy but don’t replace validation or responsible use

Sign in to track progress — Log in.

Quick check

(just a quick review)

Q1. The first Copilot Chat response was insufficient. What aligns with prompt-engineering principles?

Q2. In a long Copilot Chat, irrelevant past context is mixing in and lowering accuracy. Appropriate action?

Q3. Which is a correct set of prompt-engineering principles?

Q4. Which is correct about how chat history affects context?

Q5. Which principle helps Copilot handle a large, complex request effectively?

Q6. Which correctly understands "iteration"?

Check your understandingPractice questions for Chapter 4: Prompt Engineering and Context Crafting

Keep track of your progress

The full study guide is free to read. Sign up free to practice with the question bank, track what you have read, review your mistakes, and highlight passages.