chapter two

2 Prompt Design: Structural Elements

 

This chapter covers

  • The core Structural Elements: Instructions, Constraints, Context, Input Parameters, Output Format, and Delimiters
  • Writing falsifiable constraints that bound the solution space
  • Using input parameters to inject dynamic context and enable reuse
  • Specifying output structure for consistent, predictable responses
  • Combining these elements into reliable, task-specific prompts

Most prompts start as a single block of text. The task, the background, the variable inputs, the expected output shape, all in one place with no clear boundaries. The model has to infer what is an instruction, what is context, what is content to act on, and what the output should look like. When the output is wrong, there is no clear place to look.

Structural Elements give each concern a defined place. Instructions define the task and Constraints place explicit, verifiable limits on what the output must not violate, forming the directive layer of the prompt. Context provides the background the model needs to interpret them, while Input Parameters separate variable inputs from stable instruction logic so the same template works across different runs. Output Format specifies what the response must look like, and Delimiters mark the boundaries around embedded content so it cannot be misread as instructions.

2.1 Overview of Structural Elements

2.2 Instructions

2.2.1 Practical Example 1: Explaining HTTP 429 Errors

2.2.2 Practical Example 2: Generating Code Review Feedback

2.3 Constraints

2.3.1 Practical Example: Writing Secure Logging Guidelines

2.4 Context

2.4.1 Practical Example 1: Generating an Architecture Decision Record (ADR) Summary

2.4.2 Practical Example 2: Generating an Incident Handoff Conversation

2.5 Input Parameters

2.5.1 Practical Example 1: Analyzing Error Logs

2.5.2 Practical Example 2: Generating Release Notes

2.6 Output Format

2.6.1 Practical Example 1: Generating a Deployment Checklist

2.6.2 Practical Example 2: Generating an API Endpoint Summary

2.7 Delimiters

2.7.1 Practical Example 1: Summarizing an Incident Report

2.7.2 Practical Example 2: Answering Questions from a Runbook

2.7.3 Defensive Prompting Tip

2.8 Combining Structural Elements

2.8.1 Practical Example 1: Generating Incident Status Updates

2.8.2 Practical Example 2: Generating a Deployment Go/No-Go Brief

2.8.3 Hands-On Practice

2.9 Summary