This file provides guidance to coding agents like Claude Code (claude.ai/code) and OpenCode when working with code in this repository.
Always commit and push changes after completing a task. Follow these rules:
- After making code changes, always commit with a descriptive message
- Push commits to the current feature branch
- NEVER push directly to
mainortestbranches - always use feature branches and PRs - Before pushing, verify the current branch is not
mainortest - Open PRs against the
testbranch, notmain - After pushing, check if a PR exists for the branch. If not, create one with
gh pr create --base test - After creating a PR, always wait for explicit user approval before merging. Never merge PRs autonomously.
When starting a new task, first sync the test branch with main:
git checkout test && git pull origin test && git fetch origin main && git merge origin/main && git push origin testThen checkout main, pull latest, and create your feature branch from there:
git checkout main && git pull origin main && git checkout -b <branch-name>The sync step is the only time you should push directly to test.
pnpm install # Install dependencies
pnpm dev # Dev server with Turbopack
pnpm build # Production build (uses webpack)
pnpm lint # Run linter
pnpm format # Run prettier + lint
pnpm update-types # Regenerate Supabase types- Next.js 16 with App Router, React 19
app/- Pages and API routescomponents/- React UI components (shadcn/ui + Radix primitives)hooks/- React hooks for data fetching and statelib/- Core business logic organized by domain:lib/ai/- AI/LLM integrationslib/chat/- Chat message handlinglib/supabase/- Database operationslib/tools/- AI tool definitionslib/browser/- Stagehand browser automationlib/stripe/- Payment processing
providers/- React context providerstypes/- TypeScript type definitions
- AI: Vercel AI SDK (
aipackage), Anthropic, OpenAI, Google Gemini - MCP: Tools provided by recoup-api MCP server (send_email, etc.)
- Database: Supabase (PostgreSQL)
- Auth: Privy
- Payments: Stripe
- Browser Automation: Stagehand (Playwright + AI)
- Styling: Tailwind CSS v4, shadcn/ui, Radix UI
- DRY: Extract shared logic into reusable utilities
- YAGNI: You Aren't Gonna Need It - don't build for hypothetical future needs; delete unused files/code that are not imported
- KISS: Keep It Simple, Stupid - prefer simple solutions over clever ones
- OCP: Open/Closed Principle - open for extension, closed for modification
- Single Responsibility: One function per file, clear naming
- No Production Logging: Remove console.log before merging
- File Organization: Domain-specific directories (e.g.,
/lib/fal/not/lib/utils/fal.ts) - Security First: Use battle-tested libraries (Streamdown, shadcn) over custom implementations
- Comments: Explain 'why', not 'what'; prefer self-documenting code
- Use
@radix-ui/react-*primitives withclass-variance-authority(CVA) - Use
cn()utility for class merging - Always include accessibility: semantic HTML, ARIA, keyboard navigation
Tools like send_email are now provided by the recoup-api MCP server, not defined locally. Tool chains in lib/chat/toolChains/ reference tool names that MCP provides.
Shared constants including:
RECOUP_FROM_EMAIL- Default email sender address- Platform-specific configurations