Lesson 03 Prompt Engineering Fundamentals
Theme:

Homework

Three tasks to cement prompt engineering skills — to be completed before Lesson 04.

Submission: Add your work to a new notebook called homework03.pdf in this lesson folder, or document your results in a markdown cell within lab.pdf. Be ready to discuss one finding during the next class.

📥 Reference Solution

⬇ lab_answer.pdf

Task 1 — RTCF Prompts for Real Work

What to do

Identify 3 tasks you actually do at work (or in a project). For each task, write a complete RTCF prompt and run it against Claude. Document the results.

Requirements

Example structure

Task: Weekly status report draft

Role: You are a senior project manager writing for a non-technical executive audience.
Task: Draft a 3-bullet weekly status update for the mobile app project.
Context: This week: completed login flow, started payment integration,
         blocked on third-party API credentials. Team size: 4 engineers.
Format: 3 bullets max. Each bullet: one sentence. Lead with status emoji
        (green/yellow/red). Formal tone. No jargon.

Self-check: Can you identify all 4 RTCF components in each of your prompts? Does each prompt have at least one Format constraint?

Task 2 — Inconsistent Prompt Diagnosis

What to do

Find a prompt (from your work, a past project, or online) that produces inconsistent or unpredictable results across multiple runs. Diagnose the root cause using the failure mode taxonomy from the theory notes, then rewrite it to be more reliable.

Requirements

Self-check: Your 100-word analysis should name a specific failure mode from the theory notes, not just say "it was vague."

Task 3 — Force JSON Without JSON Mode

What to do

Claude has a JSON mode (available via API), but in this task you are not allowed to use it. Instead, instruct Claude to return valid JSON using only natural language instructions in your prompt. Test reliability across 5 runs.

The task

Write a prompt that extracts the following fields from a job description (provide your own job description — copy any posting from LinkedIn or a company website):

{
  "job_title": "string",
  "company": "string",
  "location": "string",
  "salary": "string or null",
  "required_skills": ["list", "of", "strings"],
  "remote": true or false
}

Requirements

Hints

Self-check: Run json.loads(output) in Python after each call. 5/5 successful parses = success. If you're getting 4/5 or less, revise the prompt and document what changed.

Grading Criteria

TaskPointsKey Criterion
Task 1 — RTCF prompts30All 4 RTCF components present; real-world relevance
Task 2 — Diagnosis40Failure mode correctly identified; 100-word analysis is specific
Task 3 — JSON forcing305/5 parses succeed; prompt uses only natural language