ProdBot is an AI-powered GitHub Copilot Extension backend that turns POCs into production-ready systems using OpenAI, Retrieval-Augmented Generation (RAG), policy-as-code governance, and a monetization-ready paywall. It now features multi-agent orchestration (Planner → Coder → Reviewer), deterministic static checks, and granular SSE streaming for Copilot chat.
- Supabase-backed subscription/paywall for /agent (Pro/Enterprise tiers; 402 SSE response with Stripe placeholder checkout)
- Multi-agent pipeline (Planner, Coder, Reviewer) on gpt-4o
- Deterministic static analysis (YAML parse, npm audit) feeding the Reviewer
- Sandboxed approval loop with up to 3 self-correction iterations before PR
- Granular SSE events so users see real-time handoffs
- Node.js 18+
- npm
- OpenAI API key (
OPENAI_API_KEY) - GitHub token with repo read access (
GITHUB_TOKEN) - Supabase project (
SUPABASE_URL,SUPABASE_KEY) with asubscriptionstable (columns: github_login, tier, status, trial_expires_at) - Stripe secret (
STRIPE_SECRET) for real checkout (placeholder used by default) - Optional: ngrok to expose localhost for Copilot Extension
npm install
cp .env.example .env
# fill in OPENAI_API_KEY, GITHUB_TOKEN, SUPABASE_URL, SUPABASE_KEY, STRIPE_SECRET
npm startGET /health– livenessPOST /webhook– GitHub webhooksGET /agent?owner=<org>&repo=<name>– SSE stream (paywalled). Events:message/ stage updatestrace/ planner, coder, reviewer, loop, tools stepsresult/ final artifacts + review verdictpayment/ 402 payment-required SSE if subscription is missing
- Paywall middleware resolves GitHub user from
x-github-token, checks Supabase subscriptions. - Planner selects RAG files + deterministic tools.
- Coder drafts CI/CD, Dockerfiles, tests from context.
- Deterministic tools run (YAML parse, npm audit) and feed Reviewer.
- Reviewer enforces
prodbot_rules.yaml(if present) and tool findings. - Approval loop (max 3 tries) until Reviewer returns
APPROVED; otherwise surface gaps.
pip install -r requirements.txt
python app.py run [keyword]
python app.py keywordsOPENAI_API_KEY,GITHUB_TOKENSUPABASE_URL,SUPABASE_KEYSTRIPE_SECRETPRODBOT_TRIGGER_KEYWORD(default ignite)PORT(default 3000)
- Stripe checkout link currently uses placeholder: https://checkout.stripe.com/pay/cs_test_dummy_prodbot
- Deterministic tools are lightweight; extend
src/scanner/local-tools.jsfor more checks as needed.