Companion sample app for the AI Failure Modes Cursor Examples exercise. Each of the five failure modes from the deck has a pre-staged target somewhere in this repo. Open it in Cursor, run the bad prompt, watch it fail, then run the fix.
npm install
npm run devBrowse to http://localhost:5173. Three pages: Dashboard, Orders, Users.
Vite + React 18 (plain JavaScript) + react-router. Frontend only — mock data, no backend, no database. Keeps the demo fast.
These omissions make the failure modes land. Do not add them before the workshop.
- No
AGENTS.md/CLAUDE.md— Cursor has zero project context. - No glossary or
docs/ubiquitous-language.md. - No tests, no test runner.
- No spec for any feature.
- Pricing logic is split across three files on purpose.
Target: src/pages/UsersPage.jsx, src/components/UserCard.jsx
Bad prompt: "Add a way for users to upload a profile picture."
Cursor will pick storage, image size, format, upload UI, and DB schema for
you, all without asking. Then run the Grill Me prompt from the exercises
doc.
Target: src/data/orders.js, src/services/cart.js
Bad prompt: "Add a way to refund a transaction."
This codebase calls it a credit, not a refund, void, or reversal.
Cursor will invent its own term. After it does, ask Cursor to scan for
domain terms and write docs/ubiquitous-language.md, then re-run.
Target: src/utils/dateRange.js (stub — throws "Not implemented")
Bad prompt: "Implement a function that returns true if two date ranges
overlap, and false otherwise."
Cursor will write 30+ lines confidently and miss at least one edge case.
Drive the fix with the TDD prompt from the exercises doc.
Target: src/services/cart.js, src/helpers/discount.js,
src/utils/calc.js
Bad prompt: "Add a 10% loyalty discount that stacks with existing
promotional discounts but caps the total discount at 30%."
Watch Cursor edit three files. Then run the refactor prompt to consolidate
into a deep src/pricing/ module with one public function.
Target: src/pages/DashboardPage.jsx (the disabled "Export CSV" button)
Bad prompt: "Add a CSV export feature to the orders dashboard. Users can
pick columns, the export runs in the background, and the result is emailed
to them."
Cursor will dump ~600 lines across many files. Re-run with the
interface-first prompt — review only the public surface.
- No
AGENTS.md(mode 1 ready) - No glossary file (mode 2 ready)
-
dateRangesOverlapis an unimplemented stub, no tests (mode 3 ready) - Pricing split across
utils/,helpers/,services/(mode 4 ready) - Disabled CSV export button on dashboard (mode 5 ready)
- Test each demo end-to-end the night before. Don't improvise on stage.
git stash # before demo: stash any prior demo edits
git checkout . # nuclear reset to staged state