Back to cheat sheet hub

Prompt Engineering Cheat Sheet

A practical QA-oriented prompt guide built around the exact frameworks and prompt habits we teach in the AI curriculum.

AI Module 2 Prompt frameworks QA workflows

Main goal

Write prompts that produce useful, constrained, and testable outputs instead of vague generic text.

Best default

State the role, task, context, constraints, and output format explicitly.

Use it for

Test cases, bug summaries, code reviews, requirement analysis, and AI-assisted documentation.

Pair it with

Use this with AI basics, AI test generation, and LLM evaluation.

Prompt Anatomy

A strong prompt is structured, not just wordy.

Role: You are a senior QA engineer
Task: Generate regression scenarios
Context: Checkout flow with coupon logic
Constraints: Include positive, negative, boundary cases
Output: Markdown table

Zero-Shot vs Precise Prompting

Zero-shot is faster; precise prompting is stronger for repeatable QA work.

Zero-shot:
"Write test cases for login"

Precise:
"Generate 15 login test cases with priority, preconditions, steps, and expected result"

Role-Based Prompting

Give the model a professional stance that matches the task.

You are a senior SDET reviewing Playwright code.
Focus on flakiness, locator stability, weak assertions, and maintainability.

STAR Framework

Useful when the task needs situation, target, action, and result clarity.

Situation: Checkout flow changed
Task: Identify regression risk
Action: Generate focused test scenarios
Result: Return a prioritized list

CLEAR and CRISP

These frameworks help keep prompts specific and readable under pressure.

CLEAR:
Context, Limitations, Expectations, Action, Result

CRISP:
Context, Role, Intent, Scope, Presentation

RICE POT

This QA-specific framework is useful for structured test design prompts.

Role
Input
Constraints
Examples
Process
Output
Tone

Context Templates

Reusable context blocks improve consistency across a team.

Application: e-commerce
Users: admin, buyer
Critical module: checkout
Testing focus: coupon, address, payment, confirmation

Structured Output

Ask for predictable shapes so the output can be reviewed or reused programmatically.

Return JSON with:
- title
- priority
- steps
- expectedResult
- riskArea

High-Value QA Prompt

This is the kind of production-style prompt that usually works well.

You are a senior QA engineer.
Analyze the following requirement.
List assumptions, risks, missing details, and 20 test scenarios.
Group results into positive, negative, boundary, and security.