Class: Aidp::Planning::Generators::MarketingReportGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/aidp/planning/generators/marketing_report_generator.rb

Overview

Generates marketing report with key messages and differentiators Uses AI to craft compelling narratives from technical features Follows Zero Framework Cognition (ZFC) pattern

Instance Method Summary collapse

Constructor Details

#initialize(ai_decision_engine:, config: nil) ⇒ MarketingReportGenerator

Returns a new instance of MarketingReportGenerator.



12
13
14
15
# File 'lib/aidp/planning/generators/marketing_report_generator.rb', line 12

def initialize(ai_decision_engine:, config: nil)
  @ai_decision_engine = ai_decision_engine
  @config = config || Aidp::Config.agile_config
end

Instance Method Details

#format_as_markdown(report) ⇒ String

Format marketing report as markdown

Parameters:

  • report (Hash)

    Marketing report structure

Returns:

  • (String)

    Markdown formatted marketing report



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/aidp/planning/generators/marketing_report_generator.rb', line 50

def format_as_markdown(report)
  Aidp.log_debug("marketing_report_generator", "format_as_markdown")

  output = ["# Marketing Report", ""]
  output << "**Generated:** #{report[:metadata][:generated_at]}"
  output << "**Key Messages:** #{report[:metadata][:key_message_count]}"
  output << "**Differentiators:** #{report[:metadata][:differentiator_count]}"
  output << ""

  output << "## Overview"
  output << ""
  output << report[:overview]
  output << ""

  output << "## Value Proposition"
  output << ""
  output << "### Headline"
  output << ""
  output << report[:value_proposition][:headline]
  output << ""
  output << "### Subheadline"
  output << ""
  output << report[:value_proposition][:subheadline]
  output << ""
  output << "### Core Benefits"
  output << ""
  report[:value_proposition][:core_benefits].each do |benefit|
    output << "- #{benefit}"
  end
  output << ""

  output << "## Key Messages"
  output << ""
  report[:key_messages].each_with_index do |message, idx|
    output << "### #{idx + 1}. #{message[:title]}"
    output << ""
    output << message[:description]
    output << ""
    output << "**Supporting Points:**"
    message[:supporting_points].each do |point|
      output << "- #{point}"
    end
    output << ""
  end

  output << "## Differentiators"
  output << ""
  output << "What sets us apart from competitors:"
  output << ""
  report[:differentiators].each_with_index do |diff, idx|
    output << "### #{idx + 1}. #{diff[:title]}"
    output << ""
    output << diff[:description]
    output << ""
    output << "**Competitive Advantage:** #{diff[:advantage]}"
    output << ""
  end

  output << "## Target Audience"
  output << ""
  report[:target_audience].each do |segment|
    output << "### #{segment[:name]}"
    output << ""
    output << "**Description:** #{segment[:description]}"
    output << ""
    output << "**Pain Points:**"
    segment[:pain_points].each do |pain|
      output << "- #{pain}"
    end
    output << ""
    output << "**Our Solution:**"
    segment[:our_solution].each do |solution|
      output << "- #{solution}"
    end
    output << ""
  end

  output << "## Positioning"
  output << ""
  output << "**Category:** #{report[:positioning][:category]}"
  output << ""
  output << "**Statement:** #{report[:positioning][:statement]}"
  output << ""
  output << "**Tagline:** #{report[:positioning][:tagline]}"
  output << ""

  output << "## Success Metrics"
  output << ""
  report[:success_metrics].each do |metric|
    output << "- **#{metric[:name]}:** #{metric[:target]}"
    output << "  - Measurement: #{metric[:measurement]}"
    output << ""
  end

  output << "## Messaging Framework"
  output << ""
  output << "| Audience | Message | Channel | Call to Action |"
  output << "|----------|---------|---------|----------------|"
  report[:messaging_framework].each do |msg|
    output << "| #{msg[:audience]} | #{msg[:message]} | #{msg[:channel]} | #{msg[:cta]} |"
  end
  output << ""

  output << "## Launch Checklist"
  output << ""
  report[:launch_checklist].each_with_index do |item, idx|
    output << "- [ ] **#{item[:task]}**"
    output << "  - Owner: #{item[:owner]}"
    output << "  - Timeline: #{item[:timeline]}"
    output << ""
  end

  output.join("\n")
end

#generate(mvp_scope:, feedback_analysis: nil) ⇒ Hash

Generate marketing report from MVP scope and feedback

Parameters:

  • mvp_scope (Hash)

    MVP scope definition

  • feedback_analysis (Hash) (defaults to: nil)

    User feedback analysis (optional)

Returns:

  • (Hash)

    Marketing report structure



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/aidp/planning/generators/marketing_report_generator.rb', line 21

def generate(mvp_scope:, feedback_analysis: nil)
  Aidp.log_debug("marketing_report_generator", "generate",
    feature_count: mvp_scope[:mvp_features]&.size || 0,
    has_feedback: !feedback_analysis.nil?)

  # Use AI to generate marketing materials
  marketing_report = generate_marketing_with_ai(mvp_scope, feedback_analysis)

  {
    overview: marketing_report[:overview],
    value_proposition: marketing_report[:value_proposition],
    key_messages: marketing_report[:key_messages],
    differentiators: marketing_report[:differentiators],
    target_audience: marketing_report[:target_audience],
    positioning: marketing_report[:positioning],
    success_metrics: marketing_report[:success_metrics],
    launch_checklist: marketing_report[:launch_checklist],
    messaging_framework: marketing_report[:messaging_framework],
    metadata: {
      generated_at: Time.now.iso8601,
      key_message_count: marketing_report[:key_messages]&.size || 0,
      differentiator_count: marketing_report[:differentiators]&.size || 0
    }
  }
end