| name | waitlist |
| description | Build a waitlist landing page with email capture, referral mechanics, position tracking, and a drip email welcome sequence. Use before launching a product to build an audience and create launch momentum. |
| argument-hint | <product name and one-line description> |
Waitlist
You are building a waitlist system with email capture, referral mechanics, and automated emails. Work through each phase in order.
Product: {{args}}
Phase 1: Interview
Ask the user (combine related questions):
- Goal: Pure email list, or viral referral loop (users move up the queue by referring friends)?
- Email tool: Resend, Postmark, or ConvertKit for the drip sequence?
- Existing site: Adding to an existing app, or a standalone landing page?
- Design: Does the user have brand assets (colors, logo, copy)?
- Launch timeline: When is the product launching? (affects urgency messaging)
Phase 2: Plan
Define the components:
- Landing page: hero, value prop, social proof (if any), email capture form
- Waitlist table:
email, referral_code, referred_by, position, created_at
- Signup API: validates email, creates record, sends welcome email, returns position
- Referral system: unique link per user, position bump when referrals sign up
- Confirmation page: position, referral link, share buttons
- Welcome email: confirms signup, shows position, shares referral link
- Admin view: count of signups, referral leaderboard (optional)
Phase 3: Database
Create the waitlist table:
CREATE TABLE waitlist (
id TEXT PRIMARY KEY DEFAULT gen_random_uuid(),
email TEXT UNIQUE NOT NULL,
referral_code TEXT UNIQUE NOT NULL DEFAULT substr(md5(random()::text), 1, 8),
referred_by TEXT REFERENCES waitlist(referral_code),
position INTEGER NOT NULL,
created_at TIMESTAMPTZ DEFAULT now()
);
Position is assigned at insert time (use count(*) + 1 or a sequence). If referred, insert the referrer ahead of new organic signups.
Phase 4: API
Create POST /api/waitlist:
- Validate email format
- Check for duplicate: return existing position if already signed up
- Resolve referral code if
?ref=<code> param present
- Insert with calculated position
- Send welcome email asynchronously (don't block the response)
- Return
{ position, referral_link, total_count }
Phase 5: Landing Page
Build a high-converting landing page:
- Hero: Clear headline (what the product does), subheadline (who it's for), email input + CTA button
- Social proof: Early user count, logos, testimonials (or placeholder if pre-launch)
- Features: 3 key benefits with icons
- FAQ: 3–5 common objections answered
- Footer: Privacy policy link, unsubscribe note
After signup, show a confirmation state:
- "You're #[N] on the waitlist!"
- Referral link with copy button
- Pre-written share text for Twitter/X and LinkedIn
- Progress bar showing how many spots are "reserved"
Phase 6: Welcome Email
Send immediately after signup:
- Subject: "You're on the list: here's your spot"
- Position in the waitlist
- Referral link with call to action
- What to expect (launch timeline, what early access means)
- Unsubscribe link
Phase 7: Referral Mechanics
When a referred user signs up:
- Look up the referrer by
referral_code
- Decrease the referrer's position by 1 (move up) for each referral
- Send the referrer a "you moved up!" email (optional: set a threshold like every 5 referrals)
Cap position at 1 to prevent going to 0 or negative.
Phase 8: Verify
Completion Report
- Database schema created
- API endpoint implemented
- Landing page built (URL)
- Welcome email configured
- Referral mechanics working
- Env vars required (names only)