Bootcamp — 1 · Prompt Engineering
BOOTCAMP — 1 · Prompt Engineering

Prompt Engineering

The core skill everything else rests on: turning a fuzzy intent into a precise instruction Claude can act on — with the right context, constraints, and success criteria.

Read time12 min
LevelBasic → Advanced
Quiz3 questions
SectionBootcamp 2026
01 — what & why

A good prompt is a spec, not a wish

The difference between a mediocre and an excellent result is almost never the model — it's how completely you framed the task.

A strong prompt names four things: context (what Claude needs to know), the task (what to do), constraints (rules, stack, style), and success criteria (how you'll know it's right). Miss one and Claude fills the gap with an assumption.

Go deeper on the mechanics and useful flags in Frontend → Prompts & Flags, and remember that repeated instructions belong in a Skill rather than being retyped every time.

Example: "Fix the login bug" → guesses. "Users with expired sessions get a 500 on /login instead of a redirect; expected: redirect to /session-expired. Here's the handler — find and fix the cause" → a fix.

02 — the technique

Refine in a loop, don't restart

Your first prompt is a hypothesis. Read the result, then steer — keep what worked, correct what didn't.

✓
Give an example
One sample of the input and desired output beats a paragraph of description.
✓
Constrain the shape
Say the format: "return only the diff", "one function", "no explanation".
✗
Don't over-ask
Five tasks in one prompt gives five half-done things. One task, iterate.
✗
Don't assume memory
A new session knows nothing — restate context or point to the file.
03 — worked example (Leave Management)

From a four-part prompt to a real handler

A context/task/constraints/success prompt for the Leave app, and the actual endpoint Claude produces — plus what a good review catches.

prompt
Context: Leave app (Express + Postgres, see CLAUDE.md). No login flow —
  the acting user arrives in the x-acting-user header.
Task: create POST /leave-requests so an employee submits a leave request.
Constraints: validate the dates; reject end < start; business logic in the
  service, not the route; return 201 + the created row.
Done when: a valid body inserts a row and returns 201; bad dates return 400.
javascript
router.post('/leave-requests', actingUser, async (req, res) => {
  const { startDate, endDate, reason } = req.body;
  if (!startDate || !endDate) return res.status(400).json({ error: 'dates required' });
  if (new Date(endDate) < new Date(startDate))
    return res.status(400).json({ error: 'end before start' });
  const row = await leaveService.createRequest(req.actingUser.id, startDate, endDate, reason);
  res.status(201).json(row);
});
✓
Good
Validates input, delegates logic to the service, correct status codes.
✗
Still to fix
No balance check and no overlap check yet — that lands in Feature Development.

Now do this on YOUR project: write a four-part prompt for the first endpoint of your project and read the result against your "Done when" line.

04 — best practices

See the difference a spec makes

Same feature, two prompts. The vague ask makes Claude guess; the four-part spec makes it deliver. Read the two outputs, top to bottom, and name which element closed the gap.

prompt · vague
add leave requests to the app
prompt · four-part
Context: Leave app (Express + Postgres, see CLAUDE.md). No login flow —
  the acting user arrives in the x-acting-user header.
Task: create POST /leave-requests so an employee submits a request.
Constraints: validate dates; reject end < start; logic in the
  service, not the route; return 201 + the created row.
Done when: a valid body inserts a row and returns 201; bad dates 400.
output · weak
app.post('/leave', (req, res) => {
  db.query('INSERT INTO leave VALUES (?)', [req.body]);
  res.send('ok');
});
// guessed route + schema, no validation, logic in the route, no status codes
output · strong
router.post('/leave-requests', actingUser, async (req, res) => {
  const { startDate, endDate, reason } = req.body;
  if (!startDate || !endDate) return res.status(400).json({ error: 'dates required' });
  if (new Date(endDate) < new Date(startDate))
    return res.status(400).json({ error: 'end before start' });
  const row = await leaveService.createRequest(req.actingUser.id, startDate, endDate, reason);
  res.status(201).json(row);
});
✓
Assign a role + the why
"You are a senior Postgres DBA…" plus the reason behind the task narrows the answer beyond the surface request.
✓
Add 1–2 concrete examples
Few-shot examples remove format ambiguity that prose instructions alone can't — one example beats a paragraph of explanation.
✗
Vague adjectives as specs
"Make it good" tells Claude nothing; "≤200 words, no jargon, bullet list" gives a pass/fail bar it can actually hit.
✗
Multi-step asks in one sentence
Split compound requests into ordered steps and ask for step-by-step reasoning on hard problems — one prompt, one objective.
Check your understanding
1. Which four elements make up a strong prompt?
Correct.Not quite — the correct answer is highlighted above.
2. Your first prompt gave a nearly-right result. What's the recommended next move?
Correct.Not quite — the correct answer is highlighted above.
3. You keep pasting the same stack description into every prompt. Where should it go?
Correct.Not quite — the correct answer is highlighted above.
Basic · Guided Scenario: Financial planning
Turn a money goal into an actionable plan

Problem statement: a colleague earns a fixed monthly salary and wants a realistic 12-month plan — build an emergency fund, clear a credit-card balance, and start investing toward a house deposit. A one-line ask ("help me budget") gets generic advice; a fully-specified prompt gets a month-by-month plan they can actually follow.

Objective: write a prompt that names the context (income, fixed costs, debts, goal + timeline), the task, the constraints (currency, risk tolerance, no products you can't buy locally), and the success criteria (a prioritised, numeric monthly allocation).

  • List the four parts for this scenario before you type a single prompt.
  • Run your prompt; check the output against your success criteria.
  • Note which missing part would most change the plan if you dropped it.
✓
Done when
The output is a specific, numeric monthly allocation — not generic "spend less, save more" advice.
✗
Watch out
Leaving out the timeline or the currency — the plan silently assumes both.

Discuss with your facilitator: which single constraint moved the answer the most — and why did the vague version get it wrong?

Intermediate · Semi-guided Scenario: Travel itinerary
Plan a trip that fits real constraints

Problem statement: plan a 5-day trip for two people with fixed dates, a total budget, dietary needs, and a mix of interests (history + food, low-intensity walking). A vague "plan me a trip to X" returns a tourist-brochure list; a well-scoped prompt returns a day-by-day plan that respects the budget and the pace.

Objective: start from a deliberately vague one-line ask, observe what Claude assumes, then refine it in at most three iterations — adding only the missing context or constraint each turn — until the itinerary is correct and realistic. Do not restart from scratch.

  • Prompt with a one-line vague ask; write down every assumption Claude made.
  • Each turn, add only the missing detail (budget, pace, diet, must-sees) — keep what worked.
  • Capture the final complete prompt so a teammate could reuse it for any city.
✓
Done when
The itinerary respects the budget and pace, and you can name what each edit fixed.
✗
Watch out
Rewriting the whole prompt each turn — the skill is incremental steering.

Discuss with your facilitator: at which iteration did the itinerary "click", and what was the minimal change that got it there?

Advanced · Open challenge Scenario: Deep research on a topic
Commission a rigorous, cited research briefing

Problem statement: you need a decision-grade briefing on a non-trivial topic (e.g. "should our team adopt tool X?") — balanced, current, and cited, not a confident summary of whatever the model half-remembers. The prompt must define scope, demand sources and a confidence signal, and specify the output shape so the result is verifiable.

Objective: design a single prompt (or a short prompt chain) that produces a structured briefing — framing question, key findings with citations, trade-offs, an explicit "what I'm unsure about", and a recommendation — with a format you can fact-check.

  • Define the scope and the exact output structure before prompting.
  • Require sources and an explicit confidence / uncertainty section.
  • Spot-check two claims against their citations; tighten the prompt where it over-claimed.
✓
Done when
The briefing is structured, cited, and flags its own uncertainty — and the citations check out.
✗
Watch out
Accepting confident prose with no sources — that is exactly the failure mode to design against.

Discuss with your facilitator: what in your prompt forced the model to expose uncertainty instead of hiding it? (Preview of competency 8, Team Workflow.)