> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weventures.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Expand AI - First Assignment

> Get started with your first project at Weventures

<Note>
  **Context**: Expand AI is fully deployed and planned; we're integrating backends and customizations.
  Stack: **Next.js + LangChain + Supabase (+ LangGraph as needed)**.
</Note>

## Access & Setup

<Steps>
  <Step title="Accept GitHub Invite">
    Check your email for the GitHub organization invite and accept it
  </Step>

  <Step title="Clone Repository">
    ```bash theme={null}
    git clone https://github.com/Weventures-AI/expand-ai.git
    cd expand-ai
    ```
  </Step>

  <Step title="Read Documentation">
    Review these three critical files:

    ```bash theme={null}
    cat README.md
    cat claude.md
    cat plan.md
    cat agents.md
    ```
  </Step>

  <Step title="Environment Setup">
    ```bash theme={null}
    # Create .env.local from template
    cp .env.example .env.local

    # Add your Supabase keys
    # Test DB connectivity
    ```
  </Step>

  <Step title="Install & Run">
    ```bash theme={null}
    pnpm i
    pnpm dev
    ```

    Confirm the app boots at `http://localhost:3000`
  </Step>
</Steps>

## Execution Loop

Your daily workflow for implementing features:

<Tabs>
  <Tab title="1. Planning">
    ### Open Claude Code

    ```bash theme={null}
    # Start Claude Code terminal
    claude
    ```

    ### Load Context

    Paste relevant excerpts from `plan.md` and current milestone requirements

    ### Request Implementation Plan

    ```text theme={null}
    Based on plan.md Phase 2, generate the scaffold
    for the user authentication flow with Supabase RLS
    ```
  </Tab>

  <Tab title="2. Implementation">
    ### Generate Code

    Ask CC to create:

    * Component structure
    * API routes
    * Database migrations
    * Test scaffolds

    ### Run Locally

    ```bash theme={null}
    pnpm dev
    ```

    ### Debug with AI

    Feed console errors/logs back to CC for fixes:

    ```text theme={null}
    Getting this error when submitting the form:
    [paste error]
    ```
  </Tab>

  <Tab title="3. Review">
    ### Codex Review

    Ask Codex to review your changes:

    ```text theme={null}
    Review this diff for security issues and suggest improvements:
    [paste git diff]
    ```

    ### Write Tests

    ```bash theme={null}
    # Unit tests
    pnpm test

    # E2E tests
    pnpm test:e2e
    ```

    ### Ensure CI Passes

    All checks must be green before PR
  </Tab>

  <Tab title="4. Ship">
    ### Commit Frequently

    ```bash theme={null}
    git add .
    git commit -m "feat: implement user auth with Supabase RLS"
    ```

    ### Open PR Early

    ```bash theme={null}
    git push -u origin feat/user-auth
    gh pr create
    ```

    ### Monitor Deployment

    Check Sentry and logs after merge
  </Tab>
</Tabs>

## Example Milestones

Your first sprint will likely include:

<Accordion title="M1: Auth & RLS Setup">
  * Confirm auth flow works end-to-end
  * Add missing Supabase RLS policies
  * Test multi-tenant data isolation
  * Document auth architecture
</Accordion>

<Accordion title="M2: First Agentic Workflow">
  * Implement LangChain tool calling
  * Add retry logic and fallbacks
  * Create workflow monitoring
  * Write integration tests
</Accordion>

<Accordion title="M3: Chat Endpoint">
  * Create Supabase Edge Function
  * Integrate with frontend components
  * Add streaming support
  * Implement rate limiting
</Accordion>

<Accordion title="M4: Telemetry">
  * Configure Sentry error tracking
  * Add OpenTelemetry traces
  * Create performance dashboards
  * Set up alerts
</Accordion>

<Accordion title="M5: Hardening">
  * Strengthen input validation with Zod
  * Improve error envelopes
  * Add rate limiting
  * Security audit
</Accordion>

## Definition of Done

<Checklist>
  <Check>Feature works locally and in preview environment</Check>
  <Check>Tests exist and pass</Check>
  <Check>CI/CD pipeline is green</Check>
  <Check>Sentry shows clean deploy</Check>
  <Check>Logs reviewed for errors</Check>
  <Check>Documentation updated (README/CHANGELOG/plan.md)</Check>
</Checklist>

## Common Commands

<CodeGroup>
  ```bash Development theme={null}
  # Start development server
  pnpm dev

  # Run tests
  pnpm test
  pnpm test:e2e

  # Lint and format
  pnpm lint
  pnpm format
  ```

  ```bash Database theme={null}
  # Run migrations
  pnpm db:migrate

  # Generate types
  pnpm db:generate

  # Seed database
  pnpm db:seed
  ```

  ```bash AI Development theme={null}
  # Test LangChain flows
  pnpm test:ai

  # Run agent locally
  pnpm agent:dev

  # Monitor traces
  pnpm traces
  ```
</CodeGroup>

## Getting Help

<CardGroup cols={2}>
  <Card title="Slack" icon="slack" href="https://weventures.slack.com">
    Join #expand-ai channel for quick questions
  </Card>

  <Card title="GitHub Issues" icon="github" href="https://github.com/Weventures-AI/expand-ai/issues">
    Report bugs or request features
  </Card>
</CardGroup>

<Tip>
  **Pro tip**: Keep `claude.md`, `plan.md`, and `agents.md` open in your editor while working. They're your north star for implementation decisions.
</Tip>
