Universal Prompt Format (UPF) JSON Schemas

This page provides JSON Schema files for the Universal Prompt Format (UPF) used by PrompTrek.

Available Schemas

v3.0 (Current Stable) ✨

Schema Version: 3.0.x

Latest stable schema with top-level plugin fields and plugin marketplace support.

Download v3.0 Schema


v2.1 (Legacy)

Schema Version: 2.1.x

Legacy schema with nested plugin structure.

Download v2.1 Schema


v2.0 (Legacy)

Schema Version: 2.0.x

Simplified markdown-first schema without plugin support.

Download v2.0 Schema

Usage in Your Editor

VS Code

Add a schema reference at the top of your project.promptrek.yaml:

# yaml-language-server: $schema=https://promptrek.ai/schema/v3.0.0.json
schema_version: 3.0.0
metadata:
  title: My Project
  description: Project description
content: |
  # Your markdown content here

IntelliJ IDEA / WebStorm

  1. Go to SettingsLanguages & FrameworksSchemas and DTDsJSON Schema Mappings
  2. Add a new mapping:
    • Name: PrompTrek UPF v3.0
    • Schema file or URL: https://promptrek.ai/schema/v3.0.json
    • File path pattern: *.promptrek.yaml

Programmatic Validation

Python

import json
import yaml
from jsonschema import validate

# Load the schema
with open('v3.0.json') as f:
    schema = json.load(f)

# Load your YAML file
with open('project.promptrek.yaml') as f:
    data = yaml.safe_load(f)

# Validate
validate(instance=data, schema=schema)

JavaScript/TypeScript

const Ajv = require('ajv');
const yaml = require('js-yaml');
const fs = require('fs');

// Load schema
const schema = JSON.parse(fs.readFileSync('v3.0.json', 'utf8'));

// Load YAML
const data = yaml.load(fs.readFileSync('project.promptrek.yaml', 'utf8'));

// Validate
const ajv = new Ajv();
const validate = ajv.compile(schema);
const valid = validate(data);

if (!valid) console.log(validate.errors);

Migration

To migrate between schema versions, use the PrompTrek CLI:

# Migrate from v2.x to v3.0
promptrek migrate project.promptrek.yaml -o project.v3.promptrek.yaml

# Or migrate in-place
promptrek migrate project.promptrek.yaml --in-place

Schema Generation

These schemas are automatically generated from the Pydantic models in the PrompTrek codebase.

To regenerate schemas (for contributors):

cd /path/to/promptrek
python scripts/generate_schemas.py

Resources

Questions?

If you have questions or need help with the schemas, please: