From Zero to $42K/Month in 90 Days with AI

1) Product spec + acceptance criteria (paste into Cursor Chat)

You are my senior product+engineering copilot. We are building a web app similar to “CodeGuide”: it generates a structured “knowledge base” (project documentation + constraints) that users can attach to AI coding tools to reduce hallucinations.

Write a crisp PRD and an engineering plan with:

  • Core user: AI builders using Cursor / AI IDEs who need a reliable project context.

  • MVP scope: (1) auth, (2) create project, (3) collect inputs, (4) generate docs, (5) export knowledge base, (6) basic billing.

  • Non-goals: no “full IDE”, no code execution, no team collaboration for MVP.

  • Key screens: Landing, Dashboard, Project Wizard, Knowledge Base viewer/editor, Export modal, Billing, Settings.

  • Acceptance criteria: bullet list that is testable for each screen/feature.

Keep it pragmatic. Output in markdown with sections: Overview, Users, Jobs-to-be-done, MVP, Data Model, User Flows, Acceptance Criteria, Risks & mitigations.

2) Tech stack + repo scaffolding (Cursor prompt)

Act as staff engineer. Create the initial scaffold for a production-ready SaaS:

Tech:

  • Next.js 14+ (App Router) + TypeScript

  • Tailwind + shadcn/ui

  • Supabase (Postgres + Storage)

  • Clerk for auth

  • Stripe for billing

  • OpenAI API (and architecture to swap models later)

Requirements:

  • Provide exact folder structure.

  • Add env var schema/validation.

  • Add linting/formatting.

  • Add server actions or route handlers where appropriate.

  • Create a clean layout + basic nav.

Output:

  1. Step-by-step terminal commands.

  2. Files to create with full contents for the important ones.

  3. A “run locally” checklist.

3) Database schema (projects, sources, generated docs, exports, subscriptions)

Design the Supabase Postgres schema for this app.

Entities:

  • users (Clerk user id as external key)

  • projects

  • project_sources (text inputs, links metadata, uploaded files metadata)

  • generated_documents (each doc: type, content, version, created_at)

  • export_bundles (zip or JSON export record)

  • usage_events (track token usage & generations)

  • subscriptions (Stripe customer/subscription ids)

Need:

  • SQL migrations (create tables + indexes).

  • RLS policies so users can only access their own records.

  • Suggestions for Postgres enum types for doc_type and source_type.

  • A short note on how storage buckets should be organized for uploads and exports.

4) Auth wiring + protected routes

Implement Clerk auth in Next.js App Router.

Requirements:

  • Public pages: /, /pricing, /login, /signup

  • Protected pages: /app/* (dashboard + project pages)

  • Middleware for route protection.

  • User record provisioning: when a Clerk user signs in for the first time, create a matching row in public.users (or equivalent) in Supabase.

Deliver:

  • The exact code changes and files to create/update.

  • A short test plan (how I verify auth and provisioning works).

5) Dashboard + project CRUD

Build the MVP dashboard UI and server logic.

Features:

  • /app dashboard lists projects (name, updated_at, doc coverage %, status).

  • Create project modal (name + optional description).

  • Project page: /app/projects/[id] with tabs:

    • “Wizard” (collect inputs)

    • “Knowledge Base” (view/edit docs)

    • “Exports” (download history)

    • “Settings” (delete project)

Tech notes:

  • Use server actions/route handlers for CRUD.

  • Use Supabase RLS + Clerk user id.

  • Use shadcn/ui components.

Provide the code and ensure it compiles.

6) “Project Wizard” (collect the context that prevents hallucinations)

Implement a Project Wizard that collects structured context for AI coding tools.

Wizard steps:

  1. Product brief: one-liner, target user, problem, success metric.

  2. Requirements: core features, non-goals, edge cases, constraints.

  3. Tech choices: stack, deployment, integrations, data storage.

  4. Data model: entities + relationships (simple form).

  5. UX: key screens + flows.

  6. Existing assets: allow adding sources:

    • Paste text

    • Upload files (pdf/md/txt)

    • Add links (store URL + optional notes; do not scrape for now)

Output should save each step to project_sources with proper source_type.

Also generate a “completeness score” (0–100) based on which fields are filled.

Deliver code for UI + persistence + storage uploads.

7) Document generation pipeline (the “knowledge base”)

Create the doc generation system.

Docs to generate (doc_type enum):

  • README

  • PRODUCT_SPEC

  • ARCHITECTURE

  • DATA_MODEL

  • API_CONTRACTS

  • UI_FLOWS

  • CODING_STANDARDS

  • “AI_RULES” (explicit constraints to reduce hallucinations)

Requirements:

  • A “Generate Knowledge Base” button triggers generation.

  • Use OpenAI API on the server (streaming optional).

  • Build prompts that incorporate wizard inputs + sources, and produce consistent markdown.

  • Store each generated doc as a record with versioning.

  • Track usage_events with tokens estimate (best effort).

Deliver:

  • Prompt templates.

  • Server route/action implementation.

  • UI to show progress and results.

  • A safe retry mechanism per-doc (regenerate a single doc).

8) Knowledge Base editor (light editing + diff/version)

Implement Knowledge Base viewer/editor:

  • List docs on left, selected doc content on right.

  • Markdown preview + edit mode.

  • Save edits creates a new version (do not overwrite old versions).

  • Show a simple diff between the last two versions (line-based diff is fine).

  • Add “pin” field: user can pin a preferred version for export.

Provide code + any small helper utilities needed.

9) Export formats for Cursor / AI IDE attachment

Implement exports so users can attach the knowledge base to AI coding tools.

Export options:

  1. “/docs” folder bundle: multiple markdown files (one per doc_type) + an index.md.

  2. “single file” bundle: one consolidated KNOWLEDGE_BASE.md.

  3. “cursor rules” export: generate a .cursorrules (or equivalent) style file from AI_RULES + CODING_STANDARDS + key constraints.

Requirements:

  • Export creates an export_bundles record.

  • Store export artifact in Supabase Storage, provide signed download URL.

  • Exports page shows history (date, format, pinned versions used).

Deliver implementation with code.

10) Billing (Stripe) with a simple plan gate

Add Stripe billing.

Plans:

  • Free: 1 project, 10 generations/month, no exports.

  • Pro ($29/mo): 10 projects, 200 generations/month, exports enabled.

Requirements:

  • Pricing page with CTA.

  • Stripe Checkout + customer portal.

  • Webhook handler to sync subscription status to subscriptions table.

  • Feature gating in app (disable buttons + show upgrade prompts).

  • Usage counter reset monthly (simple scheduled job approach; propose a pragmatic solution).

Deliver code + webhook security notes.

11) Polish: onboarding, empty states, and guardrails

Add product polish:

  • Onboarding checklist on dashboard: (1) create project, (2) complete wizard, (3) generate docs, (4) export.

  • Great empty states + tooltips explaining “why this reduces hallucinations”.

  • Validation on wizard forms.

  • Basic rate limiting (per user) to prevent runaway OpenAI costs.

  • Error handling patterns + logging approach.

Deliver targeted code changes (not a rewrite).

12) Deploy to Vercel + Supabase prod checklist

Prepare for production deployment:

  • Vercel deployment steps

  • Environment variables checklist

  • Supabase migration workflow

  • Storage bucket + policies checklist

  • Webhook endpoint setup

  • Basic monitoring suggestions

Output as a launch checklist I can follow.