name: alfred-cowork-v2 description: "Unified triage + task board. Syncs all data, classifies across channels, generates tasks for Master/Alfred/Team, presents one action plan. Use when: cowork v2, unified triage, v2." allowed-tools: Read, Write, Edit, Glob, Grep, Bash(git:, pnpm:, npx tsx .claude/skills/), WebFetch, WebSearch, Task, Skill, mcp__claude-in-chrome__
Alfred Cowork V2
One read, one plan, one review. Syncs all data sources, triages across all channels in a single pass, generates a unified task board for Master, Alfred, and Team.
Phase 0: Sync Data
Run Skill: sync-data to fetch fresh data from all sources. This syncs Gmail (API), Calendar (API), iMessage (local DB), and browser sources (WhatsApp, LinkedIn, Facebook) in parallel.
If Master says "skip sync" or data was synced recently (<1 hour ago based on last_synced timestamps), skip this phase and read existing JSONs.
Phase 1: Load World Model
Read silently, do not present:
- Most recent file in
memory/— yesterday's (or last session's) daily log. Monday mornings: also read Friday's log. context/WHO_IS_MASTER.mdcontext/TEAM.md— sender-to-label mapping, topic routing, escalation rules, calibration datacontext/ACTIVE_PROJECTS.md— note blocked projects, priorities- Glob
outputs/*-cowork-v2.md— if same-day rerun exists, load previous output for delta mode
Phase 2: Unified Read
- Read all available sync-data files:
outputs/sync-data/gmail.json(required)outputs/sync-data/gcal.json(required)outputs/sync-data/imessage.json(required)outputs/sync-data/whatsapp.json(required)outputs/sync-data/linkedin.json(if exists)outputs/sync-data/facebook.json(if exists)
- Verify
last_syncedtimestamps. All files should be fresh from Phase 0. If Phase 0 was skipped and any file is >4 hours stale, warn Master and offer to re-sync.
Phase 3: Unified Triage
3A: Mechanical Gmail Actions
For each thread in gmail.json — mechanical, no judgment:
- Check
from/fromNameagainst TEAM.md sender-to-label mapping. For Google notification emails (drive-shares-dm-noreply, etc.), checkfromNamefor the real person. - For external senders, check subject/body against TEAM.md topic-to-label routing.
- Classify using this priority order:
- Master in participants AND replied AND no pending action → DONE
- Matches TEAM.md escalation rule → ACTION_NEEDED
- Sender in sender-to-label mapping → DELEGATED
- Topic in topic-to-label mapping → DELEGATED
- Newsletter/spam/noreply patterns → IGNORED
- Receipt/confirmation/FYI → ARCHIVED
- Else → ACTION_NEEDED
- Build actions:
{ "actions": [{ "threadId": "...", "addLabels": ["..."], "archive": true/false }] }- Archive all except ACTION_NEEDED
- Write
/tmp/alfred-email-actions.json, run:npx tsx .claude/skills/alfred-email-triage/execute.ts --file /tmp/alfred-email-actions.json - Verify success count.
3B: Cross-Channel Entity Resolution
- TEAM.md is the canonical entity directory. Match by email first, then exact display name.
- For non-team contacts, match by exact name across channels. "Hengxin Fun" in iMessage + email = one entity. Do not fuzzy-match — false positives are worse than missed links.
- Build entity groups: one entry per person/project with all cross-channel evidence (which emails, messages, calendar events relate to them).
- Match entity groups to ACTIVE_PROJECTS.md — note project links, status implications.
3C: Team Continuity
- Find the most recent "Worca Team Briefings" thread in gmail.json. Extract open items, per-member assignments, replies.
- For each team member in TEAM.md, check gmail.json for their recent threads (from/to their @worca.io address since last briefing).
- For each open team task from the previous cowork-v2 session, search current sync data for evidence:
- Found reply/completion with specific outcome → RESOLVED
- Found "working on it" / partial activity → IN_PROGRESS
- No activity, <3 days → WAITING
- No activity, >=3 days → STALE
- Items Master resolved via direct email should NOT be re-asked in the team briefing.
- Append one observation per checked task to
outputs/team-observations.jsonl:{"date":"YYYY-MM-DD","member":"name","task":"description","source":"email|whatsapp|imessage|briefing","assigned":"YYYY-MM-DD","status":"done|in_progress|stale|waiting","notes":"one-line context"}
3D: Generate Task Board
- For each entity group (and standalone items), assign ONE status:
ACTION_NEEDED— Master must decide, approve, replyALFRED_TASK— Alfred can handle (draft reply, research, delegate)TEAM_TASK— Assign to team memberWAITING— Ball in someone else's courtDONE— ResolvedNOISE— Personal, promotional, spam, notifications
- Assign priority for actionable items:
- P1 — Today, blocking: deadlines, money, escalations, relationships at risk
- P2 — Today, important: active projects, commitments, follow-ups due
- P3 — This week: non-urgent follow-ups, research, nice-to-have
- For TEAM_TASK items, set owner (from TEAM.md zones), deadline (informed by calibration data if available), and preferred channel.
- For ALFRED_TASK drafts, generate reply text using cross-channel context. Include the thread subject and key context in the draft.
Phase 4: Present Action Plan
- Write
outputs/YYYY-MM-DD-HHmm-cowork-v2.mdwith full audit (every item from every source, grouped by entity, with status and reason). - Present the action plan to Master:
## Action Plan — YYYY-MM-DD
### Carried Forward
[Previous team tasks: RESOLVED / IN_PROGRESS / STALE with evidence]
### P1 — Today, Blocking
[Owner] Action — context. Sources: [channels].
[For ALFRED_TASK: include draft text]
### P2 — Today, Important
[Same format]
### P3 — This Week
[Same format]
### Gmail Auto-Actions
- N threads labeled (breakdown by label)
- N threads archived
- N threads kept in inbox
### Calendar Context
[Today + tomorrow meetings with attendees and prep notes]
### Noise Summary
- N promotional emails archived
- N personal message groups skipped
- N notifications/2FA
- Master reviews. Iterate: approve, edit drafts, reprioritize, add/remove items.
Phase 5: Execute
After Master approval:
Alfred tasks: 30. Present draft replies as formatted text blocks. Master reviews and either: - Approves → Alfred assists sending via Gmail browser (compose reply, paste, confirm before send) - Edits → Alfred incorporates changes, re-presents - Takes over → Master sends manually
Team communication: 31. If team tasks exist, draft briefing email from the approved task board: - ASSIGNMENTS section: each member's tasks with deadlines and context - OPEN ITEMS section: carried-forward items still tracked - RESOLVED section: completed items since last briefing - Use plain text, no markdown tables (Gmail doesn't render them) 32. Present draft to Master. Confirm recipients. 33. After approval: compose in Gmail, confirm with Master before clicking Send.
Master tasks: 34. Surface relevant context as Master works (thread details, links, background). 35. Assist with lookups, research, or browser actions as requested.
Context updates:
36. Update context/ACTIVE_PROJECTS.md if project status changed during session.
37. Write to other agent inboxes if cross-agent work needed.
Phase 6: Close
- "Anything else before we wrap?"
- Surface remaining open items.
- Optional: "Want to run team calibration?" →
Skill: alfred-team-calibrate - Append session summary to
memory/YYYY-MM-DD.md: Format:HHmm cowork-v2: [source counts]. Gmail: N labeled, N archived. Plan: N P1, N P2, N P3. Executed: [key actions]. Open: [remaining items]. - Commit:
cd /Users/tiwen/Code/agent-alfred && git add -A && git commit -m "[alfred] Cowork v2 $(date +%Y-%m-%d) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
Output File
File: outputs/YYYY-MM-DD-HHmm-cowork-v2.md
First line: STATUS: COMPLETE | PARTIAL (reason) | NEEDS INPUT (question)
Sections: Data Sources, Gmail Auto-Actions, Action Plan (full task board as presented), Full Audit (every item from every source with entity grouping and disposition).
Rules
- One read, one plan. All classification happens in Phase 3. Do not invoke separate triage skills.
- Master approves before send. Never send emails, messages, or briefings without explicit approval.
- Calendar is truth. Meeting details come from gcal.json, not email threads.
- Audit every item. Full audit shows every item from every source with disposition.
- Log observations. Every team task status check appends to team-observations.jsonl.
- Same-day delta. If rerunning, carry forward previous classifications, focus on new items.
- Don't spin. If the same error happens twice, stop and tell Master what broke.
- Log decisions incrementally. When Master makes a decision during conversation, append to daily log immediately. Don't wait for Phase 6.