The Research Report
Your Prompts Are Not Just Text
Here is a string. It lives in a Python file, wedged between two functions. Someone copy-pasted it from ChatGPT six months ago. Three developers have edited it since. Nobody knows which version is running in production right now.
You are a helpful assistant. Answer the user's question about {{topic}}. Be concise but thorough.
That is how most teams manage prompts today. A string literal in a source file. Maybe a constant in a config. Maybe a row in a database that nobody has permissions to read.
It works fine when you have one prompt and one developer. It falls apart when you have twenty prompts, five environments, three providers, and a team that needs to review changes before they ship.
PromptOpsKit is an open-source npm library that treats prompts like what they actually are in production: behavior definitions, not text blobs.
What PromptOpsKit Actually Does
PromptOpsKit gives you a file format and a runtime for prompts. The prompts live in your repo. They are Markdown files with YAML front matter. The front matter declares everything about how the prompt should behave: which provider, which model, what sampling settings, what context inputs it expects, and which other prompts it includes.
Here is what a prompt file looks like:
---
id: summarize
schema_version: 1
provider: openai
model: gpt-4.1
reasoning:
effort: medium
sampling:
temperature: 0.3
max_tokens: 2048
includes:
- system/safety
context:
inputs:
document:
type: string
required: true
max_size: 50000
non_empty: true
format:
type: string
default: "bullet-points"
environments:
production:
model: gpt-4.1-mini
sampling:
temperature: 0.1
---
# System instructions
You are a summarization engine. Follow the safety guidelines in the included prompt.
# Prompt template
Summarize the following document in {{ format }} format:
{{ document }}
# Notes
- Reduces model cost in production by switching to gpt-4.1-mini
- Lower temperature in production for more consistent output
That file does a lot of work. It declares the provider, the model, the reasoning effort, the sampling parameters, the context inputs with validation rules, a shared include for safety instructions, and an environment override that swaps the model and adjusts temperature for production. All in one place. All reviewable in a pull request.
The Core Idea: Prompts Are Behavior Definitions
Most people think of a prompt as text. The thing you type into ChatGPT. A paragraph of instructions.
In a production app, a prompt is more than that. It includes the model you are calling, the temperature you set, the tools you make available, the context variables you pass in, the validation rules you enforce on those variables, and the overrides you apply per environment. It is a behavior definition.
Once you see it that way, managing prompts as scattered string literals stops making sense. You would not hardcode database connection strings in five different files and call it a configuration strategy. Prompts deserve the same structure.
How Variable Interpolation Works
PromptOpsKit uses {{ variable }} syntax for variable interpolation. It supports two modes:
- Strict mode throws an error if a variable in the template is not provided at runtime. This catches typos and missing data before you send garbage to the model.
- Permissive mode leaves unresolved variables as-is. Useful during development or for optional template sections.
The runtime also checks that every variable you declare in the context inputs section actually appears in the template. If you declare format as an input but never use {{ format }} in the template, PromptOpsKit tells you. This prevents dead configuration that confuses developers later.
Composition and Shared Defaults
Two features keep your prompts DRY: includes and folder defaults.
Includes let one prompt pull in system instructions from another. If every prompt in your app needs the same safety guidelines, you write those once and include them everywhere. Changes propagate through the include graph. No copy-paste drift.
includes:
- system/safety
- system/brand-voice
Folder defaults work like .gitignore inheritance. You put a defaults.md file in a folder. Every prompt in that folder inherits its provider, model, and metadata from that defaults file. A nested folder can override those defaults. Nearest folder wins. This means you can set a default model for your whole project, then override it for a specific group of prompts, all without touching each individual file.
Environment and Tier Overrides
Real apps run in multiple environments. Your development setup calls GPT-4.1 with high temperature for creative exploration. Your production setup calls GPT-4.1-mini with low temperature for consistency and cost control.
PromptOpsKit handles this with an override cascade:
base → environment → tier → runtime
Base values come from the prompt file itself. Environment overrides (development, staging, production) replace specific fields. Tier overrides (free, pro, enterprise) replace more fields. Runtime arguments passed in code can override anything left.
Each layer only overrides what it declares. If an environment override specifies a model but not a temperature, the base temperature survives. This keeps your override files small and your intent clear.
Provider Adapters
PromptOpsKit ships with five provider adapters:
- OpenAI Chat Completions
- OpenAI Responses API
- Anthropic
- Gemini
- OpenRouter
Each adapter takes a compiled prompt and produces a request body ready for that provider's API. No wrapping. No SDK dependency. You get a plain JSON body. You make the HTTP call yourself, or pass it to your existing SDK. PromptOpsKit does not own the transport layer.
The adapters also handle provider-specific caching controls:
- OpenAI: Prompt cache hints via
cache_control - Anthropic:
cache_controlmarkers on specific content blocks - Gemini:
cachedContentreferences
These are declared in the prompt file and rendered by the adapter. You do not write provider-specific caching code in your application logic.
Validation That Actually Helps
PromptOpsKit validates context inputs using Zod schemas generated from your declarations. But it goes further than "is this a string."
Levenshtein "did you mean?" suggestions. If you pass documnet instead of document, PromptOpsKit suggests the correct variable name. Not a cryptic "variable not found" error. A helpful nudge.
Context hardening validators:
non_emptyrejects empty stringsreject_secretsscans for API keys, tokens, and other credential patterns before they reach the model- Regex patterns for custom format enforcement
max_sizeper input with configurable warning thresholds to keep context windows in checkreturn_messagefor short-circuit: if validation fails, return a message instead of calling the model
That last one is useful. If a user submits a document that exceeds your size limit, you can return "Document too large, please submit under 50KB" without spending a token. The model never fires. You save money and latency.
The CLI
PromptOpsKit includes a CLI for working with prompt files outside your application code:
npx promptopskit init # scaffold a new prompt project
npx promptopskit validate # check all prompt files for errors
npx promptopskit compile # pre-compile .md files to JSON or ESM
npx promptopskit render # render a prompt with specific variable values
npx promptopskit inspect # show the resolved state of a prompt after all overrides
npx promptopskit skill # generate a skill manifest
The compile command is the one that matters for production. It takes your .md prompt files and produces pre-compiled JSON or ESM modules. Your application loads these at runtime instead of parsing Markdown on the fly. Faster startup. No YAML parsing in production.
The inspect command shows you exactly what a prompt resolves to after all defaults, includes, environment overrides, and tier overrides are applied. Useful for debugging why a production prompt behaves differently than expected.
The Raw Escape Hatch
Some provider APIs support fields that PromptOpsKit does not model. New features ship. Experimental parameters exist. You need to pass them through.
The raw field in the prompt file lets you inject unmodeled request-body fields directly into the adapter output. It is an escape hatch. Use it when you need it. But the goal is that you rarely need it, because the modeled fields cover the common cases.
Why Repo-Native
Teams ship code through Git. They review changes in pull requests. They branch for features. They tag releases. They roll back by reverting commits.
PromptOpsKit fits that workflow. Prompts are files in your repo. Changes are commits. Reviews happen in PRs. Shared defaults are explicit files, not tribal knowledge in someone's head. When something breaks, you check Git history. When you need to revert, you revert.
This is different from hosted prompt management platforms. Those give you a dashboard. You edit prompts in a web UI. You version them in the platform's database. That creates a separate deployment pipeline. Your prompts live outside your code. Your team needs to learn a new tool. Your CI pipeline needs to call a different API.
PromptOpsKit says: keep the prompts where you keep the code. Use the tools you already use. Git, PRs, CI, code review. No new dashboard. No separate deployment step. The prompt files compile into artifacts that ship with your application.
What PromptOpsKit Is Not
It is not a hosted prompt dashboard. It is not an evaluation framework. It is not trying to own your API transport layer. It does not compete with eval tools or prompt playgrounds.
It is a structured runtime for prompt behavior. You define your prompts as files. You validate them at build time. You compile them for production. You render them at runtime. The provider adapters turn them into API request bodies. You make the call.
If you want a playground for experimenting with prompts, GitHub Models gives you that. PromptOpsKit is what you reach for when you need to ship those prompts to production with structure, validation, and environment overrides.
Getting Started
npm install promptopskit
npx promptopskit init
That scaffolds a prompt project with the directory structure, a sample prompt file, and a defaults file. From there, you create prompt files, declare your context inputs, set your environment overrides, and compile for production.
The library is open source under the MIT license. The code lives at github.com/PredictabilityAtScale/promptopskit. The documentation is at promptopskit.com.
Suggested title: Your Prompts Are Not Just Text
Word count: ~1,450
Citations:
- PromptOpsKit GitHub repository: https://github.com/PredictabilityAtScale/promptopskit
- PromptOpsKit website: https://promptopskit.com
- npm package: https://www.npmjs.com/package/promptopskit
- Troy Magennis / PredictabilityAtScale (GitHub organization)
- LLMAsAService.io: https://llmasaservice.io
- OpenAI prompt caching documentation: https://platform.openai.com/docs/guides/prompt-caching
- Anthropic prompt caching documentation: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
- Gemini caching documentation: https://ai.google.dev/gemini-api/docs/caching
Fact-check notes:
- Publication date: The source brief says PromptOpsKit was published April 23, 2026. Verify this matches the npm publish date and GitHub release.
- Provider adapter list: The five adapters listed (OpenAI Chat, OpenAI Responses, Anthropic, Gemini, OpenRouter) come from the research brief. Verify against the current README in case adapters were added or removed after launch.
- CLI commands: The init/validate/compile/render/inspect/skill commands come from the brief. Double-check against the actual CLI help output for accuracy.
- Override cascade order: The brief states base → env → tier → runtime. Verify this is the exact precedence order documented in the project.
- Zod validation: The brief mentions Zod schema validation. Confirm the library uses Zod specifically (not a different schema library).
- MIT license: Assumed based on common open-source npm practice. Verify the actual license in the repository.
- GitHub Models comparison: The brief contrasts PromptOpsKit with GitHub Models as a playground/editor. Verify that GitHub Models still functions as described at time of publication.
- Caching control field names: OpenAI
cachecontrol, Anthropiccachecontrol, GeminicachedContent— verify these match current API documentation names at time of publication, as provider APIs change frequently.