# Workflow Design v1 - Proactive Sync System
*Created: 2026-01-23*

## Vision
A proactive system that keeps me in sync with Assaf's work, eliminating memory loss by continuously updating state in Notion and local memory files.

---

## Architecture

### 🎯 Notion as Source of Truth

**Projects Database** (already exists)
- Name, Status, Priority, Due Date, Owner, Area
- Relations: → Contacts, → Meetings, → Tasks

**Tasks Database** (already exists)
- Linked to Projects
- Status: To Do / In Progress / Done
- Source: Manual / Email / Meeting

**Meetings Database** (already exists)
- Transcription summaries
- Action items extracted
- Linked to Projects

**Contacts Database** (already exists)
- Linked to Projects
- Track last contact, follow-up dates

---

## Sync Routines

### ⏰ Hourly Sync (Full Review)
**Cron:** Every hour, 8am-8pm

1. **Notion Projects Scan**
   - Get all projects with Status != "Completed"
   - Check for stale items (no update in 7 days)
   - Check approaching deadlines (within 7 days)

2. **Calendar Check**
   - Today's remaining events
   - Tomorrow's events (prep needed?)
   - Any conflicts or double-bookings

3. **Meeting Review**
   - Recent meetings (last 24h) with Status = "Unprocessed"
   - Extract action items → Create tasks in Notion
   - Mark meeting as "Processed"

4. **Task Prioritization**
   - Sort by: Due date, Project priority, Context
   - Flag overdue tasks

5. **Self-Update**
   - Write summary to memory/YYYY-MM-DD.md
   - Update HEARTBEAT.md with current state

6. **Alert Decision**
   - If urgent items → message Assaf
   - If nothing urgent → silent (HEARTBEAT_OK)

---

### 📧 Email Check (Every 15 mins)
**Cron:** Every 15 minutes

1. **Scan Inbox**
   - Check assafdagancos@gmail.com for new messages
   - Track "last_email_id" to avoid re-processing

2. **Categorize by Project**
   - Match sender/subject to known projects
   - Use keywords: Spoken, White Space, Finally, SparkBeyond, Phat

3. **Priority Assessment**
   - From known VIP contacts → High
   - Has deadline/urgent keywords → High
   - Calendar invite → Check conflicts
   - Newsletter/marketing → Low/Ignore

4. **Action Decision**
   - Urgent from client → Alert Assaf
   - Needs response → Create task in Notion
   - FYI only → Log, no alert

---

### 🌅 Morning Briefing (Daily 8am)
**Cron:** Daily at 8:00am

1. **Today's Schedule**
   - All calendar events with times
   - Prep notes for meetings

2. **Priority Tasks**
   - Top 3-5 tasks for today
   - Any overdue items

3. **Email Summary**
   - Unread count by category
   - Any urgent items from overnight

4. **Reminders**
   - Birthdays coming up
   - Follow-ups due

---

## Data Flow

```
Email → assafdagancos@gmail.com → Email Check → Notion Tasks
Calendar → Google Calendar → Hourly Sync → Notion/Memory
Meetings → Notion Meetings DB → Hourly Sync → Notion Tasks
Projects → Notion Projects DB → Source of Truth
Memory → ~/clawd/memory/*.md → Session Context
```

---

## Project Manager Agent (Curious Endeavor)

### Concept
A specialized agent/workflow for managing CE client work.

### Per-Project Notion Template
- Overview page
- Contacts (client stakeholders)
- Meeting notes
- Deliverables tracker
- Timeline/milestones
- Assets (linked to Google Drive)

### Google Drive Integration
- Scan CE drive folders
- Link files to Notion projects
- Track new/modified files

---

## Agency Structure (TO BE FILLED)
*Assaf to provide details from previous conversation*

- [ ] What agents/roles?
- [ ] How do they coordinate?
- [ ] What's the hierarchy?

---

## Implementation Plan

### Phase 1: Core Sync (This Week)
1. [ ] Create sync script (`~/clawd/scripts/sync.py`)
2. [x] Set up hourly cron job ✅ ID: 622ce6b5-e861-49f5-93ae-fc039616c72b
3. [x] Set up 15-min email check cron ✅ ID: 7ef9919d-851d-4738-a4ff-ceef87fa8257
4. [x] Set up morning briefing cron ✅ ID: c4e34cc9-16b5-4e22-9b18-595f23338eff
5. [ ] Test for 24h, iterate

### Cron Schedule
- **Hourly Sync:** Every hour 8am-8pm (0 8-20 * * *)
- **Email Check:** Every 15 min 8am-10pm (*/15 8-22 * * *)
- **Morning Briefing:** Daily 8am (0 8 * * *)

### Phase 2: Project Templates (Next)
1. [ ] Create Notion project template
2. [ ] Scan Google Drive, map to projects
3. [ ] Populate existing projects

### Phase 3: Agency Agents (After)
1. [ ] Define agent roles
2. [ ] Create sub-agents or workflows
3. [ ] Set up coordination

---

## Open Questions
1. What's the agency structure you mentioned?
2. Which Google Drive folders map to which projects?
3. Any projects that need special handling?
4. Preferred alert times / quiet hours?
