A Tutorial on Prompt Engineering: From Messy Thoughts to AI Workflows
Organizations: Cisco, UK · Centre for Medical Informatics, Usher Institute, University of Edinburgh, UK · Department of Computer Engineering, Ahvaz Campus, Islamic Azad University, Iran · SLAI & CUHK-SZ, China ·
Abstract
This paper treats prompt engineering as a discipline for turning informal human intent into structured AI work specifications. It develops the practice as a sequence of reusable design moves: define the work, construct only the context the answer depends on, choose a role, or a moderated panel of roles, as an attention lens, and state affirmative quality targets, reserving prohibitions for hard boundaries. To keep prompts lean, it adapts two classical principles, Occam's razor and Chekhov's gun, so that every instruction earns its place. For consequential tasks, it adds structured critique through steelmanning and premortems, followed by verification and, where tools or multi-step actions are involved, agentic operating loops with explicit boundaries and escalation. Aimed at a general readership, this tutorial is not a benchmarking study; it offers a practical, technically grounded path from casual prompting to disciplined AI workflow design, illustrated by a worked example that carries one task from a weak prompt to a strong specification. The framework is presented as principles and checklists that remain useful as models and tools change. The strongest prompt is rarely the longest prompt; it is the one that makes desired behaviour, required sources and checks, and success criteria unmistakable.
Figures & tables
| Task type | Prompting approach | Reason |
|---|---|---|
| Low-stakes, familiar, reversible | Use a direct prompt with the desired output. | Extra structure may cost more than it improves. |
| Ambiguous or reusable | Add context, constraints, output format, and success criteria. | The prompt becomes a reusable work brief. |
| High-stakes or assumption-heavy | Add critique, steelmanning, premortem, and verification. | The goal is to expose hidden assumptions before commitment. |
| Tool-using or agentic | Add tool permissions, observation rules, stop conditions, escalation, and reporting. | The model is no longer only answering; it is operating inside a workflow. |
| Design move | Weak prompt | Strong prompt |
|---|---|---|
| Name the work ( ) | “What do you think of this plan?” | “Review this expansion plan and identify the assumptions that most affect the approval decision.” |
| Build common ground ( , ) | No background supplied. | “Context: a fixed $5M, three-year SaaS expansion; the audience is the board.” |
| Choose the lens ( , role) | “Act as an expert CFO.” | “Review as a CFO accountable for cash discipline, downside risk, implementation cost, and measurable ROI.” |
| Define the target ( , ) | “Don’t be vague.” | “List the five riskiest assumptions; for each, give its impact and one mitigation. Use only figures given in the plan.” |
| Add critique ( , reasoning) | “Is this a good plan?” | “Steelman the plan, then run a premortem: assume approval led to failure in 18 months and name the most likely cause.” |
| Verify and escalate ( , ) | Accept the answer as written. | “Check each figure against the plan, mark unverified numbers, and ask the user before recommending.” |
| Principle | Core idea | Practical implication |
|---|---|---|
| Prompt as work specification | The prompt defines task, context, criteria, constraints, output, and review. | Treat prompts as work briefs. |
| Explicit choices | Ambiguity should be converted into goals, constraints, evidence requirements, trade-offs, and success criteria. | Reduce hidden assumptions before the model commits to a path. |
| Task focus | Clear prompts keep the model on the subproblems that matter. | Avoid side problems and downstream errors in long chats or workflows. |
| Role as lens | Role playing works when it changes perspective, criteria, and responsibility. | Use roles such as CFO, security reviewer, or customer advocate only when each role has distinct criteria. |
| Affirmative target | Positive quality instructions define the desired behaviour. | Use negative instructions mainly for guardrails and forbidden actions. |
| Occam/Chekhov | Within a prompt, every element must do work. | Remove decorative instructions; retain only elements that affect output or prevent failure. |
Prompt Engineering
Prompt engineering designs and evaluates instructions, context, examples, and learned prompts to steer AI model behavior.
See all 125 papers