Single logo
  • Courses
  • Blog
  • About
Join free on SkoolJoin free on Skool

Learning path · 8 steps

Prompt and Context Engineering
  1. 1
    Temperature, Top-p and Sampling: Why the Same Prompt Gives a Different Answer
  2. 2
    Explicit Criteria vs Vague Prompts: Turn Every Adjective Into a Check a Script Can Run
  3. 3
    Few-Shot Prompting Done Right: How Many Examples, How Different, What Order, and the Leak That Lies
  4. 4
    Structured LLM Output with Pydantic: Describe the Shape Once, Check Every Reply
  5. 5
    Prompt Caching: Keep the Start of Every Request Identical and Pay for the Long Part Once
  6. 6
    Prompt Versioning and Testing in a Repo: Prompt Files, a Registry, a Hash per Answer and Tests That Gate
  7. 7
    Context Engineering: What Belongs in the Context Window, Turn by Turn
  8. 8
    Context Engineering for a Long-Running Agent: Clear, Compact, Take Notes, Prove It
  1. Blog
  2. /
  3. AI Engineering
  4. /
  5. LLM Fundamentals

Learning path: Prompt and Context Engineering · Step 2 of 8

Explicit Criteria vs Vague Prompts: Turn Every Adjective Into a Check a Script Can Run

Swap words like "better" and "professional" for criteria a script can mark pass or fail: 120 words, every number kept, no hedge words, three bullets. Then rewrite a vague meeting-notes prompt until all five rubric checks pass.

Chaand Sheikh

·27 November 2026LLM Fundamentals

What you will learn

  • Spot why "make it better" gives a different shape on every run
  • Rewrite an adjective as a number, a list or a format
  • Write a plain Python check() that marks an output pass or fail on four rules
  • Rewrite a vague summariser prompt until a five-check rubric passes

Before you start

  • Basic Python
  • What an LLM Can and Cannot Do

If you have ever typed "make it better" into a chat box, this one is for you. The whole idea fits in one line: swap words like "better" for checks the output can pass or fail. Measurable, repeatable and testable, that's what we are after.

Same notes, a different shape every day

Our team has to send a release note to customers. Here are the internal notes:

Version 4.2 ships on May 20. Exports are 40% faster.
We added 12 new chart types. Sign-in now takes 2 steps instead of 5.

Somebody asks the model:

Make this release note better. Make it more professional.

On Monday it comes back chatty. On Tuesday it's stiff and formal. On Wednesday it's a wall of text. Same notes, same prompt, three different shapes, because nothing in the prompt says what good looks like. So every run picks its own idea of good.

Think of cooking. Leave a note at home that says "cook something nice" and you get pasta on Monday, soup on Tuesday and a salad on Wednesday. Leave a recipe instead (two eggs, ten minutes, serves four, one pinch of salt) and you get the same omelette every night. Anyone can follow it, and anyone can check it. "Cook something nice" is a vague prompt. The recipe is explicit criteria.

Short to write, hard to repeat

The vague prompt takes five seconds to write. Now read it slowly.

  • Better how? Shorter, friendlier, more detail? Nobody can say.
  • More professional to whom? It changes with whoever reads it.
  • And look at what isn't there at all: how long it should be, which facts must stay, and what format. The model has to guess all three.

An adjective is an opinion, and two runs can read it two ways.

Turn every adjective into a check

Here is the one idea of this article. Every adjective gets swapped for something we can measure, and every criterion gets a check a script can run.

Adjective to criterion to check Adjective Explicit criterion Check Result better 120 words or fewer words <= 120 pass accurate keep every number not missing pass professional no hedge words not hedges pass clear three bullets bullets == 3 pass
An opinion can't fail. A number can, and it passes or fails the same way every time.

The explicit prompt: one job, four checks

Here is the explicit version. It sits in samples.json next to the release notes, one line per criterion:

"explicit_prompt": [
  ["task", "Rewrite the release note below for customers."],
  ["length", "Use 120 words or fewer."],
  ["facts", "Keep every number exactly as written."],
  ["wording", "Use no hedge words."],
  ["format", "Write three bullets in plain English."]
]

The first line is the job. The other four are checks. A person can mark each line pass or fail, and so can a small script.

What a hedge word is

Hedge words soften a statement until it says nothing firm: might, possibly, it seems, perhaps, could be. Take "Exports might be faster." Faster by how much? Is it even true? If a customer asks support, support can't answer. Compare "Exports are 40% faster." One claim, one number, and you can check it against the notes. Hedges hide the facts, and that's why "no hedge words" is one of the four checks.

check(): four rules, no model

So what does the checking script look like? Here is main.py. Notice there is no model in it at all. It is plain Python, and it runs offline.

import json
import pathlib
import re
from typing import NamedTuple

HERE = pathlib.Path(__file__).parent
SAMPLES = json.loads((HERE / "samples.json").read_text(encoding="utf-8"))
SOURCE = SAMPLES["source"]
HEDGE_WORDS = ["might", "possibly", "it seems", "perhaps", "could be"]
NUMBER = re.compile(r"\d+(?:\.\d+)?%?")


class Result(NamedTuple):
    rule: str
    ok: bool
    message: str


def check(text: str) -> list[Result]:
    """Mark a summary against the four rules: length, numbers, hedge words, bullets."""
    words = len(text.split())
    missing = sorted(set(NUMBER.findall(SOURCE)) - set(NUMBER.findall(text)))
    hedges = [w for w in HEDGE_WORDS if w in text.lower()]
    bullets = sum(1 for line in text.splitlines() if line.startswith("- "))
    return [
        Result("length", words <= 120, f"length: {words} words, limit 120"),
        Result("numbers", not missing, f"numbers: missing {missing}" if missing else "numbers: all kept"),
        Result("hedge words", not hedges, f"hedge words: found {hedges}" if hedges else "hedge words: none"),
        Result("bullets", bullets == 3, f"bullets: {bullets}, need 3"),
    ]

Line by line:

  • words: text.split(), then count the pieces.
  • missing: every number in the source notes, minus the numbers found in the summary. Whatever is left was dropped.
  • hedges: every hedge word that shows up in the lower-cased text.
  • bullets: the lines that start with a dash and a space.

It returns one Result per rule: True or False, plus a short reason. You don't have to write this by hand. A one-line prompt such as "Write a Python function check(text) that marks a summary pass or fail on four rules: 120 words at most, every number kept, no hedge words, exactly three bullets" gives you a similar function. Then you read every line of it.

Two samples, four checks

Both samples are text we wrote ourselves. Sample A:

Version 4.2 is here on May 20.
- Exports are 40% faster.
- 12 new chart types are ready to use.
- Sign-in takes 2 steps instead of 5.

Sample B:

Version 4.2 might be a nice update. It seems exports are
possibly faster, and we added some new charts.
Sign-in is also easier now.

Run both through check() with python demo.py check:

python demo.py check
Sample A
  PASS length: 29 words, limit 120
  PASS numbers: all kept
  PASS hedge words: none
  PASS bullets: 3, need 3
Sample B
  PASS length: 24 words, limit 120
  FAIL numbers: missing ['12', '2', '20', '40%', '5']
  FAIL hedge words: found ['might', 'possibly', 'it seems']
  FAIL bullets: 0, need 3

Sample A meets four of four. Sample B passes length with 24 words, then fails the rest: it dropped 12, 2, 20, 40% and 5 (it kept 4.2), it hedges three times, and it has zero bullets where we need three. One of four, and every cross tells you exactly what to fix.

Break it on purpose

Take Sample A and add one word: "Exports are possibly 40% faster."

python demo.py try "Version 4.2 is here on May 20.\n- Exports are possibly 40% faster.\n- 12 new chart types are ready to use.\n- Sign-in takes 2 steps instead of 5."
Your summary:
  PASS length: 30 words, limit 120
  PASS numbers: all kept
  FAIL hedge words: found ['possibly']
  PASS bullets: 3, need 3

Three of four, and the cross names the exact word. Take it out and you are back to four of four. Fixing it takes seconds.

Vague vs explicit, side by side

VagueExplicit
RepeatabilityA different style each runThe same shape each run
TestabilityJudged by opinionPass or fail, a script can do it
ReviewA long back and forthRead the failed check, fix it
Who decides what good meansWhoever reads it todayThe criteria, written once

In a team, this is the difference between arguing about taste and fixing a failed check.

Five questions for any instruction

  1. Name the goal. One job per prompt.
  2. Put a number on it. Words, bullets, items, whatever fits.
  3. Say what to keep. Facts, names and figures.
  4. Say what to avoid. Hedge words, jargon and filler.
  5. Could a script check it? If not, sharpen it.

Every adjective left in a prompt is a guess you hand to the model.

Worked practice: rewrite a vague summariser prompt

Now you do the rewriting. A teammate shipped this one-line prompt into a meeting-notes summariser:

Summarise this document in a way that is useful for the team.

The team has three complaints. The shape keeps changing: three sentences one time, six paragraphs the next. Facts go missing: dates, amounts and names. And there is soft wording, filler and hedging nobody asked for. The problem is not really the model. "Useful for the team" cannot be checked, so every answer counts as right.

Think of ordering a cake for an office party. "A nice cake for the team, please" could get you anything. "Serves twelve, two layers, no nuts, the team name on top, ready by Friday" tells the baker exactly what to make, and you can check the cake when it arrives. Your prompt has four levers that work the same way.

Four levers for a checkable prompt "... in a way that is useful for the team." Length a number a test can count Required facts that must survive Excluded what must not appear, with examples Format a shape code can parse
Each soft word in the prompt becomes a number, a list or a shape.

The rubric grades the prompt, not a reply

One difference from the release-note example. There, check() graded the model's output. Here, a small rubric grades the prompt text itself, so no model is called and no API key is needed. The project has a starter/ folder with three files: prompt.txt (the only file you edit), rubric.py (five checks) and test_prompt.py (the done check). A solution/ folder holds one possible rewrite; open it only after you have tried.

Each check in rubric.py looks for one lever:

import re

VAGUE = ("useful", "nice", "good", "appropriate", "relevant", "clear")


def check_length(prompt: str) -> bool:
    """A number of words (or sentences) the summary must stay under."""
    return bool(re.search(r"\b\d+\s*(words|sentences)\b", prompt, re.I))


def check_required(prompt: str) -> bool:
    """Names the facts that must survive: dates, amounts and people."""
    p = prompt.lower()
    return "date" in p and ("amount" in p or "dollar" in p) and ("people" in p or "name" in p)


def check_excluded(prompt: str) -> bool:
    """Says what must not appear, with at least two quoted example phrases."""
    says_no = re.search(r"\b(do not|don't|no)\b", prompt, re.I)
    return bool(says_no) and len(re.findall(r'"[^"]+"', prompt)) >= 2


def check_format(prompt: str) -> bool:
    """Describes a parseable shape: bullets for decisions, numbered action items with owner and due date."""
    p = prompt.lower()
    return all(w in p for w in ("bullet", "numbered", "owner", "due"))


def check_no_vague_words(prompt: str) -> bool:
    """No soft adjectives left that a test cannot measure."""
    return not any(re.search(r"\b%s\b" % w, prompt, re.I) for w in VAGUE)

The file collects them in a CHECKS dictionary, and test_prompt.py runs one parametrised pytest test per check. Run the rubric on the starter:

pip install -r requirements.txt
cd starter
python rubric.py
FAIL  length
FAIL  required content
FAIL  excluded content
FAIL  output format
FAIL  no vague words
score: 0/5

Zero out of five, and python -m pytest -q shows 5 failed. Your goal is 5 passed.

Your tasks, one lever at a time

  1. Add a length limit with a number (words or sentences).
  2. Name the required content: dates, amounts and the people's names.
  3. Add excluded content: what must not appear, with at least two quoted example phrases.
  4. Describe the output format: a bullet list of decisions and a numbered list of action items, each with an owner and a due date.
  5. Remove every vague word: useful, nice, good, appropriate, relevant, clear.

Rerun python rubric.py after each change. You are done when python -m pytest -q prints 5 passed and the rubric prints score: 5/5.

One possible rewrite

Try it yourself first. Here is the rewrite from the solution/ folder, which passes all five checks:

You summarise meeting notes for the engineering team.

Length: at most 180 words in total.

Keep every date, every dollar amount and the names of the people involved, exactly as written in the notes.

Output format, in this order:
Decisions: a bullet list, one decision per bullet.
Action items: a numbered list. Each item has an owner and a due date (YYYY-MM-DD, or "no date" if the notes give none).

Do not add filler such as "it is worth noting" or "in conclusion".
Do not hedge with "might", "could" or "perhaps".

Map it back to the levers: "at most 180 words" is the length, "every date, every dollar amount and the names" is the required content, the two "Do not" lines with quoted phrases are the excluded content, and "a bullet list" plus "a numbered list ... an owner and a due date" is the format. "Useful" is gone.

Stretch: add a sixth check of your own to rubric.py, for example that the prompt names its audience, and make it pass. Then run your prompt against a model with a set of meeting notes and write a test that checks the reply's format: bullets, and numbered items with an owner and a due date. That second test is the check() idea from the first half, pointed at your new prompt.

If a test cannot grade the answer, the prompt is not finished.

Recap

StepExample
Start from the adjective"make it better", "useful for the team"
Turn it into a number, a list or a shape120 words, keep every number, three bullets
Write the checka rule a script runs: words <= 120, bullets == 3
Get pass or failthe same every time, and the cross names the fix

Once your criteria are checks, you can run them on many replies at once. That is the start of an eval, covered in Why You Cannot Ship an LLM Feature Without an Eval. For checking the shape of a reply with a schema instead of string rules, see Structured LLM Output with Pydantic.

Keep going in the learning path Prompt and Context Engineering · step 2 of 8

Previous
Temperature, Top-p and Sampling: Why the Same Prompt Gives a Different Answer
Next post
Few-Shot Prompting Done Right: How Many Examples, How Different, What Order, and the Leak That Lies
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Become an AI Engineer: LLMs, RAG, Agents and MCP

Build real AI systems in Python: LLM APIs, RAG, evals, agents and MCP.View on Udemy ↗: Become an AI Engineer: LLMs, RAG, Agents and MCP (paid course, opens in a new tab)

Related posts

The AI Stack in One Picture: Six Layers Every AI Product Is Built From

Every AI product is built from six layers: data, model, retrieval, orchestration, serving and ops, with evals and security across all of them. A restaurant analogy, one request traced through all six, and what an AI engineer actually builds around the model call.

Tokenization: What an LLM Actually Sees When You Type

A language model never sees letters, only token ids. Use tiktoken to watch strawberry become three ids, see a space or a capital change them, fix the letter-counting problem, and compare English, German and Hindi token counts.

LLM Tokens, Context Windows and Cost: What One Question Really Costs

Follow one four-word help desk question that becomes 911 input tokens. Learn what fills the context window, why chat memory grows every turn, how max_tokens cuts a reply, and how to price a call.

What an LLM Can and Cannot Do: One Prediction Loop, Its Strengths and Its Gaps

A large language model predicts the next token, over and over. That one loop makes it strong at drafting, summarising and classifying, and weak at fresh facts, exact maths, memory and guaranteed truth. See why with a three-line tiktoken script, and learn the fix for each gap.

On this page

  • Same notes, a different shape every day
  • Short to write, hard to repeat
  • Turn every adjective into a check
  • The explicit prompt: one job, four checks
  • What a hedge word is
  • check(): four rules, no model
  • Two samples, four checks
  • Break it on purpose
  • Vague vs explicit, side by side
  • Five questions for any instruction
  • Worked practice: rewrite a vague summariser prompt
  • The rubric grades the prompt, not a reply
  • Your tasks, one lever at a time
  • One possible rewrite
  • Recap
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Become an AI Engineer: LLMs, RAG, Agents and MCP

Build real AI systems in Python: LLM APIs, RAG, evals, agents and MCP.View on Udemy ↗: Become an AI Engineer: LLMs, RAG, Agents and MCP (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.