What is a Prompt Package?
A prompt package is a standardized directory structure containing prompt metadata, content, and documentation. Packages are the unit of distribution in Prompts.dev. Think of prompt packages like npm packages: they follow a consistent structure, can be versioned, and are distributed through a central registry.Package Structure
Every prompt package has a standard structure:Required Files
prompt.yaml
Contains package metadata, version info, input variables, and tags.
prompt.md
The actual prompt content with template variables like
{{product}}.Optional Files
README.md
Documentation for users explaining how to use the prompt and what it does.
prompt.yaml Schema
Theprompt.yaml file defines the package configuration:
Schema Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Package name (must match prompt name) |
description | string | Yes | Short description of the prompt |
version | string | Yes | Semantic version (e.g., 1.0.0) |
author | string | Yes | Author username |
inputs | array | No | List of template variables |
tags | array | No | Searchable tags for discovery |
The
name field must match the prompt name in the registry and be unique per owner.Input Variables
Theinputs array defines template variables used in prompt.md:
- name: Variable name (used as
{{product}}in prompt.md) - required: Whether the CLI should enforce this variable
prompt.md Format
Theprompt.md file contains the actual prompt content:
Template variables use double curly braces:
{{variable_name}}Package Distribution
Prompt packages are distributed as compressed tarballs (.tar.gz files):
Tarball Creation
When you publish a prompt, the CLI:- Validates the package structure
- Creates a tarball containing all package files
- Uploads the tarball to object storage (S3-compatible)
- Registers the version in the database
internal/versions/tarball.go:
- Walks the source directory
- Creates a gzip-compressed tar archive
- Includes all files except directories
- Returns a reader and the tarball size
View tarball creation flow
View tarball creation flow
Storage Path
Tarballs are stored in object storage using this path structure:Installing Packages
When you install a prompt package:- Fetches the latest version metadata from the API
- Downloads the tarball from object storage
- Extracts the tarball to
.prompts/landing-page-writer/ - Records the download event
Packages are installed locally in the
.prompts/ directory in your project.Creating a Package
Initialize a new package using the CLI:Package Security
The system includes security measures for tarball handling:- Path validation: Prevents directory traversal attacks
- Size limits: Enforces maximum tarball size
- Content validation: Ensures required files are present
Security checks in tarball extraction
Security checks in tarball extraction