BXUP Track progress & test yourself — free
AI at Work · Common Core · ~14 min read
AI AT WORK · COMMON CORE

Prompt & Context Engineering in Practice

Phrasing is the easy half. This module is about what the model can see when it works — which artifacts, which conventions, which examples, and what to deliberately leave out — plus the iteration patterns and reusable prompt assets that turn a good result into a repeatable one.

You already know the basics: assign a role, give examples, specify the format. If you've spent any time with AI tools, you've absorbed prompt engineering's first chapter. This module is the second chapter — the one employers are actually hiring for when postings ask for "prompting, context engineering, agent architectures" in the same breath.

The shift is this: as models got better at inferring intent, the bottleneck moved from how you phrase the instruction to what information the model has when it executes it. Phrasing is prompt engineering. Deciding what the model gets to see — which docs, which examples, which code, which history, and just as critically what it doesn't see — is context engineering, and in 2026 it is the higher-leverage skill. Demand for it is measurable: prompt-engineering skill mentions in job postings grew over 135% year over year in this program's research base, and the phrase "context engineering" now appears verbatim in engineering job descriptions.

Key Takeaway:

A 2026 model rarely fails because your wording was clumsy. It fails because it was missing information you had, drowning in information it didn't need, or free to guess where you should have constrained it. Engineer the context first, the phrasing second.

What You'll Learn

  • Task framingrole, constraints, and an explicit output contract that survive contact with real work
  • Context engineeringwhat to include, what to exclude, docs-as-context, and few-shot examples as specification
  • Long context versus retrievalwhen each is right, and why "paste everything" fails past a threshold
  • Two iteration patternscritique-and-revise and decomposition, both of which beat re-rolling
  • Reusable assetsa personal prompt library and team templates that turn wins into infrastructure
  • Model-behavior differenceshow vendors really differ, plus the anti-patterns that waste the most professional time

Task Framing: Role, Constraints, Output Contract

A professional prompt is a work order with three load-bearing parts. You know them individually; the discipline is never shipping a prompt that's missing one.

Role — calibrate the reviewer, not just the writer

Role prompts work, but experienced users under-spec them. The high-leverage move is encoding how to think, not just credentials — and for professional work, the thinking you usually want is skeptical:

Weak:   You are an expert Java developer.
Strong: You are a staff engineer reviewing code for a payments
        service. You care about idempotency, failure modes, and
        observability more than elegance. You flag anything you
        would not let ship, and you say "this is fine" when it is.

The last clause matters more than it looks: explicitly authorizing the model to approve reduces invented nitpicks, and explicitly demanding flags reduces sycophantic waving-through. You are tuning the model's disagreement threshold — something a bare role never does.

Constraints — what must be true, what must not happen

Constraints are the difference between an answer and your answer: versions and stack ("Python 3.12, no new dependencies"), scope ("modify only this function; do not refactor the callers"), banned moves ("no mocking the database in these tests"), audience and length. Unstated constraints don't default to sensible — they default to the training distribution's average, which is precisely what your codebase and your client are not.

Output contract — shape agreed before work starts

Specify the deliverable's structure like an interface: sections, fields, allowed values, a missing-data rule ("if the log doesn't contain the answer, say NOT FOUND — do not infer"), and a chatter ban ("output only the table"). Contracts do double duty: they make output usable downstream, and they make verification faster — a fixed structure means your eye knows where to look for what's wrong. This is the same idea as structured outputs at the API level, applied at the chat level.

Remember:

Role, constraints, contract — if a prompt you're about to send is missing one of the three, you haven't finished writing it. Thirty seconds of framing routinely saves three rounds of correction.

Context Engineering: The Real Skill

A model's context window is its entire working memory for your task. It has read the internet, but it has never seen your codebase, your client's requirements doc, your team's conventions, or last quarter's numbers — unless you put them there. Context engineering is deliberate curation of that window.

What to include

Ask: what would a competent new hire need on day one to do this task without asking questions? That's your inclusion list:

  • The actual artifacts. The function being modified and its callers; the requirements section being implemented; the error with surrounding log lines. Interfaces and type definitions the code touches.
  • Conventions and standards. Your team's API design doc, style guide, or one exemplary file with "match this file's patterns." Modern coding agents formalize this as a standing instructions file in the repo (AGENTS.md, CLAUDE.md, Copilot instructions) — write one for your project and every agent session starts pre-briefed.
  • Definitions of local terms. Every org has words that mean something specific internally ("activation," "tenant," "reconciliation"). Models silently substitute the internet's meaning for yours.
  • Current documentation for fast-moving dependencies. For any library that ships breaking changes, paste the relevant doc page rather than trusting training data — this converts a hallucination risk into a reading-comprehension task, which models are far better at.

What to exclude

Exclusion is the half professionals skip. More context is not monotonically better: irrelevant material dilutes attention, invites the model to "use" what you pasted whether or not it applies, and buries the signal. Leave out the 400-line file when 30 lines are relevant (state that you've excerpted). Leave out three conflicting old drafts. Leave out the long prior conversation — a fresh chat with curated context beats a stale chat with accumulated contradictions. Context is a budget, not a bucket: every token you include is a claim that it matters.

Examples are context too

Few-shot examples remain the highest-bandwidth way to communicate format, tone, and edge-case policy — two or three input→output pairs teach what a page of rules can't. One caution from the field: examples override written instructions when they conflict. If your instruction says "concise" and your examples run 300 words, you'll get 300 words. When a few-shot prompt misbehaves, audit the examples before the instructions.

Long context vs. retrieval

Frontier windows fit hundreds of thousands of tokens, which makes "just paste everything" genuinely viable for a single spec, a substantial log dump, or a handful of files — and for one-off tasks it's the right call: simple, complete, no infrastructure.

It stops being right at scale, for three reasons:

  • Attention degradesretrieval quality across a stuffed window is uneven, and details in the middle of very long contexts get missed more often than details near the edges.
  • Cost and latency scale with tokensre-sending a 300-page corpus with every question is real money at API prices.
  • Freshnesspasted context is frozen at paste time.

The engineering answer is retrieval — indexing the corpus and fetching only relevant chunks per query — which is RAG, covered properly later in this track. For now, the practitioner's rule of thumb:

SituationStrategy
One task, material fits comfortablyPaste it all; instruct "answer only from the provided material"
One task, material is hugeExcerpt the relevant sections yourself — you are the retrieval step
Repeated queries over a stable corpusTool with built-in retrieval (assistant "projects"/knowledge features) or a RAG pipeline
Corpus changes constantlyRetrieval, always — pasting is stale on arrival
Pro Tip

When you paste reference material, fence it and say what it is: <requirements>, <logs>, <style-guide> (or markdown headers). Labeled blocks let you write instructions that point — "follow <style-guide>; treat <logs> as ground truth" — and measurably reduce the model blending sources it should keep separate.

Iteration Patterns

First outputs are drafts. Professionals differ from casual users not in getting better first outputs (they do, but marginally) — but in what they do next. Two patterns cover most of it.

Critique-and-revise

Never re-roll and hope; make the model attack its own work with a specific adversarial lens, then revise against the critique:

Act as a skeptical SRE reviewing the runbook you just wrote.
Assume the reader is paged at 3 a.m., stressed, on a phone screen.
List every step that is ambiguous, assumes unstated access, or
could make the incident worse if followed literally.
Then rewrite the runbook fixing everything you found.

The lens is the technique: a generic "critique this" yields generic praise-plus-nitpicks; a persona with stakes yields findings. Chain different lenses for important work — correctness pass, then security pass, then audience pass. And run the same trick on your prompts themselves: paste a prompt plus its disappointing output and ask the model to diagnose the prompt. It is startlingly good at spotting the ambiguity you can't see because you know what you meant.

Decomposition

When output quality craters, the task was usually too big for one prompt — too many goals competing in one context. Decompose along inspection points, exactly as you'd decompose an engineering task along interfaces: extract → analyze → draft → critique, where each step's output is reviewed (by you, or by the next prompt's contract) before becoming the next step's input. Errors get caught where they're cheap, at the seams, instead of compounding silently inside a mega-prompt. This is also, not coincidentally, how agent pipelines are architected — decomposition skill transfers directly to the agents module later in this track.

Warning

Don't iterate by piling corrections onto a long conversation — "no, shorter… no, without the preamble… no, in Python" accumulates contradictory instructions that keep leaking into output. After two or three corrections, fold everything you've learned into a revised prompt and restart clean. The revised prompt, not the conversation, is the asset.

Reusable Prompt Assets

An iterated prompt that works is engineering output. Throwing it away and re-improvising next week is the single most common waste in professional AI use.

  • Personal prompt libraryA doc, a notes page, a git repo; the medium is irrelevant. Per entry: a name, the prompt with [bracketed slots] for the variable parts, one line on when to use it, and a sample of known-good output (the sample is what lets future-you verify the prompt still works after a model update). Ten curated entries covering your recurring task types — code review, log analysis, doc drafting, meeting-notes-to-actions, test generation — beat a hundred hoarded chat links. Every mature AI tool also has a native home for the standing subset: custom instructions, projects, styles (chat assistants) or repo instruction files (coding agents). Put durable preferences there once; stop re-typing them.
  • Team templatesThe compounding version. A shared library of your team's proven prompts — the incident-summary template, the PR-description generator, the client-status-report frame — does for AI output what a component library does for UI: consistency, quality floor, and onboarding speed. Treat it like code: owned, versioned, pruned. This is also where standards about AI use live (which template for which task, what must be verified before output ships) — several of the mandate-era companies from CC-1 institutionalized exactly this.
Note

Date-stamp library entries with the model/tool they were tested on. Prompts are calibrated against a model's current behavior; after a major model update, re-run your top five against their saved sample outputs before trusting them. Five minutes, quarterly, and it has caught real regressions.

Model Behavior Differences

Vendor-neutrality doesn't mean pretending models are interchangeable. Techniques transfer; calibration doesn't quite. Expect differences along these axes when you switch between ChatGPT, Claude, and Gemini — or between model versions from one vendor:

  • Instruction-following strictness. Models differ in how literally they honor length limits, format contracts, and bans. The fix is universal — tighten the contract, add an example — but the amount of tightening needed varies by model.
  • Verbosity and preamble. Some models default to explaining before answering; "output only X" and a one-shot example are the levers, applied in different doses.
  • Refusal and caution thresholds. Security work, medical/legal-adjacent text, and scraping-flavored tasks trip different wires per vendor. A legitimate task refused by one model phrasing is often accepted with clearer professional context ("I am reviewing my own team's code for injection flaws").
  • Reasoning-mode behavior. All vendors ship fast and reasoning variants; on reasoning variants, over-scripted step-by-step instructions can degrade output — state goals and success criteria, let the model plan the steps. On fast variants, explicit "think step by step before answering" still earns its keep.
  • Context-handling. Long-context recall quality, and how tools inject their own hidden context (system prompts, retrieved files) around yours, differ per product — one reason the same prompt behaves differently in a vendor's chat app vs. its API.

The practical protocol: when you switch models, re-run three prompts from your library against their saved samples. The diff is the calibration you need to learn — and it's why the library carries model annotations.

Exam Tip

Assessment questions on model differences test the protocol, not vendor trivia — given "prompt worked on model A, misbehaves on model B," the correct answers are tighten the contract, add an example, and recalibrate against saved outputs; never "model B is worse."

Anti-Patterns

Named failure modes, so you can catch them in your own usage and your team's:

  1. The vague ask. "Make this better," "review this," "any thoughts?" — no role, no criteria, no contract. You get the internet's average review: confident, generic, useless. If you can't state what better means, that's the work to do before prompting.
  2. Context dumping. Pasting 4,000 lines "so it has everything" and asking about 40 of them. Signal buried, attention diluted, and the model dutifully hallucinates relevance for the irrelevant 3,960. Curate or excerpt; inclusion is a claim of relevance.
  3. Prompt cargo-culting. Copying incantations — "take a deep breath," "I'll tip $200," 400-word mega-personas — because a listicle said they work. Some were marginal on 2023 models; none substitute for context and contracts on 2026 models. If you can't say why a prompt element is there, delete it and re-run: the output usually doesn't change.
  4. The infinite correction chat. Twelve rounds of "no, not like that" in one thread. Contradictions accumulate; quality oscillates. Fold and restart (see the Warning above).
  5. One-shotting the mega-task. "Write the full migration plan with rollback, comms, and timeline" as a single prompt, then despairing at the mush. Decompose; inspect at seams.
  6. Trusting memory over context. Asking about a fast-moving library, your internal system, or anything post-cutoff without providing source material — this is requesting hallucination. If correctness matters, ground it: paste the doc, and instruct "answer only from the provided material."

Exercises

Build three reusable, role-specific prompt assets. Use real work — the point is a library you'll use next week, not a homework artifact. For each: draft → run on a real input → critique-and-revise once → save with slots, usage note, sample output, and model annotation.

  1. The recurring-deliverable template. Pick your most frequent written deliverable (PR description, test plan, status report, incident summary, requirements summary — whatever your role ships weekly). Build a prompt with full task framing: a calibrated role, your real constraints (length, audience, banned phrases, format), and a strict output contract with a missing-data rule. Acceptance: run it on two different real instances; both outputs honor the contract with zero structural drift.
  2. The grounded analyzer. Build a prompt that answers questions over pasted material from your domain (logs, a spec, a contract, a dataset excerpt) using labeled context blocks, "answer ONLY from the provided material," and a required citations field — every claim must quote the line it came from, with NOT FOUND as the fallback. Acceptance: ask it one question the material answers and one it doesn't; you must get a correct cited answer and a clean NOT FOUND (no improvisation) respectively.
  3. The adversarial reviewer. Build a critique prompt for your own work products, with a skeptical persona calibrated to your real stakes (the 3 a.m. on-call, the hostile procurement reviewer, the security auditor), 4–6 named review criteria from your actual standards, a severity scale, and "most serious first; say 'ship it' if nothing serious." Acceptance: run it on something you already shipped; it finds at least one issue you agree is real, and its severity ordering survives your judgment.

Then: re-run exercise 1's prompt on a second model (any vendor's free tier) and note every behavioral difference in the library entry. That note is your first calibration record.

Key Takeaways

  • The bottleneck moved: phrasing is table stakes; what the model sees — and doesn't — decides output quality. Context is a budget; inclusion is a claim of relevance.
  • Every professional prompt has three parts: calibrated role (tune the disagreement threshold), explicit constraints, and an output contract with a missing-data rule.
  • Include what a day-one hire would need: artifacts, conventions (repo instruction files), local definitions, current docs for fast-moving dependencies. Exclude the rest deliberately.
  • Long context for one-off tasks that fit; excerpt when huge; retrieval when repeated or fresh — pasting a changing corpus is stale on arrival.
  • Iterate with critique-and-revise (specific adversarial lens) and decomposition (inspect at seams); fold long correction chats into a clean revised prompt.
  • Working prompts are assets: personal library with slots, samples, and model annotations; team templates treated like code.
  • Models differ in strictness, verbosity, refusals, and reasoning behavior — recalibrate on switch; never cargo-cult.

Further Reading

This is the free reading view. Open BXUP to track your progress, run the hands-on labs, and prove it with original, exam-pattern assessments.
© Anvi Innovate · BXUP — Be Exponentially Upskilled · BXUP is an independent learning platform, not affiliated with or endorsed by AWS, Microsoft, Google, NVIDIA, IBM, Salesforce, Databricks, Oracle or Anthropic. All trademarks belong to their respective owners. · bxup.in