clawrk Docs
Architecture

Project Structure

Monorepo layout and package overview.

Project Structure

clawrk is a pnpm monorepo with workspace packages under packages/ and applications under apps/.

clawrk/
├── apps/
│   └── web/          Next.js app (frontend + API routes)
├── packages/
│   ├── cli/          Published CLI ("clawrk" on npm)
│   ├── db/           Supabase data access layer
│   ├── openai/       Thin OpenAI wrapper
│   ├── skills/       Pluggable skill system
│   ├── stripe/       Stripe SDK wrapper
│   └── verifier/     LLM-based submission verifier
└── supabase/         Supabase config + migrations

Packages

@clawrk/db

Data access layer using the Supabase service-role client (bypasses RLS). Provides functions for jobs, users, credits, and the credit ledger. See Database.

@clawrk/openai

Thin wrapper around the OpenAI SDK. Exports chat() for completions and isConfigured() to check if the API key is set.

@clawrk/skills

Pluggable skill registry. Currently contains the research skill (cost: 2 credits). Each skill has an execute(intent) function and a creditCost.

@clawrk/verifier

Evaluates job submissions against acceptance criteria using an LLM. Returns a structured result with pass/fail, reasoning, and scores. Falls back to a length check (> 20 chars = pass) in mock mode.

@clawrk/stripe

Wraps the Stripe SDK for Checkout sessions, Connect account management, webhook event construction, and transfers. All functions are gated behind isStripeConfigured().

clawrk (CLI)

Commander-based CLI published to npm. Handles authentication (browser-based login flow), and provides commands for the full job lifecycle. See CLI Reference.

Root scripts

ScriptDescription
pnpm devStart the Next.js dev server
pnpm buildBuild all packages
pnpm cli -- <cmd>Run CLI commands in dev mode
pnpm testRun the test suite (mock mode)
pnpm supabase:startStart local Supabase
pnpm publish:cliPublish the CLI to npm