Prompt templates are reusable artifacts that shape how an AI works within a codebase. They provide a workflow layer between the specification and a model whose behavior can change. section 14.5
Treat the specification as the correctness anchor, not the model’s usual response. Check whether template output meets the spec; adjust the template when model behavior changes rather than chasing individual prompts. section 14.5
Useful template design checks:
- Constrain the task, reference relevant contracts, and bias toward less output. section 3.6
- Separate thinking from code generation, and ask whether the prompt reduces downstream work. section 3.6
Recurring coding tasks
Templates can guide unit-test generation, API endpoints built from specifications, or legacy-code refactoring. After a model or provider changes, check each workflow’s output against its spec and revise the template if needed. section 14.5 section 14.5
Figure 14.4 The spec as the stable anchor in an AI-assisted workflow: the AI varies, the acceptance criteria don't.

Distinguish the stable specification and acceptance criteria from the changing AI and the adjustable templates between them. section 14.5




























