Build web and mobile apps with Claude Code that don't end up as AI slop. This harness is a CLI that scaffolds a Next.js and Expo monorepo on Supabase, with Claude Code hooks that send the agent back to work when a check fails.
Quality is a deterministic gate, not a request.
A Next.js + Expo (React Native) monorepo starter on Supabase with a Claude Code harness:
hooks that send the agent back to work while a quality gate fails. Guard hooks check
commands and file writes before they run, CI re-runs the gates, and update brings later
releases into an existing project.
For teams shipping a web app and a mobile app on one Supabase backend with Claude Code. Not a
fit today for a web-only app. The .claude/ hooks run only under Claude Code; another agent
meets the checks at the commit and in the pull request.
Documentation · FAQ · Changelog
npx --yes next-expo-supabase-agent-harness@latest init

No model runs in the recording: the hooks and gates are programs, and what they print is what the agent sees. It is rendered from docs/media/harness-demo.tape, whose commands a test replays on every pull request.
Status: stable (2.0.x). CI proves the scaffold on Linux, and on macOS without
the database gates. The installer's unit tests run on Linux, Windows and macOS.
pnpm validate has never run in CI on Windows. See Limitations.
| Complaint about coding agents | What answers it here |
|---|---|
| The agent says the tests pass when they do not. | When it tries to stop, the Stop hook runs the gates and tests itself and sends it back while any is red, up to Claude Code's block cap. |
| It weakens, skips or deletes tests. | test-quality (no .only, unreviewed .skip or test without assertions), diff-coverage (each changed source file needs a test) and a CI mutation-testing job (a new surviving mutant fails). |
It adds eslint-disable or @ts-ignore. | suppressions: @ts-ignore, @ts-nocheck and a rule-less eslint-disable fail; any other directive needs a reason and a reviewed allowlist entry. |
| It edits the check instead of the code. | Write protection on gate scripts and hooks, gate-integrity hashes, and a frozen CI gate list that a project cannot quietly shrink. |
It runs rm -rf, git reset --hard, a force-push or --no-verify. | The bash guard denies these, .env reads and destructive SQL outside migrations before they run: a tripwire on command text, not a sandbox. |
| It puts the service-role key in client code or a commit. | The write guard refuses it in web and package code; the secrets gate scans every tracked file. |
It ignores CLAUDE.md. | CLAUDE.md is context; hooks, gates and CI enforce the same rules either way. |
| It gets row-level security wrong. | schema-rls and tenancy (forced RLS, tenant-scoped policies, exact grants), then pgTAP and supabase-js isolation suites against the local Postgres before a turn ends. |
| The project is stuck on the template version it began with. | update: it replaces untouched harness files, leaves the new version of each edited one for you to merge, and --rollback undoes it. |
You need Node 22 or newer, pnpm 11 (corepack enable picks up the
pinned version), Docker for the local Supabase stack, and Claude Code. If corepack is not on
your PATH (Node.js 25 and later no longer bundle it), run npm install -g corepack first. In
an empty folder:
npx --yes next-expo-supabase-agent-harness@latest init
init asks for the project's details, each with a default, and writes the scaffold into
the folder. Then:
git init # first: the prepare script (lefthook install) needs a repository
pnpm install
git add -A && git commit -m "chore: scaffold" # the first commit must include pnpm-lock.yaml
pnpm db:up # with Docker running; the first run downloads the Supabase images
pnpm validate
claude # Claude Code: ask for one small change
That turn's Stop hook sends the agent back while any gate, the RLS tests included, is red. First run shows the turn with the local stack running and without it.
npx downloads the CLI and runs it in one step. To install it once instead:
npm i -g next-expo-supabase-agent-harness
next-expo-supabase-agent-harness init
Use -g: a local npm i writes a package-lock.json into the folder, and init stops
when it finds one. A global install stays at the version you installed, and update,
`enabl
CI: the device lane's dropped-frame cap (12 of 30) fails on emulator noise: 2 to 17 measured on unchanged trees
https://github.com/cogvera-labs/next-expo-supabase-agent-harness/issues/322
Labels: bug, area: ci
CI: supabase start fails with a host port already in use, after registry rate-limit retries (bootstrap-linux, demo-eject)
https://github.com/cogvera-labs/next-expo-supabase-agent-harness/issues/320
Labels: bug, area: ci
One pnpm dev:web turns the format gate red: next dev rewrites apps/web/next-env.d.ts, and adds apps/web/AGENTS.md under an agent
https://github.com/cogvera-labs/next-expo-supabase-agent-harness/issues/316
Labels: bug, area: gates
The documented env file location reaches neither app: pnpm dev:web answers 500 on a fresh scaffold
https://github.com/cogvera-labs/next-expo-supabase-agent-harness/issues/315
Labels: bug, area: docs
Participation in this project is covered by the Code of Conduct. Bugs and gate proposals go through the issue chooser, questions through Discussions, and vulnerabilities through the private channel in SECURITY.md. SUPPORT.md says where to ask for help and what answer to expect.
To find your way around, start with docs/architecture.md, the map of this repository: what each folder holds, how a change reaches an installed project, and where each check lives. The root AGENTS.md gives the same orientation to coding agents, with the checks to run for each kind of change. If an AI tool helps with your change, read Using AI tools before you start.
node scripts/check-syntax.mjs, node scripts/hygiene.mjs, and
node --test tests/ green, and the scaffold-green jobs — bootstrap-linux
(node 22 and 24), metal-bootstrap and demo-eject (an
init --with-demo scaffold, before and after eject) — must still produce a
project where pnpm validate passes out of the box. All three run on
ubuntu only: the one Windows runner in the matrix is installer-unit,
which exists for the path-separator/CRLF bug class and does not build a
scaffold. On macOS, installer-unit runs too, and macos-scaffold runs
pnpm validate on a scaffold without Docker; it reds on any skip but the
database gate's. No job builds a scaffold on Windows, so nothing here means
"a Windows scaffold is green".template/. The hygiene gate greps for
leaked strings (real tenant IDs, DSNs, signing material, store credentials)
and for cross-porting residue from the SIBLING harnesses — Hono, Drizzle,
Tauri, cargo, Vite vocabulary must never appear in the shipped template. Next,
Expo, Supabase and Vercel are this lineage's OWN stack and are expected there;
they were deliberately dropped from the inherited deny set (see the comment
block in scripts/hygiene.mjs). Add to that file if you spot a class it misses.installer/. Node built-ins only — the
installer must never itself be a supply-chain vector.{{TOKEN}} used in template/ must be
registered in installer/lib/placeholders.mjs, and vice versa (enforced by
hygiene).@sha # vX.Y.Z),
npm versions via the workspace catalog (the Expo SDK and its
expo install --check compatibility map are the native-side pin).
Renovate maintains the pins with a cooldown.gate-proposal. A gate must
be deterministic, HERMETIC, fast, and pass on the fresh scaffold — projects
grow into gates; gates never block a fresh install. Hermetic is not a nicety:
a gate that resolves its expectations from a live third-party endpoint will
turn an untouched commit red overnight, and this repo has already paid for
that once. Every gate lands with its anti-vacuity proof (inject the violation,
show the red) recorded in template/base/docs/harness/gates-catalog.md and
registered in tests/canary/injections.json.HARNESS_REQUIRE_TOOLCHAINS=1). Never let a skip look like a pass
silently. No selftest job may require EAS, Apple, or Google credentials —
the harness proves itself credential-free.AI coding agents write most changes to this repository, in sessions that run its own guard hooks and Stop gate, and AI-assisted contributions are welcome on the same terms. The rules below are about who answers for a change, not about which tool wrote it.
Co-Authored-By: trailer your tool adds to the commits it helped
write, or add one yourself. "None" is a fine answer.