Automation Cheatsheet

EyeFly Digital · ops · v2 · 2026-05-06
Platform split: pg_cron = pure SQL · GitHub Actions = Python ETL (free, real logs, version-controlled) · Claude Cowork = LLM + MCP calls
01

Supabase pg_cron — Pure SQL

JobScheduleWhat it does
project-pct-refresh1:30 AM dailySQL UPDATE: recalculates percent_complete on all projects from task status
02

GitHub Actions — Python ETL

Repo: eyefly-automations (private) — one YAML per workflow, scripts/runner.py bootstraps brain.py + fetches impl from system_files.

WorkflowScheduleimpl_nameWhat it does
01-meta-insights-by-page-sync1 AM dailymeta_insights_by_page_sync_implPulls Meta ad metrics per page → brain.ad_metrics
02-ad-spend-sheet-sync2 AM dailyad_spend_sheet_syncSyncs ad spend totals → Google Sheets
03-ghl-convo-sync6 AM dailyghl_convo_syncSyncs GHL conversation threads → brain
04-ghl-contact-sync3 AM dailyghl_contact_sync_implDelta-syncs GHL contact tags → brain.ghl_contacts_current
05-ghl-tag-reconciliation ⚠️7 AM dailyghl_tag_reconciliation_implCross-checks GHL “transferred” tags vs Leads CSV → ops_anomalies (impl must be seeded first)
06-ghl-eyefly-appointments-sync6 AM dailyghl_eyefly_appointments_sync_implSyncs EyeFly appointment outcomes from GHL
07-sales-ops-appointments-sync5 AM dailysales_ops_appointments_sync_implSyncs sales ops appointment data
08-marketing-blank2-daily-sync1 AM dailymarketing_blank2_sync_implMarketing performance data sync
09-gcal-prefetch-morning7:40 AM dailygcal_prefetch_implPre-fetches GCal events → brain for morning briefings
10-ghl-convo-classifier1 AM dailyghl_convo_classifier_implClassifies GHL conversations by type/outcome
13-ad-anomaly-detector2:30 PM dailyad_anomaly_detector_implDetects spend/CPL anomalies vs 7d baseline → ops_anomalies
14-page-id-drift-reconciler11 PM Sundaypage_id_drift_reconcilerReconciles Facebook page ID drift across clients
15 → pg_cronMigrated to Supabase pg_cron
16-daily-token-tracker1 AM Mondaydaily_token_tracker_implTracks Claude API token usage vs budget
17-telegram-digest-morning7:30 AM dailytelegram_digest_implAssembles + sends morning Telegram digest from taskos_events
18-daily-ghl-pipeline-snapshot5 AM dailyghl_pipeline_snapshot_implSnapshots GHL pipeline stage counts
20-ad-spend-pacing9 AM dailyad_spend_pacing_impl + pacing_dashboard_implPacing check (7d/28d vs target) + deploys pacing dashboard
21-client-health-scores11 PM dailyclient_health_scores_implScores all clients: CPL trend + bot QA + tickets → client_health
22-taskos-hygiene2 AM dailytaskos_hygiene_implMulti-pass: dedup tasks, archive zombies, advance stages, Slack digest

Missing (not yet created): 11-complaint-capture-classify, 12-complaint-capture-route

03

Claude Cowork — MCP-Required Tasks

TaskScheduleCategoryWhat it doesWhy Claude
eyefly-clients1-daily-campaign-update2 PM dailyQA / MonitoringMeta Ads MCP: entity changes + yesterday KPIs + anomalies → campaign_snapshotsNeeds Meta Ads MCP + reasoning
daily-bot-qa9 AM M–FQA / Monitoringghl-convo-audit Mode 1: scores all client bots 24h window → bot_qa_scoresGHL MCP + LLM scoring
daily-support-tickets-review8 AM M–FQA / MonitoringScans client Slack channels, classifies P0–P3 → support_ticketsSlack MCP + LLM classification
ops-sheet-health-check10 AM + 2 PM dailyQA / MonitoringReads 4 dept ops sheets, flags anomalies → ops_anomaliesGWS MCP + LLM pattern detection
bot-errors-scraper-and-rebuild9 AM dailyQA / MonitoringScrapes #aibot_needs-review, classifies 8 error types, rebuilds dashboardSlack MCP + LLM classification
daily-shutdown-capture9 AM, 1 PM, 5 PMAlerts / DigestsSweeps team Slack DMs + channels → brain.tasksSlack MCP required
ea-morning-brief7:45 AM M–FAlerts / DigestsTop task + P0/P1 + off-pace clients → TelegramLLM synthesis
slack-digest-morning7:46 AM dailyAlerts / DigestsONE THING + active projects + calendar → Akash Slack DMLLM synthesis + GCal MCP
brain-query-botEvery 30 min 9–6 M–FAlerts / DigestsPolls #ai-assistant for questions, queries brain, responds in-threadLLM + Slack MCP
daily-ads-dashboard2 AM dailyDashboard DeployBuilds + deploys ads health dashboard to CF Pages; Telegram on red-set changeLLM diff + CF deploy
cs-cpl-wow-dashboard-weekly6 AM dailyDashboard DeployRebuilds CPL WoW dashboard all nichesCF deploy + brain query
client-kanban-dashboard-rebuild11 AM dailyDashboard DeployRebuilds client risk kanban from client_health/bot_qa/opsCF deploy
campaign-scoreboard-mobile-daily6:37 AM dailyDashboard DeployMobile client performance dashboardCF deploy
winning-ads-ledger-daily3 PM dailyDashboard DeployTop CPL + lead winners by niche; Telegram on top-5 changeCF deploy
project-completeness-audit7 AM MondayHygieneLLM-clusters session_handoffs → initiatives, cross-refs vs projectsLLM clustering
mission-control-hygiene6 AM dailyHygieneBrain data hygiene: dedup, association rollup, stale flagBrain writes
taskos-engine-weekly1 AM TuesdayHygienePer-pipeline health, velocity, cross-pipeline blockers, capacityLLM synthesis
context-optimizer-corpus-monthly7 AM 1st of monthHygieneCorpus audit: gap detection, topic clustering, contradiction checksLLM analysis
ideas-triage-tuesday9 AM TuesdayHygieneSurfaces + greenlight/archive/defer ideas inboxLLM + interactive
auto-bye-stale-sessions11:30 PM dailySession OpsSynthesizes handoff rows for sessions Akash didn’t byeLLM synthesis
heartbeat-coverage-audit6:15 AM MondayInfra / HealthAudits which scheduled tasks have Heartbeat protocolScript + Slack
cowork-disk-cleanup3 AM SundayInfra / HealthClears Cowork VM sandbox disk to prevent ENOSPCBash — must run inside Cowork
04

Category Legend

CategoryWhat it covers
Data Sync & ETLPure data movement — GHL→brain, Meta→brain, GCal→brain. No LLM needed. pg_cron or GitHub Actions.
QA / MonitoringAudits bot conversations, ad performance, ops sheets for quality issues.
Alerts & DigestsPushes notifications to Slack / Telegram — morning briefs, P0/P1 escalations.
Dashboard DeployRebuilds Cloudflare Pages dashboards from live brain data.
HygieneDeduplication, archiving, normalization — keeps brain data clean.
Session OpsClaude session lifecycle — stale handoffs, context management.
Infra / HealthSystem health — disk, token budget, heartbeat coverage.
05

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

06

GitHub Actions Setup

One-time steps
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
GitHub Secret needed

Settings → Secrets and variables → Actions → New repository secret

SecretValue
SUPABASE_DB_URLpostgresql://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.