What is a Prompt Version?
A prompt version represents a specific published iteration of a prompt package. Versions allow you to:- Track changes to prompts over time
- Install specific versions for reproducibility
- Update prompts safely without breaking existing workflows
Prompts.dev uses semantic versioning (semver) for all prompt versions.
Version Data Model
Each version is stored in the database with the following structure:Key Characteristics
Unique Constraint
Each version has a unique constraint on
(prompt_id, version), preventing duplicate versions for the same prompt.Immutability
Once published, versions are immutable. To make changes, publish a new version.
Tarball Storage
Each version stores a reference to its tarball in object storage (S3-compatible).
Semantic Versioning
Prompts.dev follows the Semantic Versioning 2.0.0 specification:Version Components
| Component | When to Increment | Example |
|---|---|---|
| MAJOR | Breaking changes to prompt behavior or variables | 1.0.0 → 2.0.0 |
| MINOR | New functionality in a backwards-compatible manner | 1.0.0 → 1.1.0 |
| PATCH | Backwards-compatible bug fixes or improvements | 1.0.0 → 1.0.1 |
Examples of version changes
Examples of version changes
MAJOR (Breaking)
- Removing or renaming a required variable
- Completely changing prompt behavior
- Example:
{{product}}→{{product_name}}
- Adding new optional variables
- Enhancing prompt output without breaking existing use cases
- Example: Adding
{{tone}}as an optional variable
- Fixing typos
- Improving clarity without changing behavior
- Minor wording adjustments
Publishing Versions
When you publish a prompt, you create a new version:Publication Process
- Read
prompt.yaml: Extract version and metadata - Validate structure: Ensure required files exist
- Create tarball: Package files using
CreateTarball()frominternal/versions/tarball.go - Upload to storage: Store tarball in object storage
- Register version: Create database record with tarball URL
The version number comes from the
version field in prompt.yaml.Storage Path Convention
Versions are stored using this path pattern:Installing Versions
Install the latest version:Download Process
- Fetch version metadata: API lookup for version info
- Download tarball: GET request to tarball URL
- Extract package: Unpack to
.prompts/{name}/ - Record download: Log download event in database
Download tracking
Download tracking
Each download is recorded in the This allows tracking prompt popularity and usage analytics.
downloads table:Version Listing
View all versions of a prompt:Version Constraints
The database enforces several constraints to ensure data integrity:Database Constraints
Unique Versions
Constraint:
UNIQUE (prompt_id, version)Prevents publishing the same version twice for a prompt.Foreign Key
Reference:
prompt_id → prompts.idEnsures versions are linked to valid prompts.Required Fields
All fields (
prompt_id, version, tarball_url) are required and cannot be null.Tarball Management
Versions are distributed as gzip-compressed tarballs created by the system:Tarball Security
The extraction process includes security measures:- Path traversal prevention: Blocks
..and absolute paths - Destination validation: Ensures files extract within target directory
- Size limits: Enforces maximum tarball size
Tarballs are immutable once created. Modifications require publishing a new version.
Version History
Prompts.dev maintains a complete version history:- All versions remain accessible indefinitely
- Users can downgrade to previous versions if needed
- Version metadata includes creation timestamps
Versions cannot be deleted after publication to ensure reproducibility and prevent breaking dependent workflows.
Best Practices
- Follow semver strictly: Use the correct version component for your changes
- Document changes: Update README.md to describe version differences
- Test before publishing: Verify your prompt works as expected
- Start at 1.0.0: Begin with a stable version for public prompts
- Use pre-releases carefully: Consider suffixes like
1.0.0-betafor testing