name: business_plan
description: "Orion develops a full investor-grade business plan for a PROCEED opportunity. Spawned by market_intelligence when recommendation is PROCEED."
debug: true
model: power
system: agent_prompt

agent_prompt:
  - "= identity.md"

sections:
  - agent
  - project
  - rag
  - message
  - instructions

steps:
  - type: think
    max_tokens: 200
    output_key: biz_search_1
    hint: |
      You are developing a business plan for the opportunity described in the task message.
      The market analysis has already been completed -- your task is to find real-world
      business model examples to make the plan concrete and credible.

      Formulate ONE search query to find:
      - Businesses that successfully built this type of company from zero
      - What they did in year 1, their first revenue milestones, how they acquired customers
      - Real founder stories or post-mortems with financial details

      Output ONLY the search query. Nothing else.

  - type: tool
    capability: Tool_WebSearcher
    input_from: biz_search_1
    mode: research
    max_results: 6
    fetch_pages: 3
    optional: true
    output_key: biz_data_1

  - type: think
    max_tokens: 200
    output_key: biz_search_2
    hint: |
      Pass 2 -- Go-to-market channels for this business type.
      Formulate ONE query to find:
      - What marketing channels work in this niche (SEO, paid, affiliate, social, email)
      - Realistic customer acquisition costs (CAC) and conversion rates
      - How long it takes to see results from each channel

      Output ONLY the search query. Nothing else.

  - type: tool
    capability: Tool_WebSearcher
    input_from: biz_search_2
    mode: research
    max_results: 6
    fetch_pages: 2
    optional: true
    output_key: biz_data_2

  - type: think
    max_tokens: 200
    output_key: biz_search_3
    hint: |
      Pass 3 -- Risk intelligence.
      Formulate ONE query to find failures and warnings in this niche:
      - "failed [niche type]" or "[niche] startup mistakes" or "why [business model] fails"
      - What founders warn other founders about
      - Common pitfalls that kill businesses in this space before month 6

      Output ONLY the search query. Nothing else.

  - type: tool
    capability: Tool_WebSearcher
    input_from: biz_search_3
    mode: research
    max_results: 6
    fetch_pages: 2
    optional: true
    output_key: biz_data_3

  - type: think
    max_tokens: 15000
    output_key: business_plan_body
    hint: |
      You are Orion, Director of Research at Crimson Leaf Holdings.
      Produce a full, investor-grade business plan for the opportunity in the task message.

      === MARKET ANALYSIS (foundation -- already completed) ===
      [The market analysis for this opportunity has already been committed to Gitea.
       Use the opportunity details from the task message as your foundation.
       Do not repeat basic market research -- expand on it with the data below.]
      === END MARKET ANALYSIS ===

      === BUSINESS MODEL EXAMPLES ===
      {biz_data_1}
      === END BUSINESS MODEL EXAMPLES ===

      === GO-TO-MARKET CHANNEL RESEARCH ===
      {biz_data_2}
      === END GTM RESEARCH ===

      === RISK AND FAILURE RESEARCH ===
      {biz_data_3}
      === END RISK RESEARCH ===

      CITATION RULES:
      - Every financial figure must have a stated assumption.
      - Every benchmark (CAC, conversion rate, time-to-rank) must cite a source [Title](URL)
        if one was found in the research above.
      - If no source is available, label clearly: "(industry estimate -- unverified)"
      - Target at least 10 cited URLs across the full document.
      - Do NOT invent URLs.

      WRITE THE BUSINESS PLAN IN THE FOLLOWING FORMAT.
      This is a deliverable David will read to decide whether to fund this venture.
      It must be complete, specific, and honest about uncertainty.

      # Business Plan: [Opportunity Name]
      Version 1.0 -- Prepared by Orion, Crimson Leaf Holdings Research Division

      ---

      ## Executive Summary
      [250 words max. Answer these 4 questions in order:
       1. What is this business and who does it serve?
       2. Why does this opportunity exist now?
       3. What does Crimson Leaf need to invest (time, cost, initial effort)?
       4. When is break-even and what does steady-state look like?]

      ## Problem and Solution
      [What specific gap exists in the market?
       What does the target customer fail to get from current options?
       How does this business solve that gap in a defensible way?
       Cite community pain points from the market analysis if available.]

      ## Market Analysis Summary
      [2-3 paragraph summary of the market opportunity.
       TAM, growth rate, key drivers -- all cited.
       This is a summary, not a repeat -- keep it under 300 words.]

      ## Business Model
      [Exactly how does this business make money?
       Revenue streams: primary, secondary.
       Pricing model: subscription / one-time / affiliate commission / advertising.
       Unit economics: revenue per customer, cost to serve, gross margin estimate.
       Cite real pricing benchmarks from research above.]

      ## Revenue Projections
      State all assumptions explicitly before each number.

      ### Month 1-3 (Ramp)
      - Assumption: [what is being built, no revenue yet or minimal]
      - Projected revenue: $[X] -- based on [assumption]
      - Cost: $[Y] -- [what this covers]

      ### Month 4-6 (Initial Traction)
      - Assumption: [N articles/products/units published, traffic starting]
      - Projected revenue: $[X] -- based on [rate] x [volume] x [conversion]
      - Cost: $[Y]

      ### Month 7-12 (Scaling)
      - Assumption: [steady-state content/product velocity]
      - Projected revenue: $[X] -- based on [rate] x [volume] x [conversion]
      - Cost: $[Y]

      ### Break-Even Analysis
      - Monthly fixed cost: $[X]
      - Revenue per unit (article/product/subscriber): $[Y]
      - Break-even units: [X / Y = N units]
      - Break-even timeline: Month [N] at [assumed growth rate]

      ## Competitive Analysis
      [Who wins in this space today, who loses, and why Crimson Leaf wins on AI-speed and cost.
       Reference the competitive landscape from the market analysis.
       Cite competitor URLs where available.]

      ## Go-to-Market Plan (First 90 Days)
      [Based on the GTM channel research above, what is the actual plan?]

      ### Week 1-4: Setup
      - [ ] [Specific task -- domain, affiliate account, Gitea repo, agent config]
      - [ ] [Specific task]
      - [ ] [Specific task]

      ### Month 2: First Content / Product Wave
      - [ ] [Specific deliverable -- N articles, N products, first campaign]
      - [ ] [Specific task]

      ### Month 3: Measure and Iterate
      - [ ] [What metrics are checked]
      - [ ] [What triggers a scale decision vs a cut decision]
      - [ ] Scale threshold: [specific number -- e.g., "If monthly revenue exceeds $200 by day 90, scale"]
      - [ ] Cut threshold: [specific number -- e.g., "If traffic is under 100 visits/month by day 90, reassess"]

      ## Operations Plan
      [Who does what? Be specific about CL agent roles vs David's responsibilities.]
      - Orion: [ongoing research role]
      - Content agents (CLP equivalent): [what they produce]
      - David: [minimal human-in-the-loop requirements -- e.g., approve new affiliate categories, fund hosting]
      - Automation level: [what can run fully automated vs what needs approval]

      ## Risk Register
      [Top 5 risks based on failure research above. Format: Risk | Severity | Mitigation]
      | Risk | Severity (H/M/L) | Mitigation |
      |------|-----------------|------------|
      [Fill 5 rows -- cite failure sources where available]

      ## 90-Day Decision Gate
      At day 90, this venture is evaluated against these criteria:
      - Minimum viable: [specific metric -- traffic, revenue, content volume]
      - If minimum viable is NOT met: [specific action -- pause, pivot, or close]
      - If minimum viable IS met: [specific next investment or scale decision]

      ## Final Recommendation
      **FUND** / **PILOT FIRST** / **DO NOT FUND**

      Rationale: [2-3 sentences. Ground the recommendation in the data above.
      If FUND: what makes the risk acceptable?
      If PILOT FIRST: what small experiment resolves the uncertainty?
      If DO NOT FUND: what fundamental barrier makes this a poor investment?]

      ---

      ## Sources
      [All URLs cited above, numbered, with domain.
       Format: N. [Title](URL) -- domain.com
       Minimum 10 sources for a FUND recommendation.]

  - type: document
    source_step: business_plan_body
    dest_path: "deliverables/business-plans/business-plan-{task.id}.md"
    commit_msg: "research: business plan task={task.id}"

  - type: close
    rag_update: true

  - type: reply
    target: channel
    channel_name: "crimson_leaf:live-feed"
    hint: |
      Write a 3-4 line summary of the business plan just completed.
      Include: opportunity name, final recommendation (FUND/PILOT FIRST/DO NOT FUND),
      the projected 12-month revenue range (conservative to optimistic),
      and one key risk or insight from the risk register.
      Example: "Business plan complete: [name] -- FUND. 12-month projection $X-$Y.
      Key risk: [risk] -- mitigated by [approach]."

adjudication:
  enabled: true
  pass_threshold: 75
  deliverable_type: plan
  criteria:
    financial_realism:
      weight: 40
      description: "Revenue projections state explicit assumptions -- no round numbers without basis. Break-even math is shown."
    citation_density:
      weight: 35
      description: "At least 10 real URLs cited inline. Every benchmark cites a source or is labeled as an estimate."
    actionability:
      weight: 25
      description: "90-day plan has specific tasks and decision thresholds, not vague goals. FUND/PILOT/PASS is grounded in data."
