home/roleplay/prompt-system-deep-dive

Prompt.system.deep Dive

GPTClaudeGemini··640 copies·updated 2026-07-14
prompt-system-deep-dive.prompt
# Prompt System Architecture

## Status

- Version: v0 (MVP)
- Stability: stable for single-user local usage
- Concurrency: optimistic (builder_content only)

## Scope

This document explains:
- data model
- FS + DB sync
- prompt lifecycle (create, read, update)

## Gotchas

- FS must NEVER be written before DB conflict check
- Paths are stored, not inferred
- output.json must always be valid JSON
- builder_content is stored as string (JSON.stringify)
- DB is source of truth for structure, not FS


## 1. Core Mental Model

* **Prompt = container**
* **Version = snapshot of data**
* **Filesystem (FS) = actual content**
* **Database (DB) = structure + metadata**

---

## 2. Data Layer Design

### Tables

#### prompts (container)

* id
* name
* template_id
* collection_id
* current_version_id
* created_at
* updated_at

#### prompt_versions (actual data)

* id
* prompt_id
* version_number
* label
* builder_content (JSON string)
* scratchpad_path
* output_path
* output_type (optional)
* created_at
* updated_at

#### collections (folders)

* id
* name
* parent_id (nested folders)

---

## 3. Filesystem Design

### Structure

Initial (no versioning):

when to use it

Community prompt sourced from the open-source GitHub repo byhsr/prmptly (no explicit license). A "Prompt.system.deep Dive" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

roleplaycommunitygeneral

source

byhsr/prmptly · no explicit license