Automation Cheatsheet
Supabase pg_cron — Pure SQL
| Job | Schedule | What it does |
|---|---|---|
| project-pct-refresh | 1:30 AM daily | SQL UPDATE: recalculates percent_complete on all projects from task status |
GitHub Actions — Python ETL
Repo: eyefly-automations (private) — one YAML per workflow, scripts/runner.py bootstraps brain.py + fetches impl from system_files.
| Workflow | Schedule | impl_name | What it does |
|---|---|---|---|
| 01-meta-insights-by-page-sync | 1 AM daily | meta_insights_by_page_sync_impl | Pulls Meta ad metrics per page → brain.ad_metrics |
| 02-ad-spend-sheet-sync | 2 AM daily | ad_spend_sheet_sync | Syncs ad spend totals → Google Sheets |
| 03-ghl-convo-sync | 6 AM daily | ghl_convo_sync | Syncs GHL conversation threads → brain |
| 04-ghl-contact-sync | 3 AM daily | ghl_contact_sync_impl | Delta-syncs GHL contact tags → brain.ghl_contacts_current |
| 05-ghl-tag-reconciliation ⚠️ | 7 AM daily | ghl_tag_reconciliation_impl | Cross-checks GHL “transferred” tags vs Leads CSV → ops_anomalies (impl must be seeded first) |
| 06-ghl-eyefly-appointments-sync | 6 AM daily | ghl_eyefly_appointments_sync_impl | Syncs EyeFly appointment outcomes from GHL |
| 07-sales-ops-appointments-sync | 5 AM daily | sales_ops_appointments_sync_impl | Syncs sales ops appointment data |
| 08-marketing-blank2-daily-sync | 1 AM daily | marketing_blank2_sync_impl | Marketing performance data sync |
| 09-gcal-prefetch-morning | 7:40 AM daily | gcal_prefetch_impl | Pre-fetches GCal events → brain for morning briefings |
| 10-ghl-convo-classifier | 1 AM daily | ghl_convo_classifier_impl | Classifies GHL conversations by type/outcome |
| 13-ad-anomaly-detector | 2:30 PM daily | ad_anomaly_detector_impl | Detects spend/CPL anomalies vs 7d baseline → ops_anomalies |
| 14-page-id-drift-reconciler | 11 PM Sunday | page_id_drift_reconciler | Reconciles Facebook page ID drift across clients |
| 15 → pg_cron | — | — | Migrated to Supabase pg_cron |
| 16-daily-token-tracker | 1 AM Monday | daily_token_tracker_impl | Tracks Claude API token usage vs budget |
| 17-telegram-digest-morning | 7:30 AM daily | telegram_digest_impl | Assembles + sends morning Telegram digest from taskos_events |
| 18-daily-ghl-pipeline-snapshot | 5 AM daily | ghl_pipeline_snapshot_impl | Snapshots GHL pipeline stage counts |
| 20-ad-spend-pacing | 9 AM daily | ad_spend_pacing_impl + pacing_dashboard_impl | Pacing check (7d/28d vs target) + deploys pacing dashboard |
| 21-client-health-scores | 11 PM daily | client_health_scores_impl | Scores all clients: CPL trend + bot QA + tickets → client_health |
| 22-taskos-hygiene | 2 AM daily | taskos_hygiene_impl | Multi-pass: dedup tasks, archive zombies, advance stages, Slack digest |
Missing (not yet created): 11-complaint-capture-classify, 12-complaint-capture-route
Claude Cowork — MCP-Required Tasks
| Task | Schedule | Category | What it does | Why Claude |
|---|---|---|---|---|
| eyefly-clients1-daily-campaign-update | 2 PM daily | QA / Monitoring | Meta Ads MCP: entity changes + yesterday KPIs + anomalies → campaign_snapshots | Needs Meta Ads MCP + reasoning |
| daily-bot-qa | 9 AM M–F | QA / Monitoring | ghl-convo-audit Mode 1: scores all client bots 24h window → bot_qa_scores | GHL MCP + LLM scoring |
| daily-support-tickets-review | 8 AM M–F | QA / Monitoring | Scans client Slack channels, classifies P0–P3 → support_tickets | Slack MCP + LLM classification |
| ops-sheet-health-check | 10 AM + 2 PM daily | QA / Monitoring | Reads 4 dept ops sheets, flags anomalies → ops_anomalies | GWS MCP + LLM pattern detection |
| bot-errors-scraper-and-rebuild | 9 AM daily | QA / Monitoring | Scrapes #aibot_needs-review, classifies 8 error types, rebuilds dashboard | Slack MCP + LLM classification |
| daily-shutdown-capture | 9 AM, 1 PM, 5 PM | Alerts / Digests | Sweeps team Slack DMs + channels → brain.tasks | Slack MCP required |
| ea-morning-brief | 7:45 AM M–F | Alerts / Digests | Top task + P0/P1 + off-pace clients → Telegram | LLM synthesis |
| slack-digest-morning | 7:46 AM daily | Alerts / Digests | ONE THING + active projects + calendar → Akash Slack DM | LLM synthesis + GCal MCP |
| brain-query-bot | Every 30 min 9–6 M–F | Alerts / Digests | Polls #ai-assistant for questions, queries brain, responds in-thread | LLM + Slack MCP |
| daily-ads-dashboard | 2 AM daily | Dashboard Deploy | Builds + deploys ads health dashboard to CF Pages; Telegram on red-set change | LLM diff + CF deploy |
| cs-cpl-wow-dashboard-weekly | 6 AM daily | Dashboard Deploy | Rebuilds CPL WoW dashboard all niches | CF deploy + brain query |
| client-kanban-dashboard-rebuild | 11 AM daily | Dashboard Deploy | Rebuilds client risk kanban from client_health/bot_qa/ops | CF deploy |
| campaign-scoreboard-mobile-daily | 6:37 AM daily | Dashboard Deploy | Mobile client performance dashboard | CF deploy |
| winning-ads-ledger-daily | 3 PM daily | Dashboard Deploy | Top CPL + lead winners by niche; Telegram on top-5 change | CF deploy |
| project-completeness-audit | 7 AM Monday | Hygiene | LLM-clusters session_handoffs → initiatives, cross-refs vs projects | LLM clustering |
| mission-control-hygiene | 6 AM daily | Hygiene | Brain data hygiene: dedup, association rollup, stale flag | Brain writes |
| taskos-engine-weekly | 1 AM Tuesday | Hygiene | Per-pipeline health, velocity, cross-pipeline blockers, capacity | LLM synthesis |
| context-optimizer-corpus-monthly | 7 AM 1st of month | Hygiene | Corpus audit: gap detection, topic clustering, contradiction checks | LLM analysis |
| ideas-triage-tuesday | 9 AM Tuesday | Hygiene | Surfaces + greenlight/archive/defer ideas inbox | LLM + interactive |
| auto-bye-stale-sessions | 11:30 PM daily | Session Ops | Synthesizes handoff rows for sessions Akash didn’t bye | LLM synthesis |
| heartbeat-coverage-audit | 6:15 AM Monday | Infra / Health | Audits which scheduled tasks have Heartbeat protocol | Script + Slack |
| cowork-disk-cleanup | 3 AM Sunday | Infra / Health | Clears Cowork VM sandbox disk to prevent ENOSPC | Bash — must run inside Cowork |
Category Legend
| Category | What it covers |
|---|---|
| Data Sync & ETL | Pure data movement — GHL→brain, Meta→brain, GCal→brain. No LLM needed. pg_cron or GitHub Actions. |
| QA / Monitoring | Audits bot conversations, ad performance, ops sheets for quality issues. |
| Alerts & Digests | Pushes notifications to Slack / Telegram — morning briefs, P0/P1 escalations. |
| Dashboard Deploy | Rebuilds Cloudflare Pages dashboards from live brain data. |
| Hygiene | Deduplication, archiving, normalization — keeps brain data clean. |
| Session Ops | Claude session lifecycle — stale handoffs, context management. |
| Infra / Health | System health — disk, token budget, heartbeat coverage. |
Platform Decision Rules
✓ Use pg_cron when: pure SQL UPDATE/INSERT/DELETE, no Python, no external API calls
✓ Use GitHub Actions when: Python ETL, pure data movement, no MCP calls, no LLM needed
✓ Use Claude Cowork when: needs Slack/GHL/Meta MCP, LLM reasoning, multi-step with branching
✕ Never put in Claude: tasks that are just fetch data → transform → write to Postgres
✕ Never put in GitHub Actions: tasks that read/write Slack channels, score conversations, or synthesize
GitHub Actions Setup
cd _deliverables/2026-05-06/eyefly-automations git init && git add . && git commit -m "initial commit" git remote add origin git@github.com:akash-stpierre/eyefly-automations.git git push -u origin main
Settings → Secrets and variables → Actions → New repository secret
| Secret | Value |
|---|---|
| SUPABASE_DB_URL | postgresql://postgres.anpfztbuabyxazukslpj:abPunn00se.@aws-1-us-east-2.pooler.supabase.com:6543/postgres |
All other credentials fetched from vault.decrypted_secrets via the brain DSN — no additional secrets needed.