Skip to content

xernst/promptdojo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

723 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

promptdojo

Codecademy teaches Python like it's 1995. Boot.dev gamifies the same curriculum. Both assume you want to be a software engineer.

promptdojo is the school for people who use Cursor every day and need to know what it got wrong.

Status: building in public. Follow @joshernst for daily progress.

This repo now ships in two halves of the same product:

  1. The interactive web app - a 48-chapter route map with a core/applied builder path and an AI/ML engineering buildout, running in a Pyodide-in-the-browser, Codecademy-style step-by-step course at localhost:3000. Source lives at the root of this repo (Next.js, React 19, Tailwind 4, CodeMirror 6, Cloudflare Pages Functions). This is the primary product surface.
  2. The 17-chapter book of foundations - a long-form, Codecademy-rhythm Python primer as plain folders (01-getting-started/ through 17-inheritance-and-dunders/) covering the language-fluency floor. Currently the foundations only; the AI-builder chapters (LLM APIs, MCP, agents, evals, capstone, harness engineering) live in the web app.

Both share the same curriculum spine and the same point of view. Pick whichever surface you prefer; the wedge is identical.


What this is

An open-source Python school for the AI-builder era. The curriculum inverts around the workflow you actually use: read code AI wrote, predict what it does, fix what it got wrong, write only what AI fluently can't.

The core course runs in your browser via Pyodide; the book is just folders of markdown and Python. Optional product surfaces use Cloudflare Pages Functions: magic-link sign-in for cloud sync, Beehiiv signup and RevenueCat entitlements.

Why this exists

Most "learn Python" platforms were designed for people becoming software engineers — data structures, algorithms, leetcode prep.

The audience here is different: a 29-year-old PM who uses Cursor every day, ships AI features, and wants to actually understand the 200 lines Claude just wrote. A 38-year-old marketing manager who wants to build internal AI tools at work. An indie founder who vibe-coded a SaaS and is now drowning in technical debt they can't read.

We skip what AI handles fluently. We double down on what AI gets wrong: hallucinated APIs, silent type bugs, off-by-one errors, traceback reading, environment setup, mutable default arguments, missing awaits, stale stdlib usage. We teach the mental models you need to direct AI, not replace it.


Two ways to use this repo

A. The interactive web app (recommended)

pnpm install
pnpm dev

Open http://localhost:3000. Five-question onboarding, then your first lesson. Every Python step runs live in your browser via Pyodide. Built on Next.js 16 + Pyodide-in-Web-Worker + CodeMirror 6 + localStorage, with Cloudflare Pages Functions for auth, sync, subscriptions, and entitlements.

The web curriculum lives in content/python/ as YAML+Markdown — one folder per lesson, one file per step. Schema is documented in lib/content/schema.ts.

B. The 17-chapter book

If you'd rather read the foundations chapters in your editor like a textbook, the 17 chapter folders are at the repo root (01-getting-started/ through 17-inheritance-and-dunders/):

NN-topic/
├── README.md          — the lesson narrative (read it first)
├── 01_lesson.py       — annotated runnable examples
├── exercise_1.py … exercise_5.py
├── solutions/         — peek only after trying
└── CHECKPOINT.md      — self-quiz

Run a file with the ▶ button in VS Code, or in a terminal:

brew install python@3.12 uv
python3 01-getting-started/01_lesson.py

Some later chapters require extra libraries (httpx, rich, pytest). Each chapter's README tells you what to install when you get there.

The web app is now the broader of the two surfaces: a 48-chapter route map covering variables through terminal, git, AI harnesses, LLM APIs, MCP, agent loops, evals, retrieval, team skills, and an AI/ML engineering buildout. Chapters 00-34 are the stronger core and applied builder path; chapters 35-47 are advanced buildout. The 17-chapter book is currently the foundations layer (variables through OOP) in long-form textbook style; the AI-builder material lives in the web app. Everything in the web app's content/python/ is the canonical source for the interactive surface; the root chapter folders are the long-form companion for the language-fluency floor.

Customize it — this is the magic

The course becomes genuinely great when you swap the stock examples for things from your actual life. 10 minutes of customization turns "another Python tutorial" into "a course about me that happens to teach Python." Drop the repo into Cursor / Cowork / Claude Code, paste in a "Running Cast" of your pets/team/project/dataset, and ask the AI to rewrite the examples while keeping every concept and exercise the same. See the legacy openclaw README for the full template.

Philosophy: "vibe coding" doesn't mean skip the fundamentals

You're going to use AI to help you code. Great. But the AI will confidently hand you wrong code, especially about:

  • Off-by-one errors in slicing
  • Mutable default arguments (def f(x=[]))
  • Missing await in async code
  • Using stale APIs (os.path instead of pathlib, urllib instead of httpx, % instead of f-strings)
  • Silently swallowing exceptions (except: pass)
  • Forgetting type hints or returning the wrong type

This course makes you the person who catches those. The goal isn't memorizing syntax — it's developing the judgment to read, evaluate, and edit what the AI gives back.

Chapter map (the 17-chapter book of foundations)

This is the long-form textbook companion — currently the language-fluency floor only (variables → OOP). The AI-builder material (LLM APIs, MCP, agents, evals, harness engineering) is in the web app, not the book.

# Chapter You'll be able to
01 Getting Started Run Python, use the REPL, print and comment, read tracebacks
02 Variables & Types Store data; know int, float, str, bool, None
03 Strings Format with f-strings; slice, split, join, transform text
04 Numbers & Math Do arithmetic; use math; know float imprecision and Decimal
05 Input & Conversion Take user input; cast types safely; understand truthiness
06 Control Flow Branch with if/elif/else; pattern-match with match/case
07 Loops Iterate with for, while, range, enumerate, zip, comprehensions
08 Lists Mutability, sorting, slicing, the aliasing trap
09 Tuples & Sets Immutability; set algebra; when to use each
10 Dictionaries Keys, values, items, merging, counting, grouping
11 Functions Define, call, return, defaults, docstrings, guard clauses
12 Scope, *args, Lambdas LEGB, closures, unpacking at call sites
13 Modules & Packages import, __init__.py, __main__ guard
14 Files & pathlib Modern file I/O, JSON, CSV, walking a tree
15 Error Handling try/except, custom exceptions, EAFP style
16 Classes & OOP Objects, __init__, instance vs class attrs, @property
17 Inheritance & Dunders super(), __repr__, __eq__, container protocol

Web app curriculum (48 chapter route map; 00-34 core table)

The route map currently includes 48 chapters and 1449 runnable steps. The table below is the 00-34 core and applied builder path snapshot; chapters 35-47 are the AI/ML engineering buildout.

# Chapter Lessons Steps
00 before you build — what an llm is and where you fit 4 34
01 variables — what ai reaches for first 3 26
02 functions - and the missing-return bug ai ships 3 27
03 lists and dicts — the bones of every api 3 27
04 loops — predict the output 3 28
05 conditionals — where ai silently bugs 2 17
06 tracebacks — cursor wrote this and crashed 3 26
07 mutation — why your code mysteriously breaks 2 17
08 modules, imports, and why your venv hates you 2 17
09 error handling — when ai's code crashes mid-flight 3 27
10 files and i/o — moving data in and out 3 27
11 classes — reading what ai just wrote you 3 27
12 http and apis — making the call 3 27
13 llm apis — talking to claude and openai 3 26
14 structured output — making the model return json 2 17
15 mcp — the model context protocol 3 26
16 agent loops — tool_use and the request/tool/respond cycle 6 47
17 git and github cli — the ai builder's actual workflow 2 17
18 secrets — .env, api keys, and what not to commit 1 9
19 prompting cursor and claude code effectively 4 35
20 reading agent traces and telemetry 2 18
21 eval-driven ai development 3 26
22 context and retrieval — feeding the model real data 4 36
23 production tradeoffs — cost, latency, quality 3 26
24 debugging broken ai output 3 27
25 capstone — ship the system 6 55
26 agent harnesses — the layer between you and the raw api 3 27
27 ai image generation — from prompt to production asset 3 24
28 ai video generation — sora, veo, higgsfield, and the second wave 3 23
29 programmatic design — code-driven video and the new design pipeline 3 24
30 harness engineering — the discipline behind the model 5 45
31 intro to terminal, the text way to drive your computer 3 23
32 intro to claude cli, the door to real building 3 23
33 intro to openai codex cli, a second tool in the kit 3 23
34 claude skills for teams, your playbooks as ai your whole team shares 4 28

Chapters 13–34 are the AI-first-builder wedge — the part of the course no old-school Python curriculum covers. Lessons average 8–10 typed steps in the canonical sequence: read -> mc -> read -> predict -> fill -> fix -> fix -> write -> checkpoint (lesson length varies by topic).

Stack

Web: Next.js 16 · React 19 · Tailwind 4 · Pyodide-in-Web-Worker · CodeMirror 6 · localStorage · Cloudflare Pages Functions. Book: Python 3.12+ · uv for envs · httpx, pytest, anthropic, pandas for the later chapters.

Contributing

This is in active build. If you've used AI to write Python and gotten burned by something specific — hallucinated API, silent type bug, environment-setup hell — open an issue with the example. That's the curriculum.

For the book chapters: typo / unclear / dead link → PR. New chapter or structural change → issue first.

The core invariants I'm protecting:

  • 17 chapters in the book (foundations only); 48-chapter route map in the web app, with chapters 00-34 as the core/applied builder path and chapters 35-47 as advanced AI/ML buildout.
  • Each book chapter: narrative lesson → lesson file → 5 exercises → 5 solutions → checkpoint.
  • Each web lesson: 8–10 typed steps, ~5–8 minutes, ending in a checkpoint.
  • Modern Python (3.12+), type hints, pathlib, httpx, f-strings.
  • Vibe-Coding Corner in every book chapter.

License

MIT. Do whatever you want with it. If you customize and share, tag me — I'd love to see where it goes.

Author

Built by Josh Ernst. If this saved you time, a ⭐ means a lot. More on AI, Python, and vibe-coding in 2026 on Twitter: @joshernst.

About

free, open-source school for builders in the ai era. start before code, build useful helpers, then grow into AI/ML engineering. 48 chapters, 1,471 runnable steps, runs in your browser.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors