Task: Add “Business Plan Generator” (Phase 1)
Goals

Give users a real, actionable plan fast.

Free → concise 1-page “Lean Plan” (sections capped).

Pro → full multi-section plan + export (PDF/Docx) + save to Profile.

Frontend
1) Routing & Nav

Route: /plan

Sidebar (under Brand Kit): “Business Plan”

Feature flag: SHOW_BUSINESS_PLAN=true (env-driven)

2) Page: src/pages/Plan/BusinessPlanPage.tsx

Layout

H1: “Business Plan Generator”

Tabs:

Lean (Free) → one-pager

Full (Pro) → full sections (locked if not subscribed)

Form fields (shared):

Business Name (required)

One-line Description (required, 160 chars max)

Industry (optional)

Target Audience (optional)

Problem (optional)

Solution / Offer (optional)

Advantage / Differentiator (optional)

Pricing model (optional)

Goals timeframe select (3 / 6 / 12 months)

Tone select (Professional, Friendly, Bold, Minimal)

Actions

Generate (primary)

Clear (secondary)

Results

Render plan as sectioned cards:

Lean (Free Output) sections:

Summary (3–4 bullets)

Customer & Problem (3 bullets)

Offer (2–3 bullets)

Go-to-Market (3 bullets)

90-Day Objectives (3 bullets)

Pro Output adds:

Market Overview

Competitive Landscape

Pricing & Revenue Model

Operations Plan

Marketing Plan (channels, budget split)

12-Month Milestones (quarterly)

Basic Financial Snapshot (assumptions + table)

Risks & Mitigations

Buttons on result:

Copy All

Save to Profile (Pro only; disabled for free)

Export PDF / Export Docx (Pro only → opens PaywallModal for free users)

Regenerate / Refine (Pro can pass a short “refine” note)

Paywall placements

Full tab shows lock screen if not subscribed.

Export & Save show Upgrade CTA.

UX states

Loading shimmer on sections during generation.

Inline validation for required fields.

Error banner on API failure.

Frontend Services
src/services/ai/plan.ts
export type PlanMode = "lean" | "full";
export type PlanTone = "Professional"|"Friendly"|"Bold"|"Minimal";

export type PlanRequest = {
  mode: PlanMode;
  businessName: string;
  description: string;
  industry?: string;
  audience?: string;
  problem?: string;
  solution?: string;
  advantage?: string;
  pricing?: string;
  timeframeMonths?: 3|6|12;
  tone?: PlanTone;
};

export type PlanSection = { id: string; title: string; content: string };
export type PlanResponse = {
  mode: PlanMode;
  sections: PlanSection[];
  finance?: {
    assumptions: string[];
    monthly_table?: Array<{ month: string; revenue: number; costs: number; profit: number }>;
  };
};

export async function generatePlan(req: PlanRequest): Promise<PlanResponse> {
  const res = await fetch("/api/ai/plan", { method: "POST", headers: {"Content-Type":"application/json"}, body: JSON.stringify(req) });
  if (!res.ok) throw new Error("Failed to generate plan");
  return res.json();
}

Backend
Endpoint: POST /api/ai/plan

Auth middleware sets req.user and req.user.isPaid.

Validate:

businessName and description required.

mode in {lean, full}. If !isPaid and mode=full → 402/403 with {code:"PAYWALL"}.

Compose messages:

system: “You are Nova, an expert business strategist. Produce practical, concise plans with clear structure and bullet points. Avoid fluff.”

tone seed (based on selection)

user: filled template (see Prompt Templates below)

Model: GPT-4 (or gpt-4o-mini per config)

Temperature 0.7, top_p 0.9.

Return strictly JSON conforming to PlanResponse.

If JSON parse fails, retry once with “Return valid JSON only.”

Server-side caps

Free/Lean: 5 sections max, each ≤ 110 words.

Pro/Full: up to 10 sections, each ≤ 180 words + optional finance table (12 rows max).

Rate limit

20 req/min/IP (env).

Logging

ai.plan.requested, ai.plan.succeeded, ai.plan.failed (no PII).

Export Service (Pro)
POST /api/ai/plan/export

Accepts { plan: PlanResponse, format: "pdf"|"docx" }

Requires isPaid.

Renders:

Cover: Business Name + subtitle “Business Plan”

Table of Contents (Full mode only)

Each section as H2 + paragraphs/bullets

Finance table if present

Use server-side PDF/Docx generator (existing lib or pdfkit/docx).

Return file download.

Profile Save (Pro)

POST /api/plan/save → persists under user’s Project/Brand with timestamp and mode.

List past plans on Profile page (read-only preview).

Prompt Templates
Tone Seeds

Professional: “Concise, confident, and credible. Avoid slang.”

Friendly: “Warm, encouraging, plain language.”

Bold: “Punchy, decisive, action-oriented. Short sentences.”

Minimal: “Spare, clear, no filler. Prefer bullets.”

Lean Plan (Free) — User Template
Create a one-page lean business plan with the following sections ONLY:
1) Summary
2) Customer & Problem
3) Offer
4) Go-to-Market
5) 90-Day Objectives

Constraints:
- Max 110 words per section.
- Use bullets where helpful.
- Be practical and specific.
- Do NOT include financial tables.

Business:
Name: {{businessName}}
One-line Description: {{description}}
Industry: {{industry||"General"}}
Audience: {{audience||"General"}}
Problem: {{problem||"N/A"}}
Solution: {{solution||"N/A"}}
Advantage: {{advantage||"N/A"}}
Pricing: {{pricing||"N/A"}}
Timeframe Months: {{timeframeMonths||3}}
Tone: {{tone||"Professional"}}

Return valid JSON ONLY:
{
  "mode": "lean",
  "sections": [
    {"id":"summary","title":"Summary","content":"..."},
    {"id":"customer_problem","title":"Customer & Problem","content":"..."},
    {"id":"offer","title":"Offer","content":"..."},
    {"id":"gtm","title":"Go-to-Market","content":"..."},
    {"id":"objectives_90d","title":"90-Day Objectives","content":"..."}
  ]
}

Full Plan (Pro) — User Template
Create a concise multi-section business plan. Use clear headings and bullets. Keep each section under 180 words.

Sections:
- Executive Summary
- Market Overview
- Competitive Landscape
- Customer Persona & Problem
- Offer & Value Proposition
- Pricing & Revenue Model
- Marketing Plan (channels + monthly split)
- Operations Plan
- Milestones (12 months, grouped quarterly)
- Risks & Mitigations
- Financial Snapshot (assumptions + monthly table for 12 months: revenue, costs, profit)

Business:
Name: {{businessName}}
One-line Description: {{description}}
Industry: {{industry||"General"}}
Audience: {{audience||"General"}}
Problem: {{problem||"N/A"}}
Solution: {{solution||"N/A"}}
Advantage: {{advantage||"N/A"}}
Pricing: {{pricing||"N/A"}}
Timeframe Months: {{timeframeMonths||12}}
Tone: {{tone||"Professional"}}

Return valid JSON ONLY:
{
  "mode": "full",
  "sections": [
    {"id":"exec_summary","title":"Executive Summary","content":"..."},
    {"id":"market","title":"Market Overview","content":"..."},
    {"id":"competition","title":"Competitive Landscape","content":"..."},
    {"id":"persona_problem","title":"Customer Persona & Problem","content":"..."},
    {"id":"offer","title":"Offer & Value Proposition","content":"..."},
    {"id":"pricing","title":"Pricing & Revenue Model","content":"..."},
    {"id":"marketing","title":"Marketing Plan","content":"..."},
    {"id":"ops","title":"Operations Plan","content":"..."},
    {"id":"milestones","title":"Milestones (12 Months)","content":"..."},
    {"id":"risks","title":"Risks & Mitigations","content":"..."}
  ],
  "finance": {
    "assumptions": ["...","..."],
    "monthly_table": [
      {"month":"M1","revenue":0,"costs":0,"profit":0},
      ...
      {"month":"M12","revenue":0,"costs":0,"profit":0}
    ]
  }
}

Acceptance Criteria

Route /plan visible when SHOW_BUSINESS_PLAN=true.

Free users can generate Lean (single page); Full tab shows paywall.

Pro users can generate Full plan; can Export PDF/Docx and Save to Profile.

Strict JSON contract respected; UI renders sections reliably.

Error, loading, and validation states implemented.

Analytics events:

plan_generate_clicked { mode, isPaid }

plan_generate_success { mode, sections }

plan_export_clicked { format }

plan_save_clicked

paywall_opened { source: "plan" }

Copy (UI)

Subtitle: “Turn your idea into a clear, actionable plan.”

Lean empty state: “Describe your business and generate a one-page plan.”

Paywall CTA: “Unlock the full business plan with exports, milestones, and a financial snapshot.”