- DOX is a high-performance AGENTS.md hierarchy installed here.
- The agent must follow DOX instructions across any edits.
- AGENTS.md files are binding work contracts for their subtrees.
- Work products, source, instructions, records, assets, and durable docs must stay understandable from the nearest applicable AGENTS.md plus every parent AGENTS.md above it.
- Read the root AGENTS.md.
- Identify every file or folder you expect to touch.
- Walk from the repository root to each target path.
- Read every AGENTS.md found along each route.
- If a parent AGENTS.md lists a child AGENTS.md whose scope contains the path, read that child and continue from there.
- Use the nearest AGENTS.md as the local contract and parent docs for repo-wide rules.
- If docs conflict, the closer doc controls local work details, but no child doc may weaken DOX.
Do not rely on memory. Re-read the applicable DOX chain in the current session before editing.
Every meaningful change requires a DOX pass before the task is done. Update the closest owning AGENTS.md when a change affects:
- purpose, scope, ownership, or responsibilities
- durable structure, contracts, workflows, or operating rules
- required inputs, outputs, permissions, constraints, side effects, or artifacts
- user preferences about behavior, communication, process, organization, or quality
- AGENTS.md creation, deletion, move, rename, or index contents
Update parent docs when parent-level structure, ownership, workflow, or child index changes. Update child docs when parent changes alter local rules. Remove stale or contradictory text immediately.
- Root AGENTS.md is the DOX rail: project-wide instructions, global preferences, durable workflow rules, and the top-level Child DOX Index.
- Child AGENTS.md files own domain-specific instructions and their own Child DOX Index.
- Each parent explains what its direct children cover and what stays owned by the parent.
- The closer a doc is to the work, the more specific and practical it must be.
- Create a child AGENTS.md when a folder becomes a durable boundary with its own purpose, rules, responsibilities, workflow, materials, or quality standards.
- Work Guidance must reflect current project standards or user instructions; leave empty if none exist yet.
- Verification must reflect an existing check; leave empty until one exists.
Default section order: Purpose, Ownership, Local Contracts, Work Guidance, Verification, Child DOX Index.
- Keep docs concise, current, and operational.
- Document stable contracts, not diary entries.
- Put broad rules in parent docs and concrete details in child docs.
- Prefer direct bullets with explicit names.
- Do not duplicate rules across files unless each scope needs a local version.
- Delete stale notes instead of explaining history.
- Re-check changed paths against the DOX chain.
- Update nearest owning docs and any affected parents or children.
- Refresh every affected Child DOX Index.
- Remove stale or contradictory text.
- Run existing verification when relevant.
- Report any docs intentionally left unchanged and why.
SaaS for IB Diploma students. Next.js 16 App Router + Supabase (cloud) + Vercel AI Gateway, deployed on Vercel. Flagship live feature: TOK Exhibition helper. Also live: Notes, CAS. Stubs: Extended Essay (EE), TOK Essay.
Follow YAGNI principles, use one-liner solutions. do NOT end git commit messages with: Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com!! Important!!
- Next.js 16 (App Router, Turbopack). NOT 13/14/15 — breaking changes apply. Before writing framework code, consult
node_modules/next/dist/docs/and heed dev-server deprecation warnings.- Middleware is
proxy.tsat repo root; the exported function MUST be namedproxy(notmiddleware). Theruntimeconfig option is NOT available in proxy files. useSearchParams()must be wrapped in<Suspense>for static generation.
- Middleware is
- React Server Components by default;
"use client"only where interactivity requires it. - TypeScript strict.
@/*path alias maps to repo root (e.g.@/lib/supabase-server).
Brutalist Pastel theme. Tailwind only — no component libraries. No shadows (except the deliberate card-bump offset), no gradients, no blur, no pill shapes. Reuse the CSS-var tokens and @utility classes defined in app/globals.css — do not reinvent them. Full token + utility catalog lives in app/AGENTS.md. Font: system-ui stack, no Google Fonts.
npm run dev— dev server on :3000 (Turbopack)npm run build— production build (tsc + page generation)npm run start— serve production build- Typecheck only:
node node_modules/typescript/bin/tsc --noEmit - opencode.json:
opencode build(tsc+build),opencode check(tsc),opencode commit - Background dev:
nohup npm run dev > /tmp/dev.log 2>&1 &; kill withkill $(lsof -ti:3000)
- Vercel:
vercel <cmd>(global alias). Auto-deploys on push tomain. Projectvsht/ibspace. Env:vercel env add <KEY> production; pull:vc env pull .env.local --environment production. - Supabase CLI: not installed. Schema edits go through the Dashboard SQL Editor — see
supabase/AGENTS.md. - Supabase MCP:
supabase-mcp(opencode.json) — SQL, migration apply, TS type gen, table listing. NeedsSUPABASE_SERVICE_ROLE_KEY. - Supabase Management API: base
https://api.supabase.com/v1/projects/pjjupictmrlpxbvhcgxfwith PAT — auth provider config (Google OAuth, SMTP). - GitHub:
gh.
browser → proxy.ts (auth gate) → app/ route → Supabase / AI API
proxy.ts protects /dashboard/**, /profile/**, and /notes/** (redirects unauthenticated → /login) and redirects authenticated users away from /login. /auth/** is exempt.
| Variable | Purpose |
|---|---|
NEXT_PUBLIC_SUPABASE_URL / NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase client config |
SUPABASE_SERVICE_ROLE_KEY |
Server-only — account deletion, MCP. Never expose to client. |
VERCEL_OIDC_TOKEN |
AI Gateway auth. Pulled via vc env pull. Replaces any GEMINI_API_KEY. |
AI_GATEWAY_API_KEY |
Same value as VERCEL_OIDC_TOKEN (set locally) |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
Google OAuth direct flow (server-only) |
NEXT_PUBLIC_SITE_URL |
Canonical base URL for OAuth redirects |
PADDLE_API_KEY / PADDLE_WEBHOOK_SECRET / NEXT_PUBLIC_PADDLE_CLIENT_TOKEN / NEXT_PUBLIC_PADDLE_STUDENT_PRICE_ID |
Paddle payments (scaffold, not yet implemented) |
Vercel; GitHub push to main → auto build. Pre-deploy: npm run build must pass with zero TS errors; run pending Supabase migrations in the SQL Editor; verify /api/health returns {"status":"ok"}. Migration workflow in supabase/AGENTS.md.
TODO.md— pending-work backlog. Read before significant work; delete items when done.FEATURES.md— catalog of built features. Append when finishing significant features.PRODUCT.md,DESIGN.md,STYLE.md,NOTES-SPEC.md,README.md,HUMANS.md— product/design references.- graphify knowledge graph at
graphify-out/; rungraphify update .after code changes.
- Caveman mode: communicate with the user using
/caveman(full intensity); commits use/caveman-commitformat. Do not revert to normal mode unless the user says "stop caveman" / "normal mode". DOX docs themselves are written in clear operational English for precision.
app/AGENTS.md— Next.js App Router: routes, pages, route handlers, RSC/client rules, design-system token + utility catalog.components/AGENTS.md— shared cross-route UI components and their server/client split.lib/AGENTS.md— Supabase clients (server/browser), AI SDK wrapper, rate limiter, toast, prompts, cookie consent.supabase/AGENTS.md— database schema, RLS, and the manual SQL-Editor migration workflow.