Files
Momento/CLAUDE.md
Antigravity bd495be965
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 12s
feat: design system overhaul — sidebar, AI chats, settings, brainstorm, color cleanup
- Sidebar: dynamic brand-accent colors, brainstorm section restyled
- AI chat general: popup panel with expand/collapse, hides when contextual AI open
- AI chat contextual: tabs reordered (Actions first), X close button, height fix
- Settings: all tabs restyled, 6 new color presets (sage, terracotta, iron, etc.)
- Global color cleanup: emerald/orange hardcoded → brand-accent dynamic
- Brainstorm page: orange → brand-accent throughout
- PageEntry animation component added to key pages
- Floating AI button: bg-brand-accent instead of hardcoded black
- i18n: all 15 locales updated with new AI/billing keys
- Billing: freemium quota tracking, BYOK, stripe subscription scaffolding
- Admin: integrated into new design
- AGENTS.md + CLAUDE.md project rules added
2026-05-16 12:59:30 +00:00

38 lines
1.7 KiB
Markdown

# Momento Project Rules
## CRITICAL — DATABASE SAFETY
**NEVER RUN `prisma migrate reset` ON ANY DATABASE CONTAINING DATA.**
**NEVER RUN ANY COMMAND THAT DROPS, RESETS, OR TRUNCATES A DATABASE WITHOUT EXPLICIT USER CONFIRMATION AND A VERIFIED BACKUP.**
Forbidden commands (ALWAYS ask first, ALWAYS verify backup exists):
- `prisma migrate reset`
- `prisma db push --accept-data-loss`
- `DROP DATABASE`
- `DROP TABLE`
- `TRUNCATE`
- `pg_dump` with `--clean`
- `docker exec ... rm -rf` on database volumes
- Any command with `--force` that modifies database state
### What happened (2026-05-14):
Ran `prisma migrate reset --force` on a live database with real user data to fix migration issues. Lost all notes, notebooks, and user data. The correct fix was `prisma migrate resolve --applied` for broken migrations + `prisma migrate deploy`. ALWAYS prefer non-destructive fixes first.
### Correct approach for migration issues:
1. `prisma migrate resolve --applied <broken_migration>` for already-applied but untracked migrations
2. `prisma migrate deploy` to apply remaining migrations
3. `prisma db push` as last resort (non-destructive, additive only)
4. If destructive action is truly needed: ASK USER FIRST, verify backup, then proceed
### Backup before any schema change:
```bash
docker exec memento-postgres pg_dump -U memento memento | gzip > /tmp/memento_backup_$(date +%Y%m%d_%H%M%S).sql.gz
```
## Project Context
- **Stack:** Next.js App Router, Prisma, PostgreSQL (Docker), Redis (Docker), ioredis
- **Database:** PostgreSQL on `localhost:5433` (Docker container `memento-postgres`)
- **Redis:** `localhost:6379` (Docker container `memento-redis`)
- **App:** `memento-note/` directory