Markdown Converter
Agent skill for markdown-converter
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Premium creator booking platform for Cabana Management Group with comprehensive 7-step verification pipeline for promotional appearances, brand representation, and companionship services.
Tech Stack: Next.js 15 (App Router) + TypeScript + Tailwind CSS 4 + shadcn/ui + Stripe + Supabase + Framer Motion
Requirements:
Status: ~75% Complete (Q1 2025 launch target)
Key Documentation:
CLAUDE.md (this file) - Architecture and development guideCONTRIBUTING.md - Contributor workflow and standardsAGENTS.md - Repository conventions and coding styledocs/TESTING.md - Playwright setup and testing guidedocs/DEMO_MODE.md - Partner demo mode setup and usagedocs/architecture-diagram.md - System architecturedocs/audit-history.md - October 2025 non-API hardening auditINTEGRATIONS.md - Vendor integration specificationspnpm install # Install dependencies ([email protected] required) pnpm run dev # Start dev server at localhost:3000 (with --turbopack) pnpm run build # Production build with Turbopack (required before release) pnpm run start # Serve production build locally pnpm run lint # ESLint validation (must pass before PR) pnpm run typecheck # TypeScript type checking pnpm run verify:fast # Quick check: typecheck + lint (runs on pre-commit) pnpm run build:full # Full check: typecheck + build pnpm run ci:verify # Complete CI simulation: verify:fast + build + unit tests
Pre-Commit Hooks: Husky automatically runs
pnpm run verify:fast before every commit, blocking commits with lint or type errors.
# Vitest Unit Tests pnpm run test # Run all unit tests pnpm run test:unit # Run unit tests (alias) pnpm run test -- --watch # Watch mode pnpm run test -- --ui # Browser UI pnpm run test -- src/components/auth/Login.test.tsx # Run specific test file # Playwright E2E Tests (requires .env.test.local + running dev server) pnpm run test:auth # Authentication flow tests pnpm run test:smoke # Generated smoke tests pnpm run test:e2e # All E2E tests pnpm run test:all # Run all Playwright tests pnpm run test:ui # Interactive debugging UI pnpm run test:functional # Run smoke tests and E2E tests together pnpm run verify:all # Route audit + smoke tests
# Migrations supabase login supabase link --project-ref dotfloiygvhsujlwzqgv supabase db push # Apply all migrations # Type Generation pnpm run db:types # Generate TypeScript types from schema pnpm run db:watch # Auto-regenerate on migration changes pnpm run db:verify # Verify connection and schema pnpm run db:diff # Check for schema drift
pnpm run analyze # Bundle size analysis pnpm run smoke # Generate smoke test specs from routes pnpm run seed:admin # Seed admin user pnpm run audit # Project audit script pnpm run audit:routes # Route discovery and scaffolding pnpm run audit:readiness # Production readiness audit pnpm run test:setup # Display Playwright test setup instructions
# Run locally in demo mode (no credentials required) NEXT_PUBLIC_DEMO_MODE=true pnpm dev # Access demo interface # Visit: http://localhost:3000/demo
Demo Mode Features:
docs/DEMO_MODE.md for full guidePublic Pages (
/, /learn, /vetting, /deposits)
7-Step Booking Flow (
/intake → /verify → /deposit → /screening → /interview → /contracts → /confirmation)
src/lib/store.ts)src/lib/schema.ts)Admin Portal (
/login, /dashboard/*, /admin/codes)
(dash)/dashboard with shared layout (src/app/(dash)/layout.tsx)
(dash) group provides auth middleware and shared dashboard layoutsrc/components/layout/DashboardNav.tsxADMIN_EMAILS env var + src/lib/isAdminEmail.tsAdditional Routes:
/login, /signup, /reset-password, /auth/callback/vip/[code], /invite/[code]/partner-demo → redirects to /demo/debug/session (dev only)/api/auth/logout - Logout endpoint (supports both GET and POST)src/lib/store.ts) - Global booking state across 7-step wizardsrc/lib/schema.ts) - Form validation schemas (consent, IDV, deposit)Core Tables (
supabase/migrations/0001_init.sql):
users - User profiles with verification_status, screening_statusbookings - Booking records with deposit_status, interview_status, nda_signedVIP System (
0003_vip.sql, 0004_vip_helpers.sql):
vip_codes - Public promotional codes with usage limits and expirationvip_redemptions - Code redemption trackingis_admin() functionInvitation System (
0005_invites.sql, 0006_invitations.sql):
invites - Internal admin-to-creator invitations with role-based accesssrc/lib/invites.ts/dashboard/inviteTwo Access Systems:
/vip/[code]) - Public promotional codes for external signups/invite/[code]) - Internal admin invitations for direct onboardingMultiple clients for different contexts:
src/lib/supabase.ts - Legacy browser clientsrc/lib/supabaseBrowser.ts - SSR-compatible browser clientsrc/lib/supabaseServer.ts - Server-side route handler clientsrc/lib/supabaseAdmin.ts - Service role admin clientsrc/lib/getSession.ts - Centralized session retrievalThe middleware layer (
src/middleware.ts) handles:
/api/* routes return mock responses when demo mode is activesrc/lib/securityHeaders.tsauth_test cookie for demo sessionsMatcher Pattern: Runs on all routes except
_next, favicon.ico, robots.txt
Production Routes:
/api/health, /api/db/health - Health checks/api/auth/logout - Logout endpoint (GET/POST)/api/users/create - User account creation/api/vip/* - VIP code management (create, list, redeem)/api/invites/* - Invitation management (create, list, accept, revoke, resend, validate)/api/stripe/create-deposit - Stripe PaymentIntent creation/api/test-login - Test login endpoint (development only)Stubbed Routes (need vendor SDK integration):
/api/identity/* - Onfido/Veriff IDV + webhook/api/screening/* - Checkr/Certn background checks + webhook/api/stripe/webhook - Stripe event processing/api/contracts/* - DocuSign envelope handling + webhook/api/interview/schedule - Calendly/Google Calendar bookingRoute Handler Pattern: Next.js 15 App Router conventions with async GET/POST handlers in
route.ts files. Use supabaseServer.ts for server-side access and supabaseAdmin.ts for service role operations.
Booking Flow:
Stepper.tsx - 7-step progress indicatorConsent.tsx - React Hook Form + Zod validationIdCapture.tsx - ID + selfie file uploadDepositForm.tsx - Stripe payment integrationStatusPanel.tsx - Polling-based status checker (replace with webhooks)VideoPick.tsx - Calendly iframe embedContractViewer.tsx - DocuSign redirect handlerUI Library (
src/components/ui):
GlassCard.tsx, HeroLockup.tsx, PageHero.tsx, ChromeList.tsx, CTA.tsx, LiquidButton.tsxbutton.tsx, card.tsx, dialog.tsx, input.tsx, label.tsx, separator.tsx, tabs.tsx, tooltip.tsxdropdown-menu.tsx - Radix UI primitiveAnimatedWrapper.tsx - Framer Motion wrapperHomeHeroAuth.tsx - Authenticated homepage heroLayout:
DashboardNav.tsx - Admin navigation with user menusrc/lib)Auth & Access:
isAdminEmail.ts - Admin email validationgetSession.ts - Centralized session retrievalisDemo.ts - Demo mode detection (pathname, query params, env var)Data:
store.ts - Zustand booking stateschema.ts - Zod validation schemasinvites.ts - Invitation helpersdemo-data.ts - In-memory demo data (talent, bookings, clients)demoMode.ts - Demo mode utilities and wrappersSupabase:
supabase.ts, supabaseBrowser.ts, supabaseServer.ts, supabaseAdmin.ts - Client patternssupabaseMock.ts - Demo mode mock (auto-loaded when NEXT_PUBLIC_DEMO_MODE=true)External Services:
stripe.ts - Stripe configurationcrypto.ts - Deterministic VIP code generationemail.ts - Email utilitieswebhooks.ts - Webhook helpersInfrastructure:
logger.ts - Production-safe logging (dev only)
import { logger } from '@/lib/logger'; logger.log('Debug:', data); logger.error('Error:', error);
securityHeaders.ts - CSP and security headersrateLimit.ts - Rate limiting utilitiesfonts.ts - Google Fonts (Manrope, Cinzel, Ballet, Inter)tailwind.config.ts)public/lovable-uploads/td-studios-black-marble.pngsrc/app/globals.css# Site URLs NEXT_PUBLIC_SITE_URL=http://localhost:3000 NEXT_PUBLIC_BASE_URL=http://localhost:3000 # Supabase (required for auth, database, VIP codes) NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbG... SUPABASE_SERVICE_ROLE_KEY=eyJhbG... # Admin Access (required for /admin/codes and admin routes) [email protected],[email protected] # Stripe (required for deposit flow) STRIPE_SECRET_KEY=sk_test_... STRIPE_WEBHOOK_SECRET=whsec_... NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
# Identity Verification ONFIDO_API_TOKEN= VERIFF_API_TOKEN= # Background Screening CHECKR_API_KEY= CERTN_API_KEY= # DocuSign DOCUSIGN_INTEGRATOR_KEY= DOCUSIGN_USER_ID= DOCUSIGN_ACCOUNT_ID= DOCUSIGN_PRIVATE_KEY= # Email POSTMARK_API_KEY= RESEND_API_KEY=
# Demo Mode (partner presentations, no credentials required) NEXT_PUBLIC_DEMO_MODE=true
Demo Mode Behavior:
/demo or with ?demo=1 query paramdocs/DEMO_MODE.md and VERCEL_DEMO_SETUP.md for deploymentThe
scripts/ directory contains various utility and deployment scripts:
production-readiness-audit.mjs - Comprehensive production readiness checkproject-audit.mjs - General project health auditaudit-and-scaffold.mjs - Route discovery and scaffoldingdb-verify.mjs - Database connection verificationseed-admin.mjs - Admin user seedingcreate-auth-user.mjs - Auth user creation helpercheck-and-reset-user.mjs - User state managementdeploy-production.sh - Production deployment scriptdeep-scan.sh - Deep codebase analysisadmin-setup.sql - Admin database setup queriesADMIN_EMAILS env var + is_admin() Postgres function. Must match exactly (no extra spaces).src/lib/crypto.ts + RPC function decrement_usesStatusPanel.tsx uses polling - replace with webhooks/SSE for productionpublic/fonts/ and update src/lib/fonts.ts.public/lovable-uploads/td-studios-black-marble.png must exist (no spaces in filename)noUncheckedIndexedAccess
noUncheckedIndexedAccess means all array/object access returns T | undefinedarray[0]?.propertytsconfig.json for full compiler optionsStepper.tsx, useBookingStore.ts), lowercase-hyphenated for routes@/ prefix for absolute importslogger utility instead of console statementsTest Directory Structure:
__tests__/ # Unit test directory ├── api/ # API route unit tests (e.g., logout.route.spec.ts) ├── components/ # Component unit tests └── pages/ # Page unit tests tests/ # Playwright E2E test directory ├── auth.spec.ts # Authentication flow tests ├── logout.spec.ts # Logout flow tests ├── invites.*.unit.spec.ts # Invitation system unit tests ├── smoke.generated.spec.ts # Auto-generated smoke tests └── global-setup.ts # Global test configuration
Test Requirements:
.env.test.local.example to .env.test.localADMIN_EMAILSAdding Tests:
__tests__/ directory mirroring source structure/tests directory*.test.tsx next to source files (alternative pattern)pnpm install (uses [email protected]).env.local.example to .env.localADMIN_EMAILSsupabase login && supabase link --project-ref dotfloiygvhsujlwzqgvsupabase db pushsupabase db query "alter database postgres set app.admin_emails = '[email protected]';"pnpm run db:typespnpm run dev/admin/codes to generate VIP codesOptional Testing Setup:
.env.test.local.example to .env.test.localpnpm run test:auth to verifyADMIN_EMAILS matches database setting exactlyhttp://localhost:3000 in Supabase allowed redirect URLsenvironment/page.tsx:461 and portfolio/page.tsx:301,324 - outside current scopeSee:
AGENTS.md (repo conventions), CONTRIBUTING.md (full workflow)
Quick Reference:
type: short summary (independently revertible)verify:fast automatically