Overview
PromptRepo provides a comprehensive system for managing your AI prompts with full CRUD operations, metadata management, and lifecycle controls. Every prompt you create is automatically tracked and version-controlled.Creating Prompts
Basic Creation
Create a new prompt by providing:- Title (required): A descriptive name for your prompt (max 100 characters)
- Description (optional): Additional context about the prompt’s purpose (max 500 characters)
- Content (required): The actual prompt text (max 20,000 characters)
- Version Note (optional): A note describing the initial version (max 200 characters)
Every prompt starts at version 1. A new entry is created in both the
prompts table (HEAD state) and prompt_versions table (immutable history).Implementation Details
When you create a prompt, PromptRepo performs an atomic two-step operation:src/features/prompts/actions/save-prompt.ts:30-66.
Updating Prompts
Metadata Updates
You can update a prompt’s title and description without creating a new version:prompts table and sets updated_at to the current timestamp.
Content Updates
Content changes always create a new version. See Version Control for details.Prompt Lifecycle
Archive
Archive prompts you’re not actively using without deleting them:archived_at timestamp. Archived prompts are:
- Hidden from the main prompt list by default
- Excluded from search results (unless explicitly filtered)
- Still accessible via direct URL or API
- Fully restorable
src/features/prompts/actions/manage-prompt.ts:24-40.
Restore
Unarchive a prompt to return it to active use:archived_at to null, making the prompt visible again in all lists and searches.
Delete
Permanently delete a prompt and all its versions:Data Model
Two-Table Versioning
PromptRepo uses a sophisticated two-table architecture:prompts Table (HEAD State)
Stores the current state and metadata:prompt_versions Table (Immutable History)
Stores all content versions:Version numbers are always incremental integers starting from 1. The
prompt_versions table is append-only - existing versions cannot be modified or deleted.Security
Row Level Security (RLS)
All prompt operations are protected by PostgreSQL RLS policies:prompt_id foreign key relationship.
See the full schema in supabase/migrations/20260208000001_prompt_schema.sql.
Best Practices
Descriptive Titles
Use clear, searchable titles that describe the prompt’s purpose. Titles are weighted highest in search results.
Version Notes
Add version notes when making significant changes. This helps you understand your prompt’s evolution over time.
Archive vs Delete
Prefer archiving over deletion to preserve history. Delete only when you’re certain you won’t need the prompt or its versions.
Metadata Organization
Use descriptions to add searchable keywords and context. Descriptions have medium weight in search ranking.
Next Steps
Version Control
Learn how to track changes and restore previous versions
Collections
Organize prompts into collections for better management
Search
Discover how to find prompts quickly with full-text search
Variables
Add dynamic variables to your prompts