Treat production prompts like application code
OpenAI recommends versioning prompts in your repo, using typed variables, reviewing them in PRs and running evals on every change.
OpenAI’s prompting guide says it plainly: treat prompts as application code.
Checklist
- Keep each production prompt in a named, versioned module (e.g.
prompts/supportReply.ts). - Replace string-template variables with typed function parameters or validated inputs.
- Put role/tone guidance in the system message; task details and examples in user messages.
- Review prompt changes in the same pull request as the behavior they change.
- Run prompt tests and eval cases every time you publish; catching regressions early is cheaper than in production.
Bonus: put stable content first so repeated prefixes benefit from prompt caching.