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

# Contributing

> Clone the firstflow-oss monorepo, then build and test the packages.

FirstFlow is a pnpm + Turbo monorepo. This page gets you from a clone to a green build.

## Layout

```
firstflow-oss/
├── packages/
│   ├── config-schema/      Types + Zod + Supabase migrations + SCHEMA.md
│   ├── sdk-frontend/        @firstflow/runtime React widget, blocks, persistence
│   └── sdk-backend/         @firstflow/runtime-server wrap, classifyIntent, aiclient
└── skills/                  AI authoring skill
```

## Set up

<Steps>
  <Step title="Clone and install">
    ```bash theme={null}
    git clone https://github.com/firstflowdev/firstflow-oss
    cd firstflow-oss
    pnpm install
    ```

    Requires **Node 18+** and **pnpm 9**.
  </Step>

  <Step title="Build, typecheck, and test">
    Turbo runs each task across the packages in dependency order.

    ```bash theme={null}
    pnpm build       # build config-schema → runtime/runtime-server
    pnpm typecheck
    pnpm test        # Vitest across all packages
    ```

    `@firstflow/config-schema` builds first because the SDK packages depend on its
    types; its build also regenerates the JSON schema.
  </Step>

  <Step title="Work on a single package">
    Filter to one package while iterating:

    ```bash theme={null}
    pnpm --filter @firstflow/runtime test
    pnpm --filter @firstflow/runtime-server test:watch
    pnpm --filter @firstflow/config-schema build
    ```
  </Step>
</Steps>

## Before you open a PR

* `pnpm build`, `pnpm typecheck`, `pnpm test`, and `pnpm lint` all pass.
* New behavior has tests (the packages use Vitest).
* Schema changes ship a new migration in `packages/config-schema/supabase/migrations/` and a regenerated JSON schema (`pnpm --filter @firstflow/config-schema build`).
* Public API changes update the relevant `README.md` / `SCHEMA.md`.

## Next

See the [overview](/self-hosting/overview) for the architecture, or the
[Server SDK](/server/overview) and [Browser SDK](/react/overview) references for
the package APIs.
