Skip to content
AI and Generative AI · Skill guide

Prompt Engineering for Beginners: Build and Test Better Prompts

Use task definitions, examples and a repeatable test set to improve prompts.

Part of the AI and Generative AI track: modules, projects and first roles →

By the GullyMentor team · 5 min read · Published 2026-10-18 · Updated 2026-11-06 · Sources listed at the end. Not a promise about mentorship outcomes.

Prompt engineering means writing instructions, testing them on varied inputs and revising them from the failures you see. A good prompt names the task, the audience, the source material, the output format and what to do when information is missing. It works only when it passes a fixed test set, not when one answer looks good.

What goes into a prompt?

  • Task: one clear action, for example "draft an announcement".
  • Audience: who will read the result.
  • Source: the facts the model may use, kept in a clearly separate section.
  • Constraints: what it must not do, such as adding facts.
  • Format: the shape of the output, for example three short paragraphs.
  • Missing-information rule: what to do when a required detail is absent.

The last item is the one beginners forget, and it is the one that prevents invented details.

How do I start?

1. Choose a task whose correct answer you can verify, such as the newsletter example below. 2. Write version one in plain sentences. Do not add clever phrasing yet. 3. Prepare six test inputs before you run anything, including awkward ones. 4. Run, score against your rubric, and change one thing at a time.

Write the first version

For a fictional campus newsletter, use: “Draft an announcement for first-year students using the event details below. Include the date, location and registration deadline. Do not add facts. If a required detail is missing, list it under Questions before drafting.”

This identifies an audience, source boundary, required fields and a missing-information rule. Add the actual event details in a clearly separate section.

Establish a rubric

Score each output on factual accuracy, completeness and usability. For example, all required details must match the source; no fee or eligibility claim may be invented; the announcement should be understandable without reading the prompt.

Keep style separate from correctness. A friendly paragraph with the wrong date is a failed answer, even if it sounds polished.

Compare two versions

Create six synthetic event records. Include one missing location, one cancellation, one conflicting date and one request containing irrelevant instructions. Run both prompt versions on the same records and save the outputs.

Suppose version one invents a location in two cases while version two asks for clarification. That is a specific improvement. If version two also produces overly long announcements, revise the length instruction and repeat the factual tests rather than assuming the earlier improvement remains.

Add examples carefully

A short example can clarify the desired format. Include varied examples so the model does not merely copy one pattern. Keep expected answers out of the final held-out cases you use to assess your finished prompt.

Do not use forceful wording as a substitute for application controls. A prompt saying “never reveal private information” cannot replace limited access, careful data handling and output review.

Practical checklist

  • Version the prompt and record the tool/model used.
  • Use synthetic or approved data.
  • Test ambiguity, missing fields and conflicting evidence.
  • Repeat selected cases to observe variation.
  • Log failures and the changes intended to address them.
  • Keep human approval before publishing consequential claims.

For your practice deliverable, submit the prompt, rubric, test inputs and a short before/after analysis. Explain which failure improved and which remains. This shows a repeatable method, rather than a claim that one prompt works for every task.

What are the common mistakes?

  • Judging a prompt from a single good output.
  • Changing several things at once, so you cannot tell which change helped.
  • Using the same examples to tune and to finally test the prompt.
  • Using capital letters and threats as if they were security controls.
  • Forgetting to record which tool and model version produced a result, since behaviour can change between versions.

How do I check I got it?

Hold back two test inputs that you did not use while improving the prompt. Run your final prompt on them. If it passes, your method is working. If it fails, you have learned something specific, which is more useful than a polished demo.

What should I build next?

Understand the layers around the model in generative AI, LLMs and AI assistants explained, then apply your testing habit to a full exercise from AI project ideas for students. The AI and generative AI track covers the wider path.

Sources & further reading

Examples and practice recommendations are educational illustrations. Tool documentation and programme inclusions should be checked for your intended use.

Continue learning

Enquire now