# Scripts & Prompts Consolidation Plan

**Status:** Investigation Complete - Awaiting Approval
**Created:** Jan 17, 2026 (Session 6)

---

## Current State Audit

### What Exists

| Page | Route | Purpose |
|------|-------|---------|
| Scripts.jsx | /scripts | Call scripts library |
| ScriptsCommandCenter.jsx | /scripts/command-center | Brand voice + compliance + mixed scripts |
| ScriptDetail.jsx | /scripts/:id | View individual script |
| ScriptBuilder.jsx | /scripts/new | Create new script |
| ScriptStats.jsx | /scripts/stats | Analytics |
| Prompts.jsx | /prompts | SMS templates hub |
| PromptsSend.jsx | /prompts/send | Bulk SMS send workflow |

### The Confusion

**Scripts Hub has 3 entry points:**
1. `/scripts` - Lists call scripts by category (Cold Call, Follow Up, etc.)
2. `/scripts/command-center` - "Brand voice & compliance" with SMS/Call/Email/Objection categories
3. Both accessible from More menu, no clear hierarchy

**Prompts Hub:**
- `/prompts` - SMS templates with AI generator
- Separate from Scripts but similar categories

**Category Overlap:**
| Category | In Scripts | In CommandCenter | In Prompts |
|----------|------------|------------------|------------|
| Cold Call | ✅ | ✅ (call) | ✅ |
| Follow Up | ✅ | ✅ | ✅ |
| Closing | ✅ | ✅ | ✅ |
| Reactivation | ✅ | ❌ | ✅ (re-engage) |
| Objection | ❌ (separate) | ✅ | ✅ |
| SMS | ❌ | ✅ | ✅ (all) |
| Email | ❌ | ✅ | ❌ |

**User Confusion Points:**
1. "Should I use Scripts or Prompts for SMS?"
2. "Where do I find objection responses?"
3. "What's the Command Center vs Scripts?"
4. ScriptsCommandCenter has SMS but it's under /scripts
5. 3 different places to manage messaging content

---

## Proposed Solution

### Option A: Unified "Content Hub" (Recommended)

Consolidate into ONE page with clear tabs:

```
/content-hub (or /scripts)
├── Calls Tab      - Call scripts (what to say on phone)
├── SMS Tab        - SMS templates/prompts (for texting)
├── Objections Tab - Common objections + winning responses
└── Settings Tab   - Brand voice, compliance rules
```

**Benefits:**
- One place for all messaging content
- Clear separation by channel (calls vs SMS)
- Consistent UI patterns
- Less navigation confusion

**Implementation:**
1. Merge Prompts functionality into new "SMS" tab
2. Keep Scripts as "Calls" tab
3. Keep Objections as standalone tab
4. Brand guidelines moves to Settings tab
5. Retire `/prompts` route (redirect to `/scripts?tab=sms`)

---

### Option B: Keep Separate, Clarify Purpose

Keep Scripts and Prompts separate but:
1. Remove SMS from ScriptsCommandCenter (it's confusing)
2. Rename pages for clarity:
   - "Scripts" → "Call Scripts" (phone conversations only)
   - "Prompts" → "SMS Templates" (texting only)
3. Create shared Objections that both can access
4. Add clear labels/descriptions

**Benefits:**
- Less code change
- Preserves existing URLs
- Faster to implement

---

## Recommended: Option A with Phased Approach

### Phase 1: Quick Wins (Now)
- [ ] Rename "Scripts" header to "Call Scripts"
- [ ] Rename "Prompts Hub" header to "SMS Templates"
- [ ] Add subtitle explaining purpose on each page
- [ ] Update More.jsx menu labels

### Phase 2: Consolidation (Later)
- [ ] Create unified Content Hub with tabs
- [ ] Migrate Prompts features to SMS tab
- [ ] Retire duplicate pages
- [ ] Set up redirects

---

## UI Improvements for Scripts Page

Current Scripts.jsx issues:
1. Basic list view - could use visual categories
2. No quick-copy functionality
3. Stats hidden until you click in
4. Objections button easy to miss

**Proposed Scripts Hub 2.0:**

```
┌─────────────────────────────────────────────┐
│ Call Scripts                          + New │
│ What to say on the phone                    │
├─────────────────────────────────────────────┤
│ [Search...                    ] [Filter ▼]  │
├─────────────────────────────────────────────┤
│                                             │
│ ⭐ TOP PERFORMERS (auto-sorted by success)  │
│ ┌─────────────────────────────────────────┐ │
│ │ 📞 Reactivation - Tradie Check-in       │ │
│ │ 42% success · 127 uses                  │ │
│ │ [Copy Opening] [View Full] [Use Now]    │ │
│ └─────────────────────────────────────────┘ │
│                                             │
│ 📁 COLD CALL (5)                            │
│ ┌─────────────────────────────────────────┐ │
│ │ First Contact - Worker                  │ │
│ │ 31% success · 89 uses        [▸]        │ │
│ └─────────────────────────────────────────┘ │
│ ┌─────────────────────────────────────────┐ │
│ │ First Contact - Contractor              │ │
│ │ 28% success · 64 uses        [▸]        │ │
│ └─────────────────────────────────────────┘ │
│                                             │
│ 📁 FOLLOW UP (3)                            │
│ ...                                         │
│                                             │
│ 📁 OBJECTIONS (Quick Access)                │
│ ┌─────────────────────────────────────────┐ │
│ │ "Too expensive"     → [Copy Response]   │ │
│ │ "Not interested"    → [Copy Response]   │ │
│ │ "Already have..."   → [Copy Response]   │ │
│ └─────────────────────────────────────────┘ │
│                                             │
└─────────────────────────────────────────────┘
```

**Key Changes:**
1. **Top Performers section** - Auto-show highest success rate scripts
2. **Inline copy buttons** - Copy opening/response without opening detail
3. **Category collapsibles** - Group by category, expand/collapse
4. **Quick objections** - Common objections right on the page
5. **Success rate prominent** - Color-coded (green/amber/red)
6. **"Use Now"** - One-click to start call with script ready

---

## Decision: Option 3 - Full Consolidation

**User selected:** Unified Content Hub with tabs

---

## Build Plan: Content Hub

### Final Structure

```
/scripts (Content Hub - main entry)
├── ?tab=calls     - Call Scripts (default)
├── ?tab=sms       - SMS Templates (was Prompts)
├── ?tab=objections - Objection Responses
└── ?tab=settings  - Brand Voice & Compliance
```

**Route changes:**
- `/scripts` → Content Hub (with tabs)
- `/prompts` → Redirect to `/scripts?tab=sms`
- `/scripts/command-center` → Redirect to `/scripts?tab=settings`
- `/scripts/objections` → Redirect to `/scripts?tab=objections`

---

### UI Wireframe

```
┌──────────────────────────────────────────────────────┐
│ Content Hub                               [+ New ▼]  │
│ Everything you need to say                           │
├──────────────────────────────────────────────────────┤
│ [📞 Calls] [💬 SMS] [🛡️ Objections] [⚙️ Settings]   │
├──────────────────────────────────────────────────────┤
│                                                      │
│ ═══ CALLS TAB ═══                                    │
│                                                      │
│ [Search scripts...]                    [Filter ▼]   │
│                                                      │
│ ⭐ TOP PERFORMERS                                    │
│ ┌──────────────────────────────────────────────────┐│
│ │ 📞 Reactivation Check-in          42% success   ││
│ │ "Hey {name}, just checking in..."               ││
│ │ [Copy] [View] [Use on Call]                     ││
│ └──────────────────────────────────────────────────┘│
│                                                      │
│ 📁 COLD CALL (5)                           [−]      │
│   • First Contact - Worker      31% · 89 uses       │
│   • First Contact - Contractor  28% · 64 uses       │
│                                                      │
│ 📁 FOLLOW UP (3)                           [+]      │
│ 📁 CLOSING (2)                             [+]      │
│                                                      │
│ ═══ SMS TAB ═══                                      │
│                                                      │
│ [Search templates...]              [+AI Generate]   │
│                                                      │
│ 📊 Stats: 1,234 sent · 89% delivered · 12% reply    │
│                                                      │
│ ┌──────────────────────────────────────────────────┐│
│ │ Follow-up No Response           Friendly         ││
│ │ "Hey {name}, just wanted to..."                 ││
│ │ 156 sent · 23% reply                            ││
│ │ [Copy] [Edit] [Send to Group]                   ││
│ └──────────────────────────────────────────────────┘│
│                                                      │
│ ═══ OBJECTIONS TAB ═══                               │
│                                                      │
│ [Search objections...]                              │
│                                                      │
│ 🔥 MOST COMMON                                       │
│ ┌──────────────────────────────────────────────────┐│
│ │ "Too expensive"                    87% effective ││
│ │ Response: "I hear you. Most tradies say..."     ││
│ │ [Copy Response] [See Variations]                ││
│ └──────────────────────────────────────────────────┘│
│                                                      │
│ ═══ SETTINGS TAB ═══                                 │
│                                                      │
│ Brand Voice                                [Edit]   │
│ Friendly, direct, Aussie vibes                      │
│ Keywords: mate, hey, cheers                         │
│                                                      │
│ Compliance Rules                           [Edit]   │
│ Banned: guaranteed, promise, best                   │
│ Max exclamation marks: 1                            │
│                                                      │
│ [Test Message Compliance]                           │
│                                                      │
└──────────────────────────────────────────────────────┘
```

---

### Build Steps

#### Step 1: Create ContentHub.jsx
- [ ] New page with 4 tabs (Calls, SMS, Objections, Settings)
- [ ] Tab state from URL param (?tab=calls)
- [ ] Shared header and search
- [ ] Each tab as a component

#### Step 2: Build CallsTab Component
- [ ] Migrate from Scripts.jsx
- [ ] Add "Top Performers" auto-sorted section
- [ ] Add quick-copy buttons
- [ ] Category collapsibles
- [ ] Keep link to ScriptDetail for full view

#### Step 3: Build SMSTab Component
- [ ] Migrate from Prompts.jsx
- [ ] Keep AI generator modal
- [ ] Keep stats summary
- [ ] Keep "Send to Group" flow
- [ ] Quick-copy buttons

#### Step 4: Build ObjectionsTab Component
- [ ] Migrate from Objections.jsx
- [ ] Group by category
- [ ] Show effectiveness scores
- [ ] Quick-copy responses
- [ ] "See variations" expand

#### Step 5: Build SettingsTab Component
- [ ] Migrate from ScriptsCommandCenter.jsx
- [ ] Brand voice editor
- [ ] Compliance rules editor
- [ ] Message compliance tester

#### Step 6: Update Routes
- [ ] Change /scripts to load ContentHub
- [ ] Add redirects for old routes
- [ ] Update More.jsx menu (single "Content Hub" entry)
- [ ] Update any internal navigation links

#### Step 7: Cleanup
- [ ] Remove deprecated pages (or keep as redirects)
- [ ] Update SYSTEM-INTEL.md
- [ ] Test all flows

---

### Files to Create/Modify

**New Files:**
- `admin/src/pages/ContentHub.jsx` - Main page with tabs
- `admin/src/components/content/CallsTab.jsx`
- `admin/src/components/content/SMSTab.jsx`
- `admin/src/components/content/ObjectionsTab.jsx`
- `admin/src/components/content/SettingsTab.jsx`

**Modify:**
- `admin/src/App.jsx` - Update routes
- `admin/src/pages/More.jsx` - Update menu

**Keep (for detail views):**
- `admin/src/pages/ScriptDetail.jsx`
- `admin/src/pages/ScriptBuilder.jsx`
- `admin/src/pages/PromptsSend.jsx`

**Deprecate (redirect):**
- `admin/src/pages/Scripts.jsx` → /scripts?tab=calls
- `admin/src/pages/Prompts.jsx` → /scripts?tab=sms
- `admin/src/pages/ScriptsCommandCenter.jsx` → /scripts?tab=settings
- `admin/src/pages/Objections.jsx` → /scripts?tab=objections

---

### Approval Checklist

Before building, confirm:
- [ ] Tabs: Calls, SMS, Objections, Settings - correct?
- [ ] Main route stays `/scripts` (not new `/content-hub`)?
- [ ] Keep existing detail pages (ScriptDetail, ScriptBuilder, PromptsSend)?
- [ ] "Top Performers" section on Calls tab?
- [ ] AI Generator stays on SMS tab?

---

**Ready for CC2 to build?**
