daily-workflow
Orchestrates the full content intelligence pipeline by discovering pending items, dispatching parallel worker subagents, merging AI suggestions, and triggering daily distillation and review.
Prerequisites:
gwsCLI,agent-browser,yt2doc. Refer to../gws-shared/SKILL.mdfor auth. Dispatch Spec & Schemas: See dispatch_spec.md for classification rules, prompt templates, and output formats.
Orchestration Pipeline
[1. Discover & Classify] ──> [2. Pre-create Directories] ──> [3. Parallel Dispatch]
│
[6. Review Suggestions] <── [5. Distill Knowledge] <── [4. Collect & Merge]
Step 1 — Discover and Classify Items
Discover Google Task
Delegatelist:gws tasks tasklists listExtract
DELEGATE_LIST_IDfor list matchingtitle == "Delegate". List pending tasks:gws tasks tasks list --params '{"tasklist": "<DELEGATE_LIST_ID>", "showCompleted": false, "maxResults": 100}'Classify each task into
threads_queue,youtube_queue, orwebsite_queuebased on URL matching rules in dispatch_spec.md.Discover unread newsletters via Gmail API:
gws gmail users messages list --params '{"userId": "me", "q": "label:newsletter is:unread", "maxResults": 1}'Check
resultSizeEstimatefor unread newsletter count.Early exit: If all queues are empty and no unread newsletters exist, log
"No content to process today."and exit.
Step 2 — Pre-create Directories
Create date-stamped output directories for non-empty queues and the suggestion staging area:
mkdir -p data/suggestions_pending
# Pre-create reports/<Type>_YYYY_MM_DD/ for active queues only (Newsletter, Threads, Website, YouTube)
Step 3 — Dispatch Parallel Subagents
Dispatch all content items concurrently in fire-and-forget mode. Do not block on individual completions. Invocations use path-free declarative sub-agent personas, passing runtime parameters in the first user message.
- Newsletters: Fetch email IDs in batches of 10 (
q: "label:newsletter is:unread"). Spawn subagentnewsletter_workerfor eachMESSAGE_ID. - Threads / Website / YouTube: For each item in
threads_queue,website_queue, andyoutube_queue, spawn subagentthreads_worker,website_worker, oryoutube_worker.
Refer to dispatch_spec.md for prompt parameter templates and tracking specs.
Step 4 — Collect Results & Merge Suggestions
Synchronization Barrier: Wait for all dispatched worker subagents to report completion (or failure). Proceed to grading and merging as soon as all worker subagents finish.
Grade & Merge Suggestions: Run subagent
rubric_graderto score each file matchingdata/suggestions_pending/suggestion_*.json:- Approved suggestions score $\ge 4/6$ and append to
data/suggestions_pending.md. - Vetoed or low-scoring suggestions append to
data/suggestions_filtered.md. - Remove processed pending JSON files.
- Approved suggestions score $\ge 4/6$ and append to
Step 5 — Distill Knowledge
Invoke subagent distiller_reviewer (or follow ../daily-distiller/SKILL.md) to synthesize today's reports into reports/distillations/.
Step 6 — Review Suggestions
Invoke subagent distiller_reviewer (or follow ../review-suggestions/SKILL.md) to conduct interactive suggestion review and calibrate user preferences.
Step 7 — Final Summary
Print final summary adhering to the output format in dispatch_spec.md.