- Start from the context block. Every new AI conversation starts with limited project memory unless you provide context.
- Replace placeholders such as [PASTE USER STORIES HERE]. Do not leave placeholders in the prompt.
- Copy prompts intentionally. You may adapt them, but preserve the four required parts: role/context, task, constraints, and output format.
- Treat every answer as a draft. The goal is not to accept the first response; the goal is to inspect, run, test, and refine.
- Keep each output. Requirements feed architecture; architecture feeds scaffolding; the run/test results feed refinement.
- Use the optional diagnostic prompts only when you hit the matching error. The core skill is the generic exact-error diagnostic prompt.
Key mindset AI proposes; you decide. The prompt is a specification, and the output is not correct until you have inspected and verified it.
P0 · P1 · P2 · P3 · P4 · P5
Foundation prompts from the lecture
These prompts help you practise the concepts taught before the hands-on workflow: stateless context, prompt anatomy, role prompting, few-shot prompting, constraint-based prompting, and targeted refinement.
P0 · Start a fresh conversation with a context block
At the beginning of any new chat, especially before requirements, architecture, or scaffolding work.
Weak versionRemember that I am building a task tracker.
Improved version · P0I am building a Task Tracker REST API using Python and FastAPI. The app supports create, view, update, and delete tasks. Each task has id, title, description, status (ToDo, InProgress, Done), priority (Low, Medium, High), and assignee. Module 1 scope excludes authentication, user accounts, multi-tenancy, real-time updates, mobile app, notifications, production database, and deployment. Use the AI interaction loop: ask, inspect, run, test, refine. Treat your output as a draft that I will review.
Why it is betterIt gives the assistant the project, stack, task scope, excluded features, and review mindset instead of assuming the tool remembers the project.
Then ask Before answering, list any assumptions you are making that might affect the result.
The mistake it avoidsAssuming the assistant remembers your project, previous corrections, or excluded features.
Context / stateless mental model · Prompt library p. 2
P1 · Compare first-contact tool outputs
When comparing ChatGPT and Claude at the start of the module. Submit the same prompt to both tools and compare the outputs.
Weak versionWhat tech stack should I use for my task tracker?
Improved version · P1I am building a simple Task Tracker REST API in Python and FastAPI. The API supports CRUD operations for tasks. Each task has id, title, description, status, priority, and assignee. List the five most important technical decisions I should make before writing any code. For each decision, explain why it matters and suggest a default choice for a small learning project. Constraints: - Do not assume authentication, Docker, cloud deployment, real-time updates, or a complex frontend. - Keep recommendations appropriate for Module 1, where the goal is a simple learning project. Output format: Return a table with columns: Decision, Why it matters, Suggested default, Assumption to verify.
Why it is betterIt turns an open-ended tool question into a scoped comparison task and makes hidden assumptions visible.
Then ask Which parts of your answer were assumptions rather than requirements from my prompt? List anything you added that I did not explicitly ask for.
The mistake it avoidsLetting the model quietly add a database, authentication, Docker, or a frontend framework before those choices are deliberate.
Tool comparison / assumptions check · Prompt library pp. 2-3
P2 · Rewrite a vague debugging prompt using the four-part anatomy
When you catch yourself writing vague prompts such as “fix this” or “make it better.”
Weak versionFix the bug in my task filtering code.
Improved version · P2You are a senior FastAPI developer helping me debug a task filtering issue. Context: I am building the Module 1 Task Tracker. The backend is Python/FastAPI. Tasks have status values ToDo, InProgress, and Done, and priority values Low, Medium, and High. Expected behavior: GET /tasks?status=Done should return only tasks whose status is Done. Observed behavior: [PASTE WHAT ACTUALLY HAPPENED] Relevant code: [PASTE THE ROUTE OR FILTERING FUNCTION HERE] Task: Identify the most likely cause and propose the smallest safe fix. Constraints: - Do not rewrite unrelated code. - Do not add new libraries. - Preserve the current API shape unless the bug requires a change. Output format: 1. Likely cause 2. Minimal code change 3. One test case I should run to verify the fix
Why it is betterIt defines role, context, expected behavior, observed behavior, constraints, and verification instead of asking for a generic fix.
Then ask The fix you suggested changes unrelated code. Please revise it so it only touches the filtering logic and explain why that smaller change is enough.
The mistake it avoidsUsing vague verbs such as fix or improve without explaining what correct behavior means.
Prompt as specification · Prompt library pp. 3-4
P3 · Review an API endpoint with a professional role
After AI generates an endpoint and before you copy it into your project.
Weak versionIs this endpoint okay?
Improved version · P3You are a senior FastAPI developer reviewing a REST API endpoint for production-aware behavior in a learning project. Context: This is for the Module 1 Task Tracker. Scope excludes authentication, user accounts, production deployment, and database implementation. Task: Review the endpoint below and identify issues only in these areas: - input validation - error handling - HTTP status codes - response schema - scope creep beyond Module 1 Constraints: - Do not rewrite the entire endpoint unless a rewrite is necessary. - Do not add authentication, logging systems, Docker, database code, or unrelated features. - Treat the output as a review checklist, not final code. Output format: Return a table with columns: Issue, Why it matters, Minimal fix, Verification step. Endpoint: [PASTE ENDPOINT CODE HERE]
Why it is betterA specific role and review lens make the AI inspect for the same failure modes discussed in the module: missing safeguards, shallow logic, and scope creep.
Then ask Now give me only the smallest code changes needed for the issues marked high priority. Keep the existing function name and route path.
The mistake it avoidsAccepting plausible-looking endpoint code without checking validation, status codes, or response shape.
Role prompting · Prompt library pp. 4-5
P4 · Generate a constrained Task Tracker validation function
To practise constraints and negative constraints on a small Task Tracker coding task.
Weak versionWrite a function to validate a task object.
Improved version · P4Write a Python function to validate a task object before saving it. Context: This is for the Module 1 Task Tracker learning project. Constraints: - Use only the Python standard library and Pydantic if a model is needed. - Do not add logging. - Do not add database code. - Return this shape: {"valid": bool, "errors": list[str]}. - Title must be non-empty after stripping whitespace. - Status must be exactly one of: ToDo, InProgress, Done. - Priority must be exactly one of: Low, Medium, High. Output format: Return only the function or model code in one code block. No explanation.
Why it is betterIt prevents extra dependencies, unwanted features, vague return shapes, and weak validation that accepts whitespace-only titles.
Then ask The function accepted a title that contains only spaces. Update only the title validation so whitespace-only titles return valid=false with the error "Title is required and cannot be blank".
The mistake it avoidsLetting the assistant invent interfaces, dependencies, or validation rules instead of specifying them.
Constraint-based prompting · Prompt library p. 5
P5 · Use a few-shot example for user stories
When the output needs to match a specific structure and quality bar.
Weak versionGenerate user stories for my task tracker.
Improved version · P5Generate user stories for the Module 1 Task Tracker in the same format and quality as this example. Example: Story: As a team member, I want to create a task so that I can track work. Acceptance Criteria: - Title is required; missing or blank title returns HTTP 422. - Description is optional. - A created task appears in the task list with status, priority, and assignee. Now generate five more stories in the same format. Constraints: - Use "team member" as the user role. - Do not mention login, authentication, user accounts, admin roles, notifications, mobile, or real-time updates. - Include at least one failure case across the generated stories. Output format: Return each story with Story and Acceptance Criteria headings.
Why it is betterThe example teaches both the format and the quality of acceptance criteria. The constraints keep the stories inside Module 1 scope.
Then ask Review the stories and mark any acceptance criterion that is not directly testable. Suggest a more specific replacement for each one.
The mistake it avoidsGetting user stories that look formatted but contain vague or untestable acceptance criteria.
Few-shot prompting · Prompt library pp. 5-6
A1 · A2 · A3 · A4 · B1 · B2 · B3 · C1 · C2 · C3 · D1
Hands-on prompt chain
These prompts mirror the actual Module 1 hands-on flow: requirements → architecture → scaffold. Each output becomes context for the next prompt: A1–A4 for requirements, B1–B3 for the architecture decision, C1–C3 for the skeleton, and D1 for the reflection log.
A1 · Generate reviewed Task Tracker user stories
At the start of the requirements activity, to create a first draft of 6–8 stories.
Weak versionBuild task tracker requirements.
Improved version · A1You are a product owner writing user stories for a small development team. Context: I am building a Task Tracker web application with a Python/FastAPI backend and a simple web frontend. Included features: - Create tasks with title, description, status (ToDo, InProgress, Done), priority (Low, Medium, High), and assignee. - View all tasks in a list. - Filter tasks by status and priority. - Update task details, including status. - Delete tasks. Explicitly out of scope: - authentication - user accounts - multi-tenancy or per-user task lists - real-time updates - mobile app - notifications - production database or deployment in Module 1 Target user: A solo developer or small team managing work in a single shared task list. Task: Generate 6-8 user stories in the format: As a [role], I want [feature] so that [benefit]. Constraints: - Use "team member" as the main role unless another role is clearly needed. - For each story, include 2-3 acceptance criteria that are specific and testable. - Cover happy paths and at least one failure case across the set. - Do not add features outside the scope above. Output format: Return a table with columns: ID, Story, Acceptance Criteria, Notes / Assumptions.
Why it is betterIt gives the assistant the project scope, exclusions, target user, story format, acceptance criteria expectations, and output shape.
Then ask Review your own stories. Flag any story or acceptance criterion that assumes login, user accounts, notifications, real-time behavior, or a production database.
The mistake it avoidsGenerating plausible requirements that quietly add out-of-scope features.
Hands-on Part A / Requirements · Prompt library pp. 6-7
A2 · Fix scope violations in requirements
After A1, if the draft mentions logged-in users, account ownership, admins, notifications, real-time updates, or other excluded features.
Weak versionFix Story 3.
Improved version · A2Review the user stories below against the Module 1 Task Tracker scope. Module 1 scope excludes authentication, user accounts, admin roles, multi-tenancy, per-user task lists, real-time updates, mobile app, notifications, production database, and deployment. Task: 1. Identify any story or acceptance criterion that violates the scope. 2. Rewrite only the affected story or criterion. 3. Preserve the original story format and acceptance criteria format. 4. Use "team member" instead of "logged-in user" unless a different in-scope role is necessary. Output format: Return a table with columns: Original issue, Why it violates scope, Revised version. User stories: [PASTE USER STORIES HERE]
Why it is betterIt turns a one-off correction into a repeatable scope-review prompt and teaches you to remove AI assumptions deliberately.
Then ask Now give me a one-sentence explanation of the most important scope assumption you corrected.
The mistake it avoidsCorrecting only one obvious phrase while leaving other out-of-scope assumptions in the story set.
Hands-on Part A / Scope control · Prompt library pp. 7-8
A3 · Add missing edge cases and status rules
After A1/A2, when the stories are in scope but still too happy-path or vague.
Weak versionAdd more edge cases.
Improved version · A3The user stories below are in scope, but they are missing important Task Tracker edge cases. Task: Add or revise acceptance criteria for these rules: - Title is required after trimming whitespace. - If title is empty or whitespace-only, return HTTP 422 with the detail message "Title is required and cannot be blank". - Status must be one of: ToDo, InProgress, Done. - Priority must be one of: Low, Medium, High. - A task with status Done cannot be moved back to ToDo or InProgress. Return HTTP 422 with a clear invalid-transition message. Constraints: - Do not add rules beyond the list above unless you label them as assumptions. - Do not add authentication, users, notifications, mobile, real-time updates, or database requirements. - Keep criteria specific enough that a developer could turn each into a test. Output format: Return only the revised acceptance criteria for the affected stories, not the entire story set. User stories: [PASTE USER STORIES HERE]
Why it is betterIt fixes the two exact kinds of gaps highlighted in the module: missing validation and shallow business logic.
Then ask For each revised criterion, tell me what kind of test would prove it works: valid input, invalid input, or invalid transition.
The mistake it avoidsAdding generic edge cases without encoding the actual Task Tracker rules taught in the module.
Hands-on Part A / Edge cases and business rules · Prompt library pp. 8-9
A4 · Review requirements for testability
Before moving from requirements to architecture. The goal is to make sure the stories can actually guide implementation.
Weak versionAre these stories good?
Improved version · A4You are a senior developer reviewing requirements before implementation. Context: This is the Module 1 Task Tracker. The requirements should support a simple FastAPI backend and simple web frontend. The app has no authentication, no user accounts, no multi-tenancy, no real-time updates, no mobile app, and no notifications. Task: Review the user stories below for testability and scope alignment. Check each story for: - Is the story in scope? - Are the acceptance criteria specific and testable? - Is there at least one meaningful edge case or failure case across the set? - Are any words too vague, such as "works", "properly", or "as expected"? - Did the AI assume a feature that was not requested? Constraints: - Do not generate a new story set. - Suggest minimal edits only. Output format: Return a table with columns: Story ID, Pass / Needs revision, Issue, Minimal edit. User stories: [PASTE USER STORIES HERE]
Why it is betterIt applies the inspect step to requirements instead of waiting until implementation fails.
Then ask Now summarize the final requirements in 5 bullets that I can paste into the architecture prompt.
The mistake it avoidsMoving from a nice-looking requirements draft into architecture before checking whether the criteria are buildable and testable.
Hands-on Part A / Inspect and refine · Prompt library p. 9
B1 · Generate two lightweight architecture proposals
After you have reviewed user stories. The output should be research material, not the final decision.
Weak versionWhat architecture should I use?
Improved version · B1You are a senior backend developer helping me evaluate lightweight architectures for a learning project. Context: I am building a Task Tracker application with a Python/FastAPI backend and a simple web frontend. Reviewed requirements: [PASTE 3-4 REPRESENTATIVE USER STORIES FROM PART A HERE] Constraints: - This is a learning project, not production software. - The backend must use Python, FastAPI, and Pydantic for validation. - I want a REST API backend and a separate simple web frontend. - Keep the tech stack simple, well-documented, and easy to run locally. - No authentication or multi-tenancy. - Do not suggest microservices, Docker, cloud deployment, or production database setup. Task: Propose two different lightweight architectures: - Option A should be the simplest local-storage approach appropriate for a first learning project. - Option B may use a lightweight local database approach if it improves realism without overcomplicating the project. For each option, provide: 1. Tech stack and data storage choice 2. Folder structure 3. Data model sketch with Pydantic fields and constraints 4. Three trade-offs compared to the other option Output format: Return Option A and Option B in clearly separated sections. Do not choose for me.
Why it is betterIt uses the two-proposal pattern from the module, constrains scope, and makes trade-offs visible instead of asking for a single hidden recommendation.
Then ask List any assumptions you made about storage, frontend, testing, deployment, or project size that were not explicit in my prompt.
The mistake it avoidsLetting AI choose an architecture without exposing alternatives or assumptions.
Hands-on Part B / Architecture option exploration · Prompt library p. 10
B2 · Compare architecture proposals using course criteria
After B1, to inspect the proposals before writing your own ADR.
Weak versionWhich option is better?
Improved version · B2Compare the two architecture proposals using the Module 1 criteria. Criteria: - Simplicity: learning curve and maintenance - Testability: ease of writing tests later with pytest and FastAPI TestClient - Local run/deploy ability: how easy it is to run locally with one or two commands - Familiarity: how common and understandable the tools are for an intermediate developer Task: Compare Option A and Option B honestly. Mention weaknesses, not just strengths. Constraints: - Do not introduce a third architecture. - Do not make the final decision for me. - Do not add out-of-scope features such as auth, Docker, cloud deployment, or microservices. Output format: Return a table with columns: Criterion, Option A, Option B, Question I should decide.
Why it is betterIt aligns the comparison with the module criteria and keeps the human responsible for the architecture decision.
Then ask Based on this comparison, what two assumptions should I explicitly accept or reject in my own ADR?
The mistake it avoidsAccepting the most polished proposal instead of evaluating trade-offs against the course criteria.
Hands-on Part B / Trade-off analysis · Prompt library pp. 10-11
B3 · Check your ADR without letting AI write it for you
After you write your one-paragraph ADR yourself. This is a review prompt, not a writing prompt.
Weak versionWrite my ADR for me.
Improved version · B3I wrote the ADR below myself. Review it for completeness, but do not rewrite it for me. Task: Check whether my ADR includes: - the chosen architecture and storage approach - why I chose it using simplicity, testability, local run/deploy ability, and familiarity - at least two AI assumptions I corrected or rejected - one or two risks I would address if the project grew Constraints: - Do not generate a replacement ADR. - Do not polish the prose for me. - Give only review feedback and minimal suggestions. Output format: Return a checklist with columns: Requirement, Present / Missing, Suggested minimal edit. My ADR: [PASTE YOUR ADR HERE]
Why it is betterIt preserves the course principle that AI proposes and the developer decides, while still using AI as a reviewer.
Then ask Ask me three questions that would help me strengthen my reasoning without writing the ADR for me.
The mistake it avoidsCopying an AI-written architecture decision instead of owning the decision in your own words.
Hands-on Part B / Human-owned ADR · Prompt library pp. 11-12
C1 · Scaffold the minimal FastAPI project skeleton
After your ADR is complete. The goal is a runnable skeleton with /health and /docs, not the full app.
Weak versionCreate a FastAPI task tracker project.
Improved version · C1You are a senior FastAPI developer helping me scaffold a minimal learning-project skeleton. Context: I am building the Module 1 Task Tracker REST API using Python and FastAPI. Architecture decision: [PASTE YOUR ADR FROM PART B HERE] Task: Generate a complete project skeleton that I can create locally. Required output: 1. Folder structure matching the architecture above. 2. app/main.py that creates a FastAPI application instance. 3. A GET /health endpoint that returns HTTP 200 and JSON in this shape: { "status": "ok", "timestamp": "<current ISO timestamp>" } 4. requirements.txt with the required dependencies for this skeleton, including FastAPI, Uvicorn, Pydantic, and python-dotenv if environment variables are loaded. 5. .env.example with PORT=8000 and APP_ENV=development. 6. .gitignore for a Python project, including __pycache__, .env, venv/, and .pytest_cache/. 7. README.md with project description, setup instructions, run command, curl test for /health, and how to open Swagger at /docs. Constraints: - Do not add CRUD endpoints yet. - Do not add authentication, user accounts, database implementation, Docker, cloud deployment, frontend files, notifications, or real-time updates. - All files must be complete and ready to copy. No placeholders such as "add code here". - If you use version pins in requirements.txt, state that I should verify them with pip freeze after installation. Output format: Step 1: exact terminal commands to create folders and files for Linux/macOS bash and Windows PowerShell. Step 2: for each file, say "Open [file path] and paste the following:" then provide the complete file content. Step 3: exact commands to create a virtual environment, install dependencies, and start the server. Step 4: curl command to test /health and the expected response shape. Step 5: browser URL for Swagger /docs.
Why it is betterIt keeps scaffolding aligned with Module 1: minimal, runnable, scoped, and verifiable.
Then ask Before I create these files, review your own output for scope creep, missing dependencies, inconsistent import paths, and any APIs that might not exist.
The mistake it avoidsLetting the assistant jump from skeleton to full CRUD app or add infrastructure that Module 1 does not teach yet.
Hands-on Part C / Project scaffolding · Prompt library pp. 12-13
C2 · Inspect the scaffold before running it
After C1 and before creating or running files. This prompt turns inspection into an explicit review task.
Weak versionDoes this project look right?
Improved version · C2You are a senior FastAPI developer reviewing an AI-generated project skeleton before I create and run it. Context: This is the Module 1 Task Tracker scaffold. The only endpoint should be GET /health. Swagger /docs should open through FastAPI. Task: Inspect the generated skeleton below for: - scope creep beyond Module 1 - missing dependencies in requirements.txt - inconsistent import paths - likely runtime errors - fake or hallucinated APIs - Pydantic version mismatch risks - whether /health returns the expected JSON shape and HTTP 200 - whether README commands match the folder structure Constraints: - Do not rewrite every file. - Suggest minimal fixes only. - Do not add CRUD, auth, database implementation, Docker, cloud deployment, or frontend files. Output format: Return a table with columns: Check, Pass / Concern, Why it matters, Minimal fix. Generated skeleton: [PASTE FILE TREE AND FILE CONTENTS HERE]
Why it is betterIt reinforces the module habit that inspection happens before copy-paste and before running code.
Then ask Give me a final "safe to create" checklist with no more than 8 items.
The mistake it avoidsSkipping directly from generated files to terminal commands without reading the output first.
Hands-on Part C / Inspect step · Prompt library pp. 13-14
C3 · Diagnose an exact run/test failure
After you run the scaffold and hit an actual error or unexpected response.
Weak versionIt does not work. What should I do?
Improved version · C3I am applying the Module 1 AI interaction loop to my FastAPI scaffold. Expected behavior: - The server starts with uvicorn. - GET /health returns HTTP 200 with JSON containing status="ok" and a timestamp. - /docs opens in the browser. Command I ran: [PASTE EXACT COMMAND] Exact error message or observed output: [PASTE EXACT TERMINAL OUTPUT OR HTTP RESPONSE] Relevant files: [PASTE THE RELEVANT FILES, SUCH AS app/main.py, health route, requirements.txt, OR FILE TREE] Task: Identify the most likely cause and the smallest safe fix. Constraints: - Do not rewrite unrelated files. - Do not add new features. - Do not add a dependency unless the error clearly requires it. - Keep the scaffold limited to /health. Output format: 1. Likely root cause 2. Minimal fix 3. Exact command to rerun 4. One verification check after the fix
Why it is betterIt gives the assistant the exact evidence it lacks: command, error, file tree, and relevant code.
Then ask Your fix still did not work. Here is the new exact error. Compare it with the previous error and tell me what changed before suggesting the next minimal fix.
The mistake it avoidsParaphrasing an error message or asking for random fixes without giving the AI the evidence needed to reason.
Hands-on Part C / Run, test, refine · Prompt library pp. 14-15
D1 · Draft the Module 1 reflection log from your notes
After the three hands-on activities. The prompt should organize your own observations, not invent them.
Weak versionWrite my reflection log.
Improved version · D1Use only the notes I provide below. Do not invent events, corrections, or assumptions. Task: Turn my notes into a concise Module 1 reflection log. For each activity - Requirements, Architecture, and Scaffold - write three bullets: 1. One thing AI got right 2. One thing I corrected 3. One assumption AI made that I identified Constraints: - Keep each bullet to one sentence. - If my notes do not include enough detail for a bullet, write "Missing - add your own note" instead of inventing. - Keep the language student-friendly and specific. My notes: [PASTE YOUR NOTES FROM THE THREE ACTIVITIES HERE]
Why it is betterIt supports the required reflection artifact while preserving the ownership principle: the reflection must be based on what you actually observed.
Then ask Make the reflection more specific, but still use only the facts in my notes.
The mistake it avoidsLetting the assistant fabricate a reflection that sounds plausible but does not represent the student’s actual workflow.
End-of-module deliverable / Reflection · Prompt library p. 15
E1 · E2 · E3
Optional extension — specific scaffold diagnostics
Useful if you hit the exact error type. They are not core Module 1 content; the core diagnostic habit is Prompt C3: provide the exact command, exact error, file tree, and relevant files.
E1 · Specific diagnostic: missing dependency
Only if your scaffold fails with a missing package error similar to ModuleNotFoundError: No module named dotenv.
Weak versionI got a missing dependency error. Fix it.
Improved version · E1I generated the Module 1 FastAPI scaffold and got this error when starting the server: [PASTE EXACT ModuleNotFoundError MESSAGE] Here is my requirements.txt: [PASTE requirements.txt] Here is the file that imports the missing package: [PASTE RELEVANT FILE] Command I ran: [PASTE EXACT COMMAND] Task: Explain what is missing and give the smallest fix. Constraints: - Do not rewrite unrelated files. - Do not add new app features. Output format: 1. Missing dependency 2. Minimal change to requirements.txt or imports 3. Install command to run 4. Command to rerun the server
Why it is betterIt keeps the useful old missing-dependency prompt but makes it evidence-based and reusable beyond one exact package name.
Then ask After I apply the fix, what command should I run to confirm the dependency is installed in the active virtual environment?
The mistake it avoidsEditing random files instead of checking whether the dependency is installed and imported consistently.
Optional extension / Debugging exact errors · Prompt library pp. 15-16
E2 · Specific diagnostic: import path or project root issue
Only if the server cannot import the app module or route module.
Weak versionPython cannot find app. What is wrong?
Improved version · E2I generated the Module 1 FastAPI scaffold and got this import error: [PASTE EXACT IMPORT ERROR] My folder structure is: [PASTE FILE TREE] I am running this command from this directory: [PASTE COMMAND AND CURRENT DIRECTORY] Relevant files: [PASTE app/main.py AND ANY ROUTE FILES] Task: Identify whether the problem is the working directory, module path, missing __init__.py file, or an incorrect import. Constraints: - Do not restructure the whole project unless necessary. - Keep the scaffold limited to /health. Output format: Return: root cause, minimal file/command change, and the corrected run command.
Why it is betterIt generalizes the old import-path prompt and teaches you to provide file tree, current directory, command, and imports.
Then ask Show me how to confirm I am running uvicorn from the correct project root.
The mistake it avoidsChanging import statements blindly without checking the command location and folder structure.
Optional extension / Debugging exact errors · Prompt library pp. 16-17
E3 · Specific diagnostic: Pydantic v1 versus v2 syntax risk
Only if a generated scaffold or validation snippet uses Pydantic syntax that fails in your installed version.
Weak versionFix my Pydantic error.
Improved version · E3I am working on the Module 1 FastAPI scaffold and got this Pydantic-related error: [PASTE EXACT ERROR] My installed Pydantic version is: [PASTE OUTPUT OF python -c "import pydantic; print(pydantic.__version__)" IF AVAILABLE] Relevant code: [PASTE THE MODEL OR ROUTE CODE] Task: Explain whether this is a Pydantic v1/v2 syntax issue and provide the smallest compatible fix. Constraints: - Do not change unrelated logic. - Do not add features beyond the Module 1 scaffold. - If you are unsure, tell me what command or documentation check I should perform. Output format: 1. Version issue or not? 2. Minimal code change 3. Verification command or test
Why it is betterIt keeps a useful diagnostic as an optional extension because the exact v1/v2 issue is not the central Module 1 learning objective.
Then ask Explain the change in one paragraph using beginner-friendly language, but keep the code fix minimal.
The mistake it avoidsAssuming all Pydantic examples online match the version installed in the student’s environment.
Optional extension / Debugging exact errors · Prompt library pp. 17-18
End-of-module checklist
The library closes with what you should have produced and saved before moving on.
| Deliverable | What to check |
|---|---|
| Reviewed user stories | 6–8 stories with specific acceptance criteria; at least one scope correction and one edge case correction. |
| Architecture Decision Record | One paragraph in your own words, explaining the chosen architecture and assumptions corrected. |
| Running skeleton | FastAPI starts; GET /health returns HTTP 200 JSON; Swagger /docs opens. |
| Reflection log | For Requirements, Architecture, and Scaffold: one thing AI got right, one correction, and one AI assumption. |
Read with careThe library supports these artifacts, but you own the final result.