Progress

Done
Remaining
Overall progress

Completed

GitHub repo
github.com/dmdstrang/meetseb
Railway deployment
Always-on listener, headless Playwright
Slack Socket Mode
Real-time, no polling, no public URL
@seb manage trigger
Any channel → full onboarding flow
Web research
Claude web search → event details
Check-in modal
Block Kit — email, offer, coupon, notes
Coupon creation
Playwright → admin.app.coopah.com
/coupon slash command
Standalone, modal, media source dropdown
Rules engine UI
Next.js, dark theme, 10 config sections
Schedule calculator
Race type + date → send dates
Product spec
Full PRD at /spec.html
Notion hub (code)
SDK written, needs API key + test
Email send/receive (code)
Gmail OAuth written, needs credentials
Reply processing (code)
Claude parsing written, needs Gmail
Chase loop (code)
Logic written, needs Gmail credentials
Escalation (code)
Severity-tagged Slack posts, wired up

Phase 1 — Core Onboarding

Goal: from @seb manage to a sent intro email, Notion hub created, AppFlyer link captured.

In progress 1a — Deploy rules engine to Vercel ~30 min
Connect repo to Vercel, set root dir to rules-engine/
Needs: Vercel account
Enable Vercel KV — auto-sets KV env vars
Set SEB_CONFIG_URL in Railway to Vercel config endpoint
Needs: Vercel URL
Spec live at [url]/spec.html, plan at [url]/plan.html
Next 1b — AppFlyer link creation src/affiliate.js
Automate AppFlyer login + link creation via Playwright
Same pattern as coupon creation. Fills link name, media source, campaign.
src/affiliate.js:28 spec §4
If automation fails → escalate to Slack with details, continue flow
Non-blocking. Post link name, media source, campaign for manual creation.
Next 1c — Notion hub creation src/notion.js
Add NOTION_API_KEY to Railway variables
Needs: Notion integration token
Set notionConfig.partnerHubsParentPageId in rules engine config
Test end-to-end: @seb manage → check-in → hub created in Notion
src/notion.js templates/hub-template.js spec §5
Next 1d — Draft + send intro email src/email.js
Generate Gmail OAuth refresh token (one-time, OAuth playground)
Needs: Google Cloud project + OAuth consent
Add GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET, GMAIL_REFRESH_TOKEN to Railway
Test email draft → Slack approval → send via Gmail
src/email.js src/agent.js spec §6–7
Next 1e — Email template editing Notion + rules engine
Create 6 base template pages in Notion
Each page is a plain-text email template. Claude fetches content and customises per partner.
Add Notion URLs to Template Library section in rules engine
Verify: edit base template in Notion → @seb manage → customised version in partner hub

Phase 2 — Communication Loop

Goal: Seb handles the full back-and-forth with the partner until the email schedule is agreed. Prerequisite: Phase 1d (Gmail OAuth).

Next 2a — Reply detection + parsing src/email.js · src/agent.js
Test Gmail polling for replies (pollForReply())
Code exists. Polls inbox with from:[contact] query. Needs Gmail OAuth from 1d.
src/email.js
Test Claude reply parsing → agreed / questions / pushback
src/agent.js spec §9
Next 2b — Chase loop src/agent.js
Test chase email send after chaseDays with no reply
Up to maxChaseAttempts. Code in monitorAndChase(). Needs Gmail OAuth.
src/agent.js — monitorAndChase() spec §8
Next 2c — Escalation rules end-to-end src/slack.js · src/agent.js
Coupon creation failure escalation
Partner question → Slack with full thread context, pause
Pushback → immediate HIGH escalation, pause
No reply after max chases → escalate + halt
Next 2d — Agreeing email schedule src/agent.js · src/notion.js
Partner agrees → Notion hub schedule updated to "Agreed"
src/agent.js — processReply() src/notion.js — updateScheduleSection()
Slack notification: onboarding complete + hub link

Phase 3 — Tracking & Reporting

Goal: live partner dashboard, Mixpanel data sent to partners, email performance tracking.

Future 3a — Partner status dashboard rules-engine/pages/partners.js
Store partner sessions in Vercel KV on each Seb action
Key: partner:[name]. Value: status, last action, next send date, Notion hub link.
New /partners page in rules engine — live table of all active partners
Future 3b — Mixpanel data to client src/mixpanel.js (new)
Query Mixpanel for signups by affiliate code
Filter by affiliate_code property. Return total signups, plan breakdown, conversion rate.
Claude formats data → email sent to partner contact
Scheduled per config.reporting.cadence or manual via Slack.
Future 3c — Email performance tracking TBD
Decision: stay with Gmail (limited tracking) or switch to Postmark/Resend
Postmark gives open/click rates out of the box. Gmail requires workarounds.
Weekly Slack digest: open rates, clicks, replies per partner
Gated by config.reporting.slackSummary.