Build Plan
What's built, what's next, and what's blocked. For the full product spec see spec.html.
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
▶
Connect repo to Vercel, set root dir to
rules-engine/Enable Vercel KV — auto-sets KV env vars
Set
SEB_CONFIG_URL in Railway to Vercel config endpointSpec live at
[url]/spec.html, plan at [url]/plan.html
Next
1b — AppFlyer link creation
▶
Automate AppFlyer login + link creation via Playwright
Same pattern as coupon creation. Fills link name, media source, campaign.
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
▶
Add
NOTION_API_KEY to Railway variablesSet
notionConfig.partnerHubsParentPageId in rules engine configTest end-to-end:
@seb manage → check-in → hub created in Notion
Next
1d — Draft + send intro email
▶
Generate Gmail OAuth refresh token (one-time, OAuth playground)
Add
GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET, GMAIL_REFRESH_TOKEN to RailwayTest email draft → Slack approval → send via Gmail
Next
1e — Email template editing
▶
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 hubPhase 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
▶
Test Gmail polling for replies (
pollForReply())Code exists. Polls inbox with
from:[contact] query. Needs Gmail OAuth from 1d.Test Claude reply parsing → agreed / questions / pushback
Next
2b — Chase loop
▶
Test chase email send after
chaseDays with no replyUp to
maxChaseAttempts. Code in monitorAndChase(). Needs Gmail OAuth.
Next
2c — Escalation rules end-to-end
▶
✓
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
▶
Partner agrees → Notion hub schedule updated to "Agreed"
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
▶
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
▶
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
▶
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.