Project / 2026
Molted
Habit app built as an RPG, with an AI coach.
- Role
- 81 of 156 commits are mine.
- Team
- Built with 3 teammates.
- Context
- Entry in the High School Innovation Challenge.
- Vite
- JavaScript
- Tailwind
- Supabase
- Clerk
- Edge Functions
- pgvector

01
Problem
Build a self-improvement and study coach for teenagers that adapts its plan from real behavior.
02
What I built
Game rules live in one pure module with tests. The coach agent can cite a source only if a tool returned it, and its proposals are validated before use. AI text is generated by the model or not shown.
03
Result
A habit tracker with momentum, levels, streaks, groups and a character that evolves, plus a weekly coach job that logs its actions and measures their effect. Live at molted.eu. 20 users in the first week.
04
In the code
Game rules are one pure module with its own tests.
apps/app/src/lib/engine.js
One codebase builds a web app with Supabase and a standalone page without it.
apps/app/src/lib/supabase.js
Row level security comes with a SQL check that runs in a rolled-back transaction.
supabase/tests/rls.sql
Coach sources are citable only if a tool returned them.
supabase/functions/_shared/agent-core.js
The weekly job uses deterministic rules and measures each action's effect.
supabase/functions/_shared/weekly-core.js
05
Size
- 156 commits
- 16 migrations
- 5 Edge Functions
- 25 habits on 5 paths, 10 levels