chapter six

6 User prompts for LLMs

 

This chapter covers

  • User prompt as the immediate user intent
  • How to design effective user prompts
  • Prompting techniques, frameworks, and tools

Chapter 1 introduced context engineering and the six sources of context that shape LLM behavior. This chapter focuses on the last of those sources: the user prompts, which express the immediate user intent and guide the model toward a specific outcome. This chapter is intended as a practical toolbox, not something to memorize. To that end, it covers the different practical prompting strategies, common design principles, and reusable frameworks you can apply selectively to a particular use case.

6.1 User prompt

The user prompt is the most direct source of context. It represents the specific question or task a user provides to the LLM at any moment. While this may seem straightforward, designing an effective prompt (this discipline is often called prompt engineering) is a foundational skill in context engineering.

A well-designed prompt functions less like a casual query and more like a specification document with clearly defined goals, parameters, and expectations, minimizing uncertainty and maximizing reliability. Consider the contrast between the following prompts:

What is context engineering?

This prompt is syntactically valid but underspecified: it provides no guidance on audience, depth, scope, or emphasis, leaving the model to guess the user’s intent. Now see the difference with this one:

6.2 Best practices for prompt design

6.2.1 Give direction

6.2.2 Specify format

6.2.3 Provide examples

6.2.4 Break down complex tasks

6.3 Prompting techniques

6.3.1 Role prompting

6.3.2 Few-shot prompting

6.3.3 Chain-of-thought prompting

6.3.4 Tree-of-thought prompting

6.3.5 ReAct prompting

6.3.6 Self-consistency prompting

6.3.7 Prompt chaining

6.3.8 Meta-prompting

6.3.9 Reflective prompting

6.4 Prompt frameworks

6.4.1 10-step prompt structure

6.4.2 COSTAR

6.4.3 CRISPE