Skip to content

Repository files navigation

brainstormIdeas

Daily research and startup idea pipeline powered by Claude CLI. Alternates between deep academic research and startup idea generation, delivering reports via email and WhatsApp.

Quick start

npm install
cp .env.example .env   # add your Gmail app password
npm start               # run today's scheduled domain

.env setup

GMAIL_USER=you@gmail.com
GMAIL_APP_PASSWORD=xxxx xxxx xxxx xxxx
WHATSAPP_RECIPIENTS=+91XXXXXXXXXX,+91YYYYYYYYYY
  • GMAIL_APP_PASSWORD — Generate at Google Account > Security > App Passwords
  • WHATSAPP_RECIPIENTS — Comma-separated phone numbers (with country code). Used as defaults by /brainstorm and /send-whatsapp.

Claude Code commands

These slash commands run inside Claude Code (claude CLI).

/brainstorm

Research a topic or generate scored startup ideas, then send results via WhatsApp.

/brainstorm "<topic>" [--startup] [--concise | --detailed] [--email] [--dry-run]
Flag Description
(no flag) Research mode (default). Deep academic research — no idea generation or scoring.
--startup Startup mode. Full pipeline: research competitors/gaps, generate ideas, score them.
--concise (default) Quick research (~2 min). WhatsApp summary under 500 chars.
--detailed Full pipeline (~7 min). Deep research, HTML reports. ~2000 char WhatsApp summary. Opens summary.html when done.
--email Also send results via email (WhatsApp always sends).
--dry-run Skip all sending, just show output.

Examples:

/brainstorm "quantum computing"
/brainstorm "AI for pet care" --startup --detailed
/brainstorm "niche SaaS for dentists" --concise --email
/brainstorm "vertical SaaS" --startup --detailed --email
/brainstorm "AI for pet care" --detailed --email --dry-run

/send-whatsapp

Send a WhatsApp message directly, no research involved.

/send-whatsapp "message"                    # send to default recipients
/send-whatsapp "+91XXXXXXXXXX" "message"    # specific number
/send-whatsapp "+91XXX,+91YYY" "message"    # multiple numbers

Both commands send to the default recipient list when no number is specified.

Full pipeline

The pipeline has two modes, controlled by the mode column in config/topics.csv or the --startup CLI flag:

Research mode (default)

Deep academic research — no idea generation or scoring. Four stages:

  1. Research — web search for findings, players, trends, challenges (~7-12 min)
  2. Report — render HTML research report via Handlebars template
  3. Email — send to configured recipients via Gmail SMTP
  4. WhatsApp — send summary to configured numbers

Startup mode (--startup)

Full startup pipeline — research, ideation, and scoring. Six stages:

  1. Research — web search for competitors, gaps, trends, funding (~7-12 min)
  2. Ideation — generate 3-5 niche startup ideas (~3-5 min)
  3. Scoring — score each idea on 5 weighted criteria (~3-5 min)
  4. Reports — render HTML email + summary via Handlebars templates
  5. Email — send to configured recipients via Gmail SMTP
  6. WhatsApp — send summary to configured numbers
npm start                                        # today's topic (mode from CSV)
npm run dry-run                                  # test without sending
npm start -- --topic "AI for dentists"           # custom topic (research mode)
npm start -- --topic "pet tech" --startup        # custom topic (startup mode)
npm start -- --topic "pet tech" --dry-run
npm start -- --topic "pet tech" --skip-send

--dry-run vs --skip-send

Both flags skip the email and WhatsApp stages in the pipeline, but they signal different intent:

Flag Use case Progress label
--dry-run You explicitly want no sending (testing) "skipped — dry run"
--skip-send An external caller (e.g. /brainstorm --detailed) is handling sending itself "skipped — external"

/brainstorm --detailed runs the pipeline with --skip-send so it can handle WhatsApp delivery directly, without the progress UI showing "dry run". When --email is also passed, the pipeline runs without --skip-send so it sends email itself — only WhatsApp is handled externally.

Note: whatsapp.txt is always written to the output folder regardless of send flags, so external callers can read it directly.

Scoring criteria

Criterion Weight
Problem Severity 0.25
Market Timing 0.20
Execution Feasibility 0.20
Defensibility 0.20
Revenue Clarity 0.15

Each idea is scored 1-10 per criterion, then ranked by weighted total.

Topic scheduling

CSV schedule (primary)

config/topics.csv is the primary topic source. Each row has a date, topic, mode, and used timestamp:

date,topic,mode,used
2026-03-26,Vertical SaaS for veterinary clinics,research,
2026-03-27,AI-powered compliance tools for small businesses,startup,
2026-03-28,Digital tools for independent pharmacies,research,
2026-03-29,Niche marketplaces for skilled trades,startup,
Column Description
date Run date (YYYY-MM-DD)
topic Research domain
mode research (academic deep-dive) or startup (ideas + scoring). Defaults to research if empty.
used Auto-filled with timestamp after the topic runs

The CSV alternates between research and startup modes so you get variety each day.

YAML fallback

If no CSV match is found, config/domains.yaml is used as a fallback. Three tiers, highest priority wins:

Priority Key How it works
1 calendar Exact date match (e.g. "2026-03-25": "AI finance tools")
2 weekly Day of week (e.g. monday: "FinTech")
3 rotation Cycles through a list based on day-of-year

YAML fallback always runs in research mode. Use --startup CLI flag to override.

calendar:
  "2026-03-25": "AI-powered personal finance tools"

weekly:
  monday: "FinTech and personal finance"
  tuesday: "HealthTech and digital wellness"
  wednesday: "EdTech and skill development"
  thursday: "Climate tech and sustainability"
  friday: "Creator economy and content tools"
  saturday: null   # skip
  sunday: null

rotation:
  - "AI agents for small business"
  - "Food tech and restaurant automation"
  - "Real estate technology"
  # ... cycles through list

settings:
  recipient: "you@example.com, teammate@example.com"
  sender: "you@gmail.com"
  max_ideas: 3
  top_ideas: 3
  whatsapp_recipient: "+91XXXXXXXXXX"

Configuration

Setting Location Purpose
Gmail credentials .env SMTP auth for sending emails
WhatsApp recipients .envWHATSAPP_RECIPIENTS Comma-separated phone numbers for /brainstorm and /send-whatsapp
Email recipients config/domains.yamlsettings.recipient Comma-separated email list
WhatsApp (pipeline) config/domains.yamlsettings.whatsapp_recipient Phone number used by npm start pipeline
Daily topics config/domains.yamlcalendar / weekly / rotation Domain scheduling
Idea count config/domains.yamlsettings.max_ideas Number of ideas to generate

WhatsApp setup

One-time pairing to link your WhatsApp account:

node scripts/pair-whatsapp.mjs
  1. A QR code appears in the terminal
  2. Open WhatsApp on your phone → Linked DevicesLink a Device
  3. Scan the QR code
  4. Keep the script running until pairing completes
  5. Credentials are saved to ~/.whatsapp-mcp/ for future use

After pairing, /brainstorm and /send-whatsapp can send messages without re-scanning.

Output

Each run creates a date-stamped folder in output/:

Research mode:

output/2026-03-26/
├── research.json    # academic research (findings, players, trends)
├── email.html       # rendered research report
├── summary.html     # same as email.html for research mode
├── whatsapp.txt     # WhatsApp message text
└── status.json      # pipeline progress and timing

Startup mode:

output/2026-03-27/
├── research.json    # market research (competitors, gaps, trends)
├── ideas.json       # generated startup ideas
├── scored.json      # ideas with scores and ranking
├── email.html       # rendered email report
├── summary.html     # lighter summary view
├── whatsapp.txt     # WhatsApp message text
└── status.json      # pipeline progress and timing

Custom topics get their own folder: output/2026-03-25-ai-for-dentists/.

Daily automation (macOS)

The pipeline runs automatically every day at 8:00 AM via a macOS LaunchAgent. The Mac wakes at 7:55 AM to ensure it's ready.

Setup

# 1. Schedule Mac to wake at 7:55 AM daily
sudo pmset repeat wake MTWRFSU 07:55:00

# 2. LaunchAgent (already installed at ~/Library/LaunchAgents/com.user.myscript.plist)
launchctl load ~/Library/LaunchAgents/com.user.myscript.plist

How it works

  1. 7:55 AM — Mac wakes from sleep (pmset)
  2. 8:00 AM — LaunchAgent triggers scripts/run.sh
  3. run.sh — runs the pipeline with --skip-send, then sends WhatsApp via Baileys
  4. Mode — auto-detected from CSV mode column (research or startup)

Verify

# Check wake schedule
pmset -g sched

# Check LaunchAgent is loaded
launchctl list | grep com.user.myscript

# Check logs
tail -50 output/cron.log

Project structure

├── src/
│   ├── index.ts              # main pipeline entry point (research + startup modes)
│   ├── config.ts             # domain scheduling logic
│   ├── topicResolver.ts      # CSV/fallback/YAML topic + mode resolution
│   ├── researcher.ts         # web research via Claude CLI (academic + startup prompts)
│   ├── ideaGenerator.ts      # idea generation + scoring (startup mode only)
│   ├── emailBuilder.ts       # Handlebars HTML rendering (research + startup templates)
│   ├── emailSender.ts        # Gmail SMTP sender
│   ├── whatsappFormatter.ts  # WhatsApp message formatting (academic + startup formats)
│   ├── whatsappSender.ts     # WhatsApp via Claude CLI + MCP
│   ├── progress.ts           # terminal progress UI
│   └── types.ts              # TypeScript types + Zod schemas
├── config/
│   ├── topics.csv            # date-wise topic schedule with mode column
│   ├── domains.yaml          # fallback topic scheduling + settings
│   └── fallback-topics.txt   # random fallback topics
├── scripts/
│   ├── send-whatsapp.mjs     # direct WhatsApp sender
│   ├── pair-whatsapp.mjs     # one-time WhatsApp pairing
│   └── run.sh                # daily automation wrapper script
├── templates/
│   ├── email.html            # startup email template (Handlebars)
│   ├── summary.html          # startup summary template
│   └── research.html         # academic research report template
├── output/                   # generated reports (per-day)
├── .env                      # Gmail + WhatsApp credentials
└── package.json

About

Automated research and idea pipeline with Claude API, email (SMTP), and WhatsApp integrations

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages