VibeRaven is a tool that checks Supabase access control and Stripe webhook issues before release, and can also reproduce PostgreSQL race conditions, such as duplicate bookings.
Purpose
- Check Supabase migration files, application code, and configuration to find missing RLS (Row Level Security) and Data API authorization issues, and provide file and line numbers when available.
- Use check --replay to test supported Stripe handlers locally with duplicate or out-of-order events.
- Reproduce PostgreSQL race conditions, such as two users booking the last seat at the same time.
Key capabilities
- check: audits Supabase migrations, application code, and configuration; by default it is based on repository evidence, and with --db it can compare live schema metadata against migrations.
- check --race: runs two requests against a local PostgreSQL database, reports a race only when the failing order is reproducible twice, and provides a replay command; covers Prisma, Drizzle, pg, postgres.js, and supabase-js, including Edge Functions and SQL functions called via RPC.
- race: runs setup, two requests, and SQL assertions that must remain true according to the rules defined in viberaven.race.json; exit code 0 means no order was broken, 1 means broken, 2 means incomplete.
- The race engine is based on @viberaven/sessions, runs two independent sessions in a single PGlite WebAssembly instance using real locks, enumerates bounded statement orders for validation, and failing orders can be replayed byte-for-byte to confirm fixes.
- viberaven init adds the check to AGENTS.md so coding agents run the check before release.
Usage
- In an empty folder, run the synthetic booking example with Node 24 or later; the unprotected example oversells in 24 of 60 tested statement orders and ends with exit code 1, and the booking fixture demonstrates the guard-row fix and how to rerun the assertions.
- Use with the application root with Claude Code, Codex, or Cursor, add project instructions (optionally with --dry-run to preview changes), then have the agent review Supabase migration files for missing RLS and Data API authorization.
- Remote MCP clients (such as ChatGPT, Claude) can add https://viberaven.dev/mcp;本地 The MCP tool is available via npx -y @viberaven/mcp@1.19.0.
- npx -y viberaven@1.19.0 opens the local Studio, which includes a conversation with the coding agent, a provider board, versions and diffs, and a Race test tab for running races and replaying failure sequences.
- race requires Node 24+ (the CLI enables JSPI); check can run on Node 20+.
Use cases
- Review RLS and Data API authorization in Supabase migrations before going live.
- Verify Stripe webhook handling under duplicate or out-of-order events.
- Test concurrent races and overselling in scenarios such as bookings and inventory.
Limitations
- Migration files are loaded as-is into a fixed version of PostgreSQL 18.6; no claim is made of general PostgreSQL compatibility, nor of superiority over ordinary coding agents at finding defects.
- race only covers the provided SQL, inputs, and the order of the statements given; rules beyond simple count limits require an explicit spec; without a role, it runs as postgres.
- Incomplete runs do not count as passing; replay requires the same migrations, spec, options, and runtime.
- Cloud authentication, HTTP, and external I/O are out of scope for testing; the engine is not a security sandbox and should only run trusted SQL.
- The CLI and MCP are MIT-licensed, and @viberaven/sessions is Apache-2.0-licensed.