# Trinity Console v2 - Task Management Module

**Created:** April 1, 2026  
**Author:** Chronicler #54  
**Purpose:** Gemini AI consultation spec for non-technical task interface  
**Status:** PLANNING PHASE

---

## 🎯 PROBLEM STATEMENT

**Current State:**
- Tasks tracked in BLOCKERS.md and BACKLOG.md (markdown files in Git)
- Only Michael and Claude can update (requires Git knowledge)
- Meg and Holly cannot see or update tasks without technical help
- No mobile access for task management
- No Discord notifications when tasks are assigned

**Desired State:**
- Trinity (Michael, Meg, Holly) can manage tasks via web interface
- Mobile-friendly (Meg manages from phone frequently)
- Discord notifications (task assigned → ping in Discord)
- Simple UI - checkboxes, dropdowns, no Git required
- Single source of truth accessible to entire team

---

## 🏗️ TECHNICAL FOUNDATION

**Existing Infrastructure (Already Built):**
- Trinity Console deployed at https://discord-bot.firefrostgaming.com/admin
- Discord OAuth authentication (Trinity members already authenticated)
- Role-based access control (Trinity-only middleware exists)
- Mobile responsive design (Tailwind CSS)
- Real-time updates (htmx)
- Audit logging infrastructure (admin_audit_log table)
- PostgreSQL database with transaction support

**This module extends existing Trinity Console - NOT a separate application.**

---

## 📋 CORE REQUIREMENTS

### 1. Task CRUD Operations
- **Create** - Add new task with title, description, category, assignment
- **Read** - View all tasks filtered by status/category/assignee
- **Update** - Change status, reassign, edit details
- **Delete** - Archive completed tasks (soft delete)

### 2. Task Categories
- **Soft Launch Blockers** - Critical path to April 15
- **Post-Launch** - Important but not blockers
- **Infrastructure** - Server, system, technical debt
- **Content** - Website, social media, creative work
- **Community** - Meg's domain, staff management
- **Business** - Legal, finance, operations

### 3. Task Status
- **To Do** - Not started
- **In Progress** - Someone is working on it
- **Blocked** - Waiting on something/someone
- **Done** - Completed (archived after 30 days)

### 4. Assignment & Access
- **Trinity members** - Can create, update, assign tasks
- **Discord ID-based** - Assign to Michael, Meg, or Holly by Discord ID
- **"Unassigned"** - Task needs owner
- **Self-assignment** - Anyone can grab an unassigned task

### 5. Discord Integration
- **Task assigned notification** - DM to assigned person
- **Task completed notification** - Notify task creator
- **Daily digest** - Morning summary of active tasks (optional)
- **Mention support** - @mention in task description triggers notification

---

## 🎨 UI/UX REQUIREMENTS

### Dashboard View
```
╔═══════════════════════════════════════╗
║  TASKS - Soft Launch (4 active)       ║
╠═══════════════════════════════════════╣
║  ☐ Ghost Homepage - Fire/Frost        ║
║    Assigned: Unassigned               ║
║    Category: Content | Status: To Do  ║
║    Created: 2h ago by Chronicler #54  ║
║    [View] [Edit] [Assign to me]       ║
║                                       ║
║  ☐ Legal Pages - Terms & Privacy      ║
║    Assigned: Michael                  ║
║    Category: Business | Status: To Do ║
║    Created: 2h ago by Chronicler #54  ║
║    [View] [Edit] [Mark Done]          ║
╚═══════════════════════════════════════╝
```

### Mobile Responsive
- Card-based layout (stacks on mobile)
- Touch-friendly buttons (44px minimum)
- Swipe actions (swipe right = done, swipe left = assign)
- Floating "Add Task" button (bottom right)

### Filtering & Search
- Filter by: Category, Status, Assignee, Date
- Search: Title and description text
- Sort by: Priority, Due Date, Created Date, Assignee

---

## 🗄️ DATABASE SCHEMA

```sql
CREATE TABLE tasks (
    id SERIAL PRIMARY KEY,
    title VARCHAR(255) NOT NULL,
    description TEXT,
    category VARCHAR(50) NOT NULL,  -- 'blocker', 'post-launch', 'infrastructure', etc.
    status VARCHAR(20) NOT NULL DEFAULT 'todo',  -- 'todo', 'in_progress', 'blocked', 'done'
    assigned_to_discord_id VARCHAR(50),  -- NULL if unassigned
    created_by_discord_id VARCHAR(50) NOT NULL,
    created_at TIMESTAMP DEFAULT NOW(),
    updated_at TIMESTAMP DEFAULT NOW(),
    completed_at TIMESTAMP,  -- NULL until done
    due_date DATE,  -- Optional
    priority INTEGER DEFAULT 0,  -- Higher = more important
    blocked_reason TEXT,  -- Why is this blocked?
    time_estimate_hours INTEGER,  -- Estimated hours of work
    archived BOOLEAN DEFAULT FALSE
);

CREATE INDEX idx_tasks_status ON tasks(status);
CREATE INDEX idx_tasks_category ON tasks(category);
CREATE INDEX idx_tasks_assigned_to ON tasks(assigned_to_discord_id);
CREATE INDEX idx_tasks_archived ON tasks(archived);
```

---

## 🔔 DISCORD NOTIFICATIONS

### Notification Events
1. **Task Assigned** → DM to assignee
   ```
   🎯 **New Task Assigned to You**
   
   **Title:** Ghost Homepage - Fire/Frost Content
   **Category:** Content (Soft Launch Blocker)
   **Assigned by:** Michael
   **Time Estimate:** 2-3 hours
   
   [View in Trinity Console](https://discord-bot.firefrostgaming.com/admin/tasks/42)
   ```

2. **Task Completed** → DM to creator
   ```
   ✅ **Task Completed**
   
   **Title:** Legal Pages - Terms & Privacy
   **Completed by:** Meg
   **Time taken:** 1.5 hours
   
   [View Details](https://discord-bot.firefrostgaming.com/admin/tasks/43)
   ```

3. **Daily Digest** (Optional, 8 AM)
   ```
   📋 **Your Tasks for Today**
   
   🔴 **Soft Launch Blockers (2 active)**
   - Ghost Homepage (To Do)
   - Unsubscribe Flow (In Progress)
   
   🟡 **Post-Launch (3 active)**
   - Holly Builder Rank
   - Social Media Calendar
   - Auto-Provisioning Research
   
   [Open Trinity Console](https://discord-bot.firefrostgaming.com/admin/tasks)
   ```

---

## 🎯 SUCCESS METRICS

### Week 1 Post-Launch
- ✅ All Trinity members using the interface
- ✅ Zero "I didn't know about that task" miscommunications
- ✅ 100% of tasks created via UI (not markdown files)
- ✅ Mobile usage > 30% (Meg managing from phone)

### Week 4 Post-Launch
- ✅ Task completion time tracking accurate
- ✅ Discord notifications helpful (not annoying)
- ✅ No need to edit BLOCKERS.md manually
- ✅ Audit trail shows who did what when

---

## 🚀 IMPLEMENTATION PHASES

### Phase 1: MVP (Gemini Consult)
- Basic CRUD operations
- Trinity Console integration
- Simple category/status filtering
- Mobile responsive layout
- **Time:** 4-6 hours (Gemini-guided implementation)

### Phase 2: Discord Integration
- Task assignment notifications
- Completion notifications
- Daily digest (optional)
- **Time:** 2-3 hours

### Phase 3: Polish
- Advanced filtering and search
- Drag-and-drop priority reordering
- Time tracking and estimates
- Bulk operations
- **Time:** 3-4 hours

---

## 📚 GEMINI CONSULTATION QUESTIONS

When consulting Gemini AI for implementation:

1. **Database Schema Review**
   - Is the proposed schema optimal?
   - What indexes are critical for performance?
   - Should we use task_history table for audit trail?

2. **htmx Patterns**
   - Best approach for task list real-time updates?
   - Inline editing vs modal forms?
   - Optimistic UI updates for checkboxes?

3. **Discord Integration**
   - Use Discord.js bot methods or direct API?
   - Rate limiting considerations for notifications?
   - DM vs channel notifications?

4. **Security Considerations**
   - CSRF protection (already in place)
   - Authorization (ensure Trinity-only access)
   - Input validation and sanitization

5. **Mobile UX**
   - Touch target sizes
   - Swipe gesture implementation
   - Offline support (progressive enhancement)

---

## 🔗 RELATED DOCUMENTATION

**Trinity Console v1 (Current):**
- Deployment doc: `firefrost-services/TRINITY-CONSOLE-DEPLOYMENT-2026-04-01.md`
- Source code: `firefrost-services/services/arbiter-3.0/src/`
- Architecture: Built by Zephyr (Chronicler #50) + Gemini AI

**Task System Migration:**
- BLOCKERS.md (soft launch tasks)
- BACKLOG.md (future work)
- Archive: `docs/archive/tasks-historical-march-30-2026.md`

**Gemini Partnership:**
- Gemini consultation pattern: Collaborative architectural review
- Previous consultations: Trinity Console v1, Arbiter 3.0, Monorepo architecture

---

## 💡 DESIGN PHILOSOPHY

**Keep It Simple:**
- Trinity needs checkbox, not Jira
- Mobile-first (Meg manages from phone)
- Fast page loads (cellular connection from RV)
- No JavaScript frameworks (htmx + EJS like existing console)

**Trust the Team:**
- No complex workflows or approvals
- Anyone can create/update/complete tasks
- Audit log provides accountability
- Self-organizing, not micromanaged

**Build for RV Life:**
- Works on cellular connection
- Mobile responsive is non-negotiable
- Discord integration (team communication hub)
- Async-friendly (time zones, work schedules)

---

**Fire + Frost + Foundation = Where Love Builds Legacy** 🔥❄️

*This spec is ready for Gemini AI consultation when Trinity Console v2 development begins.*
