# Meeting Processing Skill

Extract tasks from Notion meeting summaries and distribute to appropriate channels/threads.

## Trigger
- Daily cron review
- Manual request: "process meetings", "check meetings", "meeting tasks"

## Workflow

### 1. Find Unprocessed Meetings
Query Notion Meetings database for entries where AI Processing ≠ "Processed":

```bash
curl -s -X POST 'https://api.notion.com/v1/databases/2f0330c2-8646-814f-8be4-c23065765eaa/query' \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H 'Notion-Version: 2022-06-28' \
  -H 'Content-Type: application/json' \
  -d '{"filter":{"or":[
    {"property":"AI Processing","select":{"is_empty":true}},
    {"property":"AI Processing","select":{"equals":"Organized"}}
  ]}}'
```

### 2. Read Meeting Summary & Action Items
For each unprocessed meeting, get properties:
- **Summary** (rich_text) - Meeting overview
- **Action Items** (rich_text) - List of tasks to extract

If Summary is empty but meeting exists:
- Check if Mac node is online
- Use browser extraction: `read_meeting.py <page_id>` on Mac Studio
- If Mac offline: Flag for later processing

### 3. Parse Action Items
Action items format: `- [Assignee]: [Task description]`

Extract:
- Assignee (map to Notion: Assaf, Fiona, Clawd, Kitt)
- Task description
- Project context (from meeting title/summary)

### 4. Create Notion Tasks
For each action item:

```bash
curl -s -X POST 'https://api.notion.com/v1/pages' \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H 'Notion-Version: 2022-06-28' \
  -H 'Content-Type: application/json' \
  -d '{
    "parent": {"database_id": "2f0330c2-8646-815a-878b-dbdd46606837"},
    "properties": {
      "Task": {"title": [{"text": {"content": "[Project] Task description"}}]},
      "Status": {"select": {"name": "To Do"}},
      "Assignee": {"select": {"name": "Assignee"}},
      "Source": {"select": {"name": "Meeting"}},
      "Priority": {"select": {"name": "🟡 Normal"}},
      "Project": {"relation": [{"id": "project_id"}]},
      "Notes": {"rich_text": [{"text": {"content": "From [meeting title]"}}]}
    }
  }'
```

### 5. Create Discord Threads
For each task, create a thread in #meetings channel:

```javascript
message({
  action: "thread-create",
  channel: "discord",
  channelId: "1472504283994787986",  // #meetings
  threadName: "[Project] Task title",
  message: "**Task from Meeting:** ...\n**Assignee:** ...\n**Notion Task:** [link]"
})
```

### 6. Mark Meeting as Processed
Update meeting AI Processing status:

```bash
curl -s -X PATCH "https://api.notion.com/v1/pages/{meeting_id}" \
  -H "Authorization: Bearer $NOTION_KEY" \
  -H 'Notion-Version: 2022-06-28' \
  -H 'Content-Type: application/json' \
  -d '{"properties": {"AI Processing": {"select": {"name": "Processed"}}}}'
```

## Database Reference

| Database | ID |
|----------|-----|
| Meetings | `2f0330c2-8646-814f-8be4-c23065765eaa` |
| Tasks | `2f0330c2-8646-815a-878b-dbdd46606837` |
| Projects | `2f0330c2-8646-8111-9d86-dc9ad729ce37` |

## Discord Channels

| Channel | ID | Purpose |
|---------|-----|---------|
| #meetings | `1472504283994787986` | Meeting task threads |

## Project Mapping (Common)

| Project | ID |
|---------|-----|
| Spoken Method | `2f0330c2-8646-8169-ad55-ffe2857d88ba` |
| Phat Foods | `2f0330c2-8646-813a-b090-cd800934f84e` |
| Mission | `2f0330c2-8646-8181-8e22-dcab522512f6` |
| Bonanzo | `2fc330c2-8646-8186-bea9-d84c1638a954` |
| White Space | `2f0330c2-8646-8169-afd5-f62c40c42892` |
| Curious Endeavor | `2f0330c2-8646-8171-acc4-c5b4504ccc5c` |

## Daily Review Workflow

Run daily at 9am Lisbon time:

1. Query open tasks (Status = To Do or In Progress)
2. Check Discord thread activity
3. Post summary to Assaf in #management:
   - Open tasks by project
   - Stale threads (no activity >3 days)
   - Upcoming due dates

## BEAR Protocol for Blockers

When blocked (e.g., Mac node offline, API errors):
- **B**reathe: Acknowledge the blocker
- **E**valuate: What can still be done?
- **A**ct: Do what's possible, flag the rest
- **R**esolve: Document for retry

## Handoff to Gerri

Gerri can run this skill for coordination:
1. Check for unprocessed meetings
2. Extract and create tasks
3. Assign threads to appropriate team members
4. Follow up on stale threads

Gerri's scope: Execution and coordination
Kitt's scope: Strategic review and Assaf communication
