Make this project's code readable with VibeTools CODE. The app must work exactly the same afterwards.
1. In the project root run: npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code scan
   It parses every JS/TS file (a real parser, not search-and-replace) and writes .vibe/code/scan.json: every function with its file:line, what it calls, what calls it, network calls, storage, DOM events, plus a health score and the problems it found (cryptic names, god files, long functions, duplicated code, dead exports).
2. Run: npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code plan
   It writes CODE-PLAN.md: renames, moves and extracts, each with its risk and the call sites it touches. Safe items are checked, medium and risky ones are not.
3. Read .vibe/code/scan.json and the function bodies, then improve CODE-PLAN.md by editing it:
   - For every rename, fill in or fix the new name from what the function really does: verbs for actions (startFaceScan, saveProfile), nouns for data, is/has/can for true/false values, on<Event> for event handlers, PascalCase for React components. Replace every "?" with a name.
   - Put a one-line "does:" under each rename that says what it does, in plain English.
   - Propose a feature-first layout with move lines (src/features/<feature>/, src/shared/, src/lib/), following the framework's own conventions where it has them (Next.js app/, pages/).
   - Keep the line format exactly: "- [x] R1 · rename · `src/app.js#oldName` → `newName`", "- [x] M1 · move · `src/old.js` → `src/features/x/new.js`", "- [ ] E1 · extract · `src/app.js#fnName` → `src/features/x/fnName.js`".
   - Never rename anything in node_modules, public URLs, API routes or names other code outside this project uses.
4. Show me the plan as a short list (old name → new name, file moves) and ask me to confirm. Safe items stay checked; ask before checking medium or risky ones.
5. When I say yes, run: npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code apply --only safe --yes
   (or npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code apply --yes for everything checked; --yes because I already said yes to the plan). Commit or stash any of my uncommitted work first, with my OK. It runs the build and tests before anything changes (and writes a small smoke test first if there are none), then makes one change at a time, runs them again after each one, and commits each step on its own. A step that breaks anything is put back automatically and reported. Do not edit the files by hand while it runs.
6. Write .vibe/code/purposes.json: { "<file>#<function>": "one plain-English line of what it does" } for the main functions, then run: npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code map
   It writes CODEMAP.md (features → files → functions with file:line, and "Where do I fix…?"), docs/CALLS.md (every public function, endpoint and event) and CODE-RULES.md, and adds a short rules block to CLAUDE.md / AGENTS.md / .cursorrules (added at the end, never overwritten).
7. Tell me: the score before and after, what changed (one line per step), anything that was put back and why, and where to look in CODEMAP.md. Undo any step with npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code undo <step> or everything with npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code undo all.
From now on, before you edit code here, read CODEMAP.md and CODE-RULES.md, and after a change run npx -y https://getvibetools.com/dl/vibe-tools-0.15.0.tgz code check.
JavaScript and TypeScript only for now (JSX/TSX, React, Next.js, Vite, Node). Python is on the roadmap.

---
Source: https://getvibetools.com/code/prompt.md · Product page: https://getvibetools.com/tools/code.html
