← Back to work
01PROMPTKIT

promptkit

Prompt versioning as infrastructure.

Prompt versioning as infrastructure. Prompts live as rows with immutable versions and an active_version_id pointer, so publishing and rolling back are the same one-click operation — no redeploy, no code change. Apps read the live version at runtime by slug over GraphQL.

Prompts usually live in a codebase as hardcoded strings, which means changing a single word is a code change: edit, review, merge, redeploy. promptkit moves them out. A prompt is a row with a stable slug and a list of immutable versions.

The parent row holds an active_version_id pointer, and that pointer is the only thing that decides what "live" means. Publishing a new version and rolling back to an old one are the same one-click operation aimed at different rows.

One Next.js application, no separate backend service. A graphql-yoga instance is mounted on a single route handler and is the entire public API surface. Every database query sits behind typed functions, with rows parsed by zod at the boundary so schema drift fails loudly instead of flowing through as any.

Six tables carry the model: orgs and org_members for tenancy, prompts and prompt_versions for the append-only version history, experiments for A/B splits, and api_keys — where only a SHA-256 hash is ever stored.

Next projectUNPLAN02