Prompt engineering is the practice of designing and testing the instructions and context you give a language model so its responses meet defined requirements. It is not a magic phrase or a guarantee of identical output: results can vary across runs, model types, and model versions. For developers, the useful skill is to make the task, inputs, constraints, and expected output explicit, then evaluate and maintain the prompt like application code.
What is prompt engineering?
OpenAI defines prompt engineering as writing effective instructions so a model consistently generates content that meets requirements. In practice, that means shaping the model’s instructions and the information it receives, then checking its responses against the job it needs to do. “Consistently” describes the goal, not a promise of deterministic output: OpenAI notes that model types and snapshots can respond differently, and generated content is non-deterministic. OpenAI’s prompt engineering guide and Google’s prompt design strategies both frame prompt work as something to experiment with and refine.
A prompt may include a direct instruction, background context, examples, and constraints on the response. A useful prompt makes clear what operation to perform, what information to use, what to avoid, and what form the result should take. Prompt engineering is therefore part of application design: a well-written prompt can clarify a task, but it cannot supply missing facts or give a model a capability it does not have.
How to write and improve a prompt
Use a repeatable workflow rather than changing wording at random. The steps below work across providers, though the details may need adjustment for a particular model and API.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
1. Define what success and failure look like
Before drafting, write down the task and the qualities of a usable response. Specify required facts or fields, unacceptable errors, and any limits such as length, tone, or format. Decide how you will test those criteria with representative inputs. Anthropic’s prompt engineering overview treats clear success criteria and empirical testing as prerequisites to prompt engineering.
For example, if a model classifies support messages, success might mean returning one allowed category and a short rationale, while failure includes inventing a category or omitting the label. This makes it possible to tell whether a prompt edit helped rather than relying on whether one answer feels better.
2. State the operation and constraints explicitly
Tell the model what to do, what input it is receiving, and what the answer should contain. Add an audience or role only when it changes the desired response. Include constraints such as “use only the supplied text,” “return valid JSON,” or “if the evidence is missing, say so” when those conditions matter.
Google recommends clear, specific instructions and describes useful prompt inputs in terms of a question, task, entity, and completion. OpenAI’s guidance similarly separates high-level instructions such as behavior, tone, and goals from examples and task data. Avoid vague requests like “make this better” when you can state the operation and criteria directly.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
3. Supply relevant context and delimit it
Provide the facts, documents, code, or constraints that the model needs instead of expecting it to infer task-specific information. If the prompt contains a long instruction and a separate body of source material, label the sections clearly with headings, lists, Markdown, or XML tags. OpenAI notes that these formats can help distinguish prompt sections and supplied data.
Keep instructions separate from untrusted or user-provided text when that distinction matters to the task. Formatting helps the model interpret the request, but it does not ensure that the model will follow every instruction or treat every source as authoritative; test that behavior with realistic inputs.
4. Add examples only when they clarify the target
Few-shot examples can demonstrate the response format, phrasing, scope, or decision pattern you want. Choose examples that resemble actual inputs and keep their structure consistent with the format you expect in production. Then compare outputs with and without the examples.
More examples are not automatically better. Google warns that too many examples can cause a model to overfit their pattern and recommends experimenting with the number used. An example that is unusually neat or unlike real inputs can teach the wrong pattern, so include representative edge cases in evaluation.
Recommended Free Tools
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
5. Test, diagnose, and revise
Run the draft prompt against a set of representative cases and compare the outputs with the success criteria. When a response fails, identify the particular failure—such as omitted context, ambiguous constraints, invalid output structure, or a capability gap—before editing. Change one meaningful part at a time where practical, so you can understand which change affected the result.
OpenAI recommends tests and evaluation suites to monitor prompt behavior as prompts or models change; Anthropic emphasizes empirical testing against success criteria. A small, repeatable evaluation set is more informative than polishing a prompt based on one favorable response.
6. Treat a production prompt as application code
Store production prompts in code, keep dynamic values in typed inputs or schemas where appropriate, and maintain representative fixtures and evaluation checks. Roll out prompt changes through the application’s normal deployment process. If stable behavior matters, pin a model snapshot where the provider supports that practice, then retest when you intentionally change the model or prompt.
Provider APIs and recommended workflows evolve, so check the current documentation for the model and endpoint you deploy. The implementation details can change even when the underlying practice—define criteria, test, and manage changes—remains useful.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsRank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Why prompt advice changes between models
Prompting techniques do not transfer perfectly across providers, model types, or versions. OpenAI says different model types may need different prompting and that snapshots can behave differently. Anthropic points developers to Claude-specific tuning guidance, while Google describes its Gemini strategies as starting points to experiment with. Validate a prompt on the actual model and version used by your application rather than assuming a prompt that worked elsewhere will transfer unchanged.
When comparing models or prompt approaches, use the same representative tasks and success criteria. Consider whether each option:
- Meets the task’s criteria on realistic examples, including difficult cases.
- Follows the instructions and output format reliably enough for the application.
- Behaves acceptably across the model versions or snapshots you expect to deploy.
- Fits the application’s latency and cost constraints.
- Handles the amount and type of context the task requires.
OpenAI describes trade-offs among model types in speed, cost, and capability, and Anthropic notes that model selection can be a route to latency or cost improvements. The cited provider guidance does not establish a shared benchmark or like-for-like price comparison, so there is no evidence-based universal provider ranking here. Measure the choices against your own workload.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.When to stop editing the prompt
Classify the failure before adding more instructions. A missing fact or ambiguous output requirement may be addressed by better context or a clearer prompt. A model that cannot perform the task reliably, a latency bottleneck, or an unacceptable cost may require a different model or application design instead. Anthropic explicitly cautions that not every failing evaluation is best solved through prompt engineering and notes that model selection can sometimes improve latency or cost more easily.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Use evaluation results to decide whether to revise instructions, supply different context, change the model, or restructure the task. The prompt is one part of the system, not the only lever available to a developer.
Or skip the browser setup
For a screenshot workflow used alongside prompt-driven development, ScreenshotNeo offers a website screenshot API and MCP server. A single GET request can return an image or PDF; for example, this cURL request saves a WebP screenshot of Stripe:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Cookie banners, newsletter popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server provides screenshot tools for AI agents, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Learn about ScreenshotNeo or sign up free for 1,000 screenshots a month, with no card required.
Free tools Windows power users keep installed
One-click scans. No signup required.
Frequently Asked Questions
Does a better prompt guarantee the same answer every time?
No. Language-model output is non-deterministic, and behavior can differ across model types and snapshots. Evaluate the model and version you deploy.
Should every prompt include examples?
No. Examples help when they make the desired pattern clearer, but test their impact; too many or unrepresentative examples can encourage overfitting.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

