Skip to content
Back to open source

promptschema

The Zod for AI prompts — schema-validated, versioned, multi-provider, cross-language.

promptschema is what Zod is to TypeScript types, applied to LLM prompts. Instead of raw strings sprinkled across your codebase, prompts become versioned, schema-validated contracts with typed inputs, readable diffs, and a shared JSON-Schema registry that TypeScript and Python both consume. Any model — OpenAI, Anthropic, Gemini, Ollama, or your own adapter — plugs into the same interface. When a prompt changes, semver tells you whether it's breaking, and consumers can pin versions like they pin dependencies.

License: MITPrimary language: TypeScript + Python

~12 kB

bundle size, TypeScript

2

runtime languages (TS + Python)

0

vendor lock-in — pick your provider

MIT

licensed, end to end

Why it exists

The bits that make it worth adopting.

Typed input schemas

Define what a prompt requires — user query, retrieved context, output format — as a Zod (TS) or Pydantic (Python) schema. Type errors surface at call site, not in production LLM output.

Semantic versioning + automatic diff

Every prompt has a semver. Breaking changes bump major. Minor changes bump minor. The registry ships a diff view so reviewers see exactly what changed between versions.

Cross-language registry

One JSON-Schema registry shared across TypeScript and Python code paths. A backend service in Python and a frontend agent in TypeScript can consume the same versioned prompt.

Multi-provider by design

OpenAI, Anthropic, Gemini, Ollama, or your own adapter — plug into the same interface. Switching providers is a config change, not a rewrite of every call site.

Zero-dep runtime

~12 kB bundle in TypeScript. No Zod dependency at runtime if you already use it; no framework required. Fits into any stack.

MIT + no vendor lock-in

Fork it, extend it, contribute upstream. Nothing about your prompt library is locked to Dailybot or any single LLM vendor.

Install

Get started in seconds.

Pick the channel that matches your stack. Every path lands you in the same working state.

npm i @dailybot/promptschema

In practice

What teams actually do with it.

01

Prompts as versioned dependencies

Pin your production LLM call to `[email protected]`. When a teammate ships `1.3.0`, you upgrade explicitly. No more silent behavior changes from a raw-string edit that nobody noticed.

02

Testable prompts across languages

Backend written in Python, agent in TypeScript. One prompt schema, shared JSON-Schema registry, identical contract on both sides. Test once, ship twice.

03

Provider-agnostic prompt libraries

Design your prompts around what they need to say, not what OpenAI or Anthropic accepts. The adapter handles the translation.

04

Prompt reviews that make sense

Reviewers see a semantic diff between `v1.2` and `v1.3`, not a wall of updated string. It's the difference between reviewing code and reviewing a novel.

At a glance

The short list.

Zod (TS) and Pydantic (Python) schemas

Semantic versioning with automatic diff

Shared JSON-Schema registry across languages

~12 kB bundle, zero vendor lock-in

FAQ

The questions we hear the most.

How is this different from LangChain or LlamaIndex?

Those are frameworks. promptschema is a contract library — it's the layer *below* your framework. Use it inside LangChain, LlamaIndex, or your own stack. It doesn't take a side.

Do I need both TypeScript and Python?

No. Use one, both, or neither (JSON-Schema is the interchange format). If your team is single-language, promptschema still gives you versioning, validation, and diffs — the cross-language part is optional.

What about closed-source models like Anthropic's?

Fully supported via the adapter interface. The contract is the same regardless of provider. Switching from Anthropic to OpenAI is a config change.

What it is

promptschema is a small, focused library that treats LLM prompts as first-class code artifacts: typed inputs, semantic versioning, shared registry, and provider-agnostic adapters. It’s the missing layer between “raw string prompts scattered across the codebase” and “prompts that behave like the rest of your stack.”

Why open source

Because a prompt contract only works if everyone can see, criticize, and extend it. promptschema is MIT-licensed, developed in the open, and designed to slot into any stack — TypeScript, Python, or both. Fork it, adapt it, contribute back.

How it fits the ecosystem

Dailybot’s own agent surfaces (skills, integrations, internal automations) rely on stable prompt contracts. promptschema is how we author those contracts. Open-sourcing the library means anyone building agent-heavy software can borrow the same discipline.

Ready to try it?

Open source, MIT-licensed, and shipping in production at Dailybot every day. Fork it, wire it in, contribute back.