Practice Exercises

Practice Exercises

Hands-on exercises that build on each other. Start with beginner, progress through intermediate, and challenge yourself with advanced. Each exercise references the module where the concept was taught.


Planning & Setup

Exercise 1
beginnerModule 2
Write a Brainlift
Your task
Pick a real project idea you have. Write a Brainlift document with at least 3 contrarian insights, 2 domain knowledge points, and 2 hard-won lessons.
Exercise 2
beginnerModule 3
Write a .cursorrules File
Your task
Create a .cursorrules file for a Next.js + Prisma + PostgreSQL project. Include at least 3 security rules, 3 code quality rules, and 2 cost control rules.

Prompting

Exercise 3
beginnerModule 5
Rewrite a Bad Prompt
Your task
This prompt is bad: "Add authentication to my app." Rewrite it using the context sandwich formula: [what exists] + [what you want] + [constraints].
Exercise 4
intermediateModule 5
Apply the Constraint Frame
Your task
You need AI to add a date picker to a form. Write a prompt that prevents the three most common AI mistakes: adding unnecessary dependencies, over-engineering, and putting files in the wrong place.

Debugging

Exercise 5
intermediateModule 6
Write an Oneshot Restart Prompt
Your task
Your first attempt at a Stripe checkout function failed with: "Error: Invalid price ID." The items array has priceId: undefined. Write the oneshot restart prompt.
Exercise 6
intermediateModule 7
Apply the Research-Logs-Tests Cycle
Your task
You need to add WebSocket support to a Next.js app. Write three prompts -- one for Research, one for Logs, one for Tests -- that form a complete debugging cycle.

Security & Review

Exercise 7
advancedModule 10
Two-Pass Security Review
Your task
Review this code for security vulnerabilities using the two-pass method. Pass 1: does it work? Pass 2: can it be exploited? Code: app.get("/api/user", (req, res) => { const id = req.query.id; const user = await db.query("SELECT * FROM users WHERE id = " + id); res.json(user); })
Exercise 8
advancedModule 10
Write a Cost Control Guard
Your task
You have a Firebase Cloud Function that sends an email via SendGrid whenever a new user signs up. Write the function with all three cost control rules applied: show the math, limit everything, prevent loops.