# AI Prompt Management & Performance Dashboard  

> **One‑stop Notion workspace** for every prompt you own, every execution you run, every dollar you earn, and now—every prompt you buy, sell, or co‑create. Includes built‑in version control, real‑time KPI dashboards, AI‑assisted prompt generation/optimization, a community hub, and ready‑to‑use Zapier/Make integrations.  

---  

## 📊 Dashboard / How to Use  

| Section | What it does | Quick link |
|--------|--------------|------------|
| **Prompt Library** | Master list of all prompts with versioning, owners, tags, AI‑generated suggestions, and change history. | `[[Prompt Library]]` |
| **Prompt Run Log** | Every execution captured automatically (Zapier/Make) – tokens, cost, outcome, model, etc. | `[[Prompt Run Log]]` |
| **Revenue Log** | Track the revenue each prompt generates (product sales, content fees, ad lift, etc.). | `[[Revenue Log]]` |
| **Marketplace** | Buy, sell, or license prompts; view pricing, ratings, and transaction history. | `[[Marketplace]]` |
| **AI Prompt Generator** | One‑click AI assistant that drafts new prompts or optimizes existing ones (GPT‑4/Claude‑2). | `[[AI Prompt Generator]]` |
| **Community Hub** | Share prompts, discuss improvements, run collaborative A/B tests, and earn community credits. | `[[Community Hub]]` |
| **KPI Dashboard** | Read‑only, auto‑aggregated views: Cost Overview, ROI Tracker, Performance Heatmap, Trend Charts. | `[[KPI Dashboard]]` |
| **Cost & ROI Analyzer** | What‑if calculator for expected revenue, break‑even runs, and ROI projections. | `[[Cost & ROI Analyzer]]` |
| **Automation & Version Control** | Webhook schema, Zapier/Make mapping, Slack alerts, and a “New Version” button. | `[[Automation & Version Control]]` |

> 💡 **Tip:** Bookmark the **KPI Dashboard** page and set it as your Notion home page for a daily performance snapshot.  

---  

## ⚡ Quick Start (2‑minute setup)  

1. **Duplicate** this template → **Share → Duplicate as template**.  
2. **Prompt Library** → click **New Prompt** (template button) and add your first prompt.  
3. **AI Prompt Generator** → run **Generate Draft** to auto‑populate a prompt skeleton.  
4. **Marketplace** → list the new prompt for sale (set price, license type, and visibility).  
5. **Prompt Run Log** → click **New Run** (template button) and fill the Zapier‑generated fields (or run a test Zap).  
6. Open **KPI Dashboard** – the default views will instantly compute cost, ROI, and success rates.  
7. (Optional) Connect Zapier/Make webhook to the **Prompt Run Log** template page – see the **Automation & Version Control** section for the exact JSON payload.  

---  

## 📚 Prompt Library  

> **Core database** – each row is a prompt version.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Name** | **Title** | Prompt title (must be unique). | *Blog Outline Generator* |
| **Description** | **Text** | Full prompt text (editable). | “You are a senior tech writer …” |
| **AI‑Suggested** | **Text** | AI‑generated alternative wording (auto‑filled). | “Create a concise outline …” |
| **Tags** | **Multi‑select** | Functional or business tags. | `content, blog, outline` |
| **Owner** | **Person** | Prompt owner / primary maintainer. | Alice |
| **Collaborators** | **Person** (multi) | Community members granted edit rights. | Bob, Carol |
| **Version** | **Number** (format: 0.0) | Increment on every change. | 1.2 |
| **Status** | **Select** – *Draft / Active / Retired / For Sale* | Lifecycle stage. | Active |
| **Price (USD)** | **Number** (currency) | Listing price if **For Sale**. | 9.99 |
| **Rating** | **Number** (0‑5) | Avg. community rating. | 4.6 |
| **Created** | **Created time** | Auto‑filled. | — |
| **Last Updated** | **Last edited time** | Auto‑filled. | — |
| **Related Runs** | **Relation → Prompt Run Log** (Count) | How many executions exist. | 42 |
| **Related Revenue** | **Relation → Revenue Log** (Count) | How many revenue entries exist. | 12 |
| **Next Version** | **Formula** `prop("Version") + 0.1` | Auto‑suggested next version. | 1.3 |
| **Change Log** | **Rollup** (from Prompt Run Log → Run Date) → **Earliest** | First run after this version was created. | 2024‑07‑01 |

### Views (inside the **Prompt Library** page)  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **All Prompts** | — | — | Master list. |
| **Active Prompts** | `Status` = **Active** | — | Quick access to production prompts. |
| **For Sale** | `Status` = **For Sale** | **Price (USD)** ascending | Marketplace listings. |
| **Drafts** | `Status` = **Draft** | — | Work‑in‑progress prompts. |
| **Retired** | `Status` = **Retired** | — | Historical archive. |
| **Recent Changes** | `Last Updated` is within the past **7 days** | — | Spot new versions. |
| **Version History** | Sort by **Version** descending | — | See latest version on top. |

### Template Buttons (top of the page)  

- **New Prompt** → creates a blank row with `Version = 1.0`, `Status = Draft`, `Owner` = current user, and **AI‑Suggested** pre‑filled by the **AI Prompt Generator**.  
- **Duplicate Prompt** → duplicates the selected row, increments **Version** via the **Next Version** formula, and sets the original row’s **Status** to *Retired* (automated with a small Notion automation script – see “Automation & Version Control”).  
- **List on Marketplace** → changes **Status** to *For Sale*, prompts for **Price (USD)** and **License Type** (single‑use, subscription, royalty‑share).  

---  

## ▶️ Prompt Run Log  

> **Execution log** – each run is a database item created by Zapier/Make or manually via the **New Run** button.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Run ID** | **Title** | Auto‑generated `RUN‑YYYYMMDD‑###`. | RUN‑20240703‑001 |
| **Prompt** | **Relation → Prompt Library** (single) | Links to the prompt version used. | Blog Outline Generator |
| **Run Date** | **Date** (default = now) | When the run occurred. | 2024‑07‑03 |
| **Input Summary** | **Text** | Short description of the input (max 200 chars). | “AI trends 2024” |
| **Input JSON** | **Text** (code block) | Full JSON payload sent to the model (optional). | `{ "messages": … }` |
| **Model** | **Select** – *GPT‑4, GPT‑3.5, Claude‑2, Cohere‑X, …* | Model used for the run. | GPT‑4 |
| **Tokens Used** | **Number** | Total tokens (prompt + completion). | 1 200 |
| **Cost (USD)** | **Number** (currency) | Cost charged by the provider. | 0.018 |
| **Run Duration (s)** | **Number** | Seconds the API call took. | 2.3 |
| **Outcome Rating** | **Select** – ★1 to ★5 (emoji) | Human‑rated quality of the output. | ★4 |
| **Success** | **Checkbox** | Did the run meet the success criteria? | ✅ |
| **Notes** | **Text** | Any post‑run commentary. | “Needed minor edit.” |
| **Revenue** | **Rollup** (from Revenue Log → Amount) | Revenue linked to this run (if any). | 0.12 |
| **ROI** | **Formula** `if(prop("Cost (USD)") == 0, 0, (prop("Revenue") - prop("Cost (USD)")) / prop("Cost (USD)"))` | Real‑time ROI per run. | 5.6 |
| **Run Tags** | **Multi‑select** | Optional tags (e.g., “A/B test”, “Urgent”). | `A/B test` |
| **Community Feedback** | **Relation → Community Hub** (single) | Link to discussion thread for this run. | #run‑20240703‑001 |

### Views (inside the **Prompt Run Log** page)  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **All Runs** | — | — | Full history. |
| **Recent Runs** | `Run Date` is within the past **7 days** | — | Quick scan of latest activity. |
| **Failed Runs** | `Success` = unchecked | — | Spot problems. |
| **Cost Overview** | — | Group by **Prompt** | Σ Cost, Avg Tokens, #Runs per prompt. |
| **ROI Tracker** | `Prompt.Status` = **Active** | — | ROI per active prompt. |
| **Performance Heatmap** | — | Calendar (Run Date) colored by **Outcome Rating** (green = ★5, red = ★1) | Visual success trend. |
| **Run Duration Chart** | — | Table grouped by **Model** showing avg Duration | Identify slow models. |
| **Community Discussions** | `Community Feedback` is not empty | — | Jump to linked forum threads. |

---  

## 💰 Revenue Log  

> **Revenue attribution** – each row ties back to a prompt version (or directly to a run).  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Revenue ID** | **Title** | Auto‑generated `REV‑YYYYMMDD‑###`. | REV‑20240703‑001 |
| **Prompt** | **Relation → Prompt Library** (single) | Prompt that generated the revenue. | Blog Outline Generator |
| **Run** | **Relation → Prompt Run Log** (single) | Specific run that produced the revenue (optional). | RUN‑20240703‑001 |
| **Revenue Date** | **Date** (default = now) | When the revenue was realized. | 2024‑07‑03 |
| **Amount (USD)** | **Number** (currency) | Gross revenue before any deductions. | 0.12 |
| **Source** | **Select** – *Product, Service, Campaign, Affiliate, Marketplace Sale, Other* | Revenue source type. | Marketplace Sale |
| **Attribution** | **Text** | How the revenue is linked (e.g., “Blog post #42”). | “Published on Medium” |
| **Notes** | **Text** | Additional context. | “First‑time buyer.” |

### Views (inside the **Revenue Log** page)  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **All Revenue** | — | — | Full list. |
| **By Prompt** | — | Group by **Prompt** | Revenue per prompt. |
| **Monthly Summary** | — | Group by **Revenue Date** (Month) | Monthly totals. |
| **High‑Value** | `Amount (USD)` ≥ 0.10 | — | Spot lucrative prompts. |
| **Unlinked Runs** | `Run` is empty | — | Find revenue entries missing a run reference. |
| **Marketplace Sales** | `Source` = **Marketplace Sale** | — | Track marketplace performance. |

---  

## 🛒 Marketplace  

> **Buy, sell, or license prompts** directly inside Notion.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Listing ID** | **Title** | Auto‑generated `MKT‑YYYYMMDD‑###`. | MKT‑20240703‑001 |
| **Prompt** | **Relation → Prompt Library** (single) | Prompt being offered. | Blog Outline Generator |
| **Seller** | **Person** | Owner of the prompt (auto‑filled). | Alice |
| **License Type** | **Select** – *Single‑Use, Subscription, Royalty‑Share* | How the buyer may use the prompt. | Royalty‑Share |
| **Price (USD)** | **Number** (currency) | Listing price. | 9.99 |
| **Rating** | **Number** (0‑5) | Avg. community rating (read‑only). | 4.6 |
| **Downloads** | **Number** | Times purchased (auto‑increment). | 27 |
| **Status** | **Select** – *Live / Sold / Removed* | Listing lifecycle. | Live |
| **Purchase Date** | **Date** | When the prompt was bought (filled on transaction). | 2024‑07‑04 |
| **Buyer** | **Person** | Who bought the prompt (filled on transaction). | Dave |
| **Notes** | **Text** | License terms or special conditions. | “5% royalty per sale.” |

### Views (inside the **Marketplace** page)  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **Live Listings** | `Status` = **Live** | — | Browse available prompts. |
| **My Purchases** | `Buyer` = current user | — | Quick access to owned prompts. |
| **Top Sellers** | Sort by **Downloads** descending | — | See most popular prompts. |
| **Revenue by License** | Group by **License Type** | — | Compare royalty vs. subscription income. |
| **Community Picks** | Filter `Rating` ≥ 4.5 | — | Curated high‑quality prompts. |

---  

## 🤖 AI Prompt Generator  

> **One‑click AI assistant** that can (a) draft a brand‑new prompt from a brief, (b) suggest improvements for an existing prompt, or (c) auto‑optimize token usage & cost.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Generator ID** | **Title** | Auto‑generated `GEN‑YYYYMMDD‑###`. | GEN‑20240703‑001 |
| **Mode** | **Select** – *Create New, Optimize Existing, Cost‑Trim* | What the AI should do. | Optimize Existing |
| **Target Prompt** | **Relation → Prompt Library** (single) | Prompt to optimize (optional). | Blog Outline Generator |
| **Input Brief** | **Text** | User‑provided description or goals. | “Generate a 5‑section outline for a tech blog about AI ethics.” |
| **AI Model** | **Select** – *GPT‑4, Claude‑2, Gemini‑1.5* | Engine used for generation. | GPT‑4 |
| **Generated Prompt** | **Text** | AI‑produced prompt (editable). | “You are an AI ethics expert …” |
| **Token Estimate** | **Number** | Predicted token count for the generated prompt. | 85 |
| **Cost Estimate (USD)** | **Number** (currency) | Predicted cost per run. | 0.0015 |
| **Quality Score** | **Number** (0‑100) | AI confidence / relevance score. | 92 |
| **Save to Library** | **Checkbox** | When checked, creates a new row in **Prompt Library** (via automation). | ☐ |
| **Notes** | **Text** | Any manual tweaks or reviewer comments. | “Add disclaimer about data privacy.” |

### Views  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **All Generations** | — | — | Full history of AI‑generated drafts. |
| **Pending Saves** | `Save to Library` = unchecked | — | Review before committing to the library. |
| **Cost‑Optimized** | `Mode` = **Cost‑Trim** | — | Quick access to low‑cost prompt versions. |

---  

## 🌐 Community Hub  

> **Collaborative space** where members discuss prompts, run joint experiments, and earn community credits.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Thread ID** | **Title** | Auto‑generated `COMM‑YYYYMMDD‑###`. | COMM‑20240703‑001 |
| **Prompt** | **Relation → Prompt Library** (single) | Prompt the discussion revolves around. | Blog Outline Generator |
| **Topic** | **Select** – *Feature Request, Bug, Optimization, Use‑Case, Showcase* | Type of discussion. | Optimization |
| **Starter** | **Person** | Who opened the thread. | Bob |
| **Participants** | **Person** (multi) | Members invited to collaborate. | Alice, Carol |
| **Messages** | **Text** (rich) | Thread content (markdown). | “Can we reduce token count?” |
| **Votes** | **Number** | Community up‑votes (for ranking). | 12 |
| **Credits Earned** | **Number** (currency) | Community credits awarded for contributions (e.g., 0.05 USD per accepted suggestion). | 0.05 |
| **Linked Run** | **Relation → Prompt Run Log** (single) | Run that sparked the discussion (optional). | RUN‑20240703‑001 |
| **Status** | **Select** – *Open / Resolved / Closed* | Thread lifecycle. | Open |

### Views  

| View | Filters / Sort | Grouping | Purpose |
|------|----------------|----------|---------|
| **Open Discussions** | `Status` = **Open** | — | Ongoing collaborations. |
| **Top Contributors** | Sort by **Credits Earned** descending | — | Recognize active members. |
| **Prompt‑Centric** | Group by **Prompt** | — | See all community activity per prompt. |
| **Showcase** | `Topic` = **Showcase** | — | Highlight successful use‑cases. |

---  

## 📈 KPI Dashboard (Read‑only)  

Create a **sub‑page** called **KPI Dashboard** and add the following **linked database** views. Set each view to **Read‑only** (disable editing) for a clean reporting surface.  

### 1️⃣ Cost Overview (Table)  

- **Source**: `Prompt Run Log` (linked).  
- **Group by**: **Prompt**.  
- **Columns**:  
  - **Prompt** (Relation) – show name.  
  - **Σ Cost** → **Rollup** of **Cost (USD)** → **Sum**.  
  - **Avg Tokens** → **Rollup** of **Tokens Used** → **Average**.  
  - **Runs** → **Rollup** of **Run ID** → **Count**.  
  - **Avg ROI** → **Rollup** of **ROI** → **Average** (format as %).  

### 2️⃣ ROI Tracker (Table)  

- **Source**: `Prompt Library` (linked).  
- **Filters**: `Status` = **Active**.  
- **Columns**:  
  - **Prompt** (Title).  
  - **Version** (Number).  
  - **Avg Cost** → **Rollup** from **Prompt Run Log** → **Average of Cost (USD)**.  
  - **Total Revenue** → **Rollup** from **Revenue Log** → **Sum of Amount (USD)**.  
  - **ROI** → **Formula** `if(prop("Avg Cost") == 0, 0, (prop("Total Revenue") - prop("Avg Cost")) / prop("Avg Cost"))`.  
  - **Success Rate** → **Rollup** of **Success** → **Percent checked**.  

### 3️⃣ Performance Heatmap (Calendar)  

- **Source**: `Prompt Run Log`.  
- **Calendar** on **Run Date**.  
- **Color**: set **Outcome Rating** as the “Color by” field (custom emoji gradient).  

### 4️⃣ Trend Charts (Embedded)  

> Notion now supports native chart blocks (beta). Use the **Chart** block and point it at the **Prompt Run Log** view. Configure three charts:  

1. **Cost Over Time** – line chart, X = Run Date (month), Y = Σ Cost.  
2. **Runs per Model** – bar chart, X = Model, Y = Count of Run ID.  
3. **Marketplace ROI** – bar chart, X = Prompt (Marketplace), Y = (Revenue – Cost) / Cost.  

*(If you don’t have native charts, embed a Google Sheet chart via `/embed`.)*  

### 5️⃣ Summary Numbers (Top of the page)  

Add a **Callout** block with inline formulas (using the **Formula** property on a tiny “Dashboard Metrics” database):  

| Metric | Formula (in Dashboard Metrics DB) |
|--------|-----------------------------------|
| **Total Cost (30 d)** | `rollup(Prompt Run Log, Cost (USD), sum, filter(dateBetween(prop("Run Date"), startOfMonth(now()), endOfMonth(now())))` |
| **Total Revenue (30 d)** | `rollup(Revenue Log, Amount (USD), sum, filter(dateBetween(prop("Revenue Date"), startOfMonth(now()), endOfMonth(now())))` |
| **Marketplace Revenue (30 d)** | `rollup(Marketplace, Price (USD), sum, filter(prop("Status") == "Sold" and dateBetween(prop("Purchase Date"), startOfMonth(now()), endOfMonth(now())) )` |
| **Overall ROI** | `if(prop("Total Cost") == 0, 0, (prop("Total Revenue") - prop("Total Cost")) / prop("Total Cost") )` |
| **Avg Success Rate** | `rollup(Prompt Run Log, Success, percentChecked)` |
| **Community Credits Earned** | `rollup(Community Hub, Credits Earned, sum)` |

---  

## 📂 Cost & ROI Analyzer  

A **calculation table** that lets you model expected revenue per run and instantly see break‑even points.  

| Property | Type | Description | Example |
|----------|------|-------------|---------|
| **Prompt** | **Relation → Prompt Library** (single) | Prompt you’re evaluating. | Blog Outline Generator |
| **Avg Cost per Run** | **Rollup** (from Prompt Run Log → Cost (USD) → **Average**) | Historical cost. | 0.018 |
| **Avg Tokens per Run** | **Rollup** (from Prompt Run Log → Tokens Used → **Average**) | Historical token usage. | 1 200 |
| **Expected Revenue per Run** | **Number** (editable) | Forecasted revenue. | 0.12 |
| **Break‑Even Runs** | **Formula** `ceil(prop("Avg Cost per Run") / prop("Expected Revenue per Run"))` | Minimum runs to cover cost. | 2 |
| **Current ROI** | **Formula** `(prop("Expected Revenue per Run") - prop("Avg Cost per Run")) / prop("Avg Cost per Run")` | Projected ROI multiplier. | 5.6× |
| **Payback Period (days)** | **Formula** `ceil(prop("Break‑Even Runs") * avg(prop("Prompt Run Log", "Run Duration (s)")) / 86400)` | Approx. days to break even (using avg run duration). | 0.01 |
| **Confidence** | **Select** – *Low, Medium, High* | How certain you are of the revenue estimate. | High |
| **Marketplace Impact** | **Number** (editable) | Expected extra revenue from marketplace sales. | 0.03 |
| **Total Projected ROI** | **Formula** `(prop("Expected Revenue per Run") + prop("Marketplace Impact") - prop("Avg Cost per Run")) / prop("Avg Cost per Run")` | ROI including marketplace upside. | 6.1× |

### Views  

- **All Analyses** – full table.  
- **High‑Confidence** – filter `Confidence` = **High**.  
- **Needs Review** – filter `Break‑Even Runs` > 10 or `Current ROI` < 1.  

---  

## 🤖 Automation & Version Control  

### 1️⃣ Zapier / Make Webhook Payload (JSON)  

```json
{
  "run_id": "RUN-{{date}}-{{increment}}",
  "prompt_id": "{{prompt_relation_id}}",
  "run_date": "{{now_iso}}",
  "input_summary": "{{input_summary}}",
  "input_json": "{{input_json}}",
  "model": "{{model}}",
  "tokens_used": {{tokens}},
  "cost_usd": {{cost}},
  "run_duration_s": {{duration}},
  "outcome_rating": "{{rating}}",
  "success": {{success_bool}},
  "notes": "{{notes}}",
  "community_thread_id": "{{community_thread_id}}"
}
```

- **Zapier mapping** → **Notion > Create Database Item** (target: **Prompt Run Log**).  
- **Make mapping** → **Notion > Create a Database Item** (same fields).  

### 2️⃣ Version‑Bump Automation (No‑code)  

1. In **Prompt Library**, add a **Formula** property `auto_version = prop("Version") + 0.1`.  
2. Create a **Template Button** called **“New Version”** (inside Prompt Library):  
   -