@shashwatgtmalpha/craft-content-mcp 1.0.1 โ†’ 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +130 -103
  2. package/dist/case-study-generator.d.ts +12 -0
  3. package/dist/case-study-generator.d.ts.map +1 -0
  4. package/dist/case-study-generator.js +373 -0
  5. package/dist/case-study-generator.js.map +1 -0
  6. package/dist/content-improver.d.ts +8 -0
  7. package/dist/content-improver.d.ts.map +1 -0
  8. package/dist/content-improver.js +238 -0
  9. package/dist/content-improver.js.map +1 -0
  10. package/dist/content-repurposer.d.ts +8 -0
  11. package/dist/content-repurposer.d.ts.map +1 -0
  12. package/dist/content-repurposer.js +423 -0
  13. package/dist/content-repurposer.js.map +1 -0
  14. package/dist/index.js +86 -1236
  15. package/dist/index.js.map +1 -1
  16. package/dist/newsletter-builder.d.ts +10 -0
  17. package/dist/newsletter-builder.d.ts.map +1 -0
  18. package/dist/newsletter-builder.js +411 -0
  19. package/dist/newsletter-builder.js.map +1 -0
  20. package/dist/sales-enablement.d.ts +11 -0
  21. package/dist/sales-enablement.d.ts.map +1 -0
  22. package/dist/sales-enablement.js +455 -0
  23. package/dist/sales-enablement.js.map +1 -0
  24. package/dist/testimonial-capture.d.ts +11 -0
  25. package/dist/testimonial-capture.d.ts.map +1 -0
  26. package/dist/testimonial-capture.js +424 -0
  27. package/dist/testimonial-capture.js.map +1 -0
  28. package/dist/thought-leadership.d.ts +10 -0
  29. package/dist/thought-leadership.d.ts.map +1 -0
  30. package/dist/thought-leadership.js +475 -0
  31. package/dist/thought-leadership.js.map +1 -0
  32. package/dist/tools.d.ts +3 -0
  33. package/dist/tools.d.ts.map +1 -0
  34. package/dist/tools.js +210 -0
  35. package/dist/tools.js.map +1 -0
  36. package/dist/utils.d.ts +40 -0
  37. package/dist/utils.d.ts.map +1 -0
  38. package/dist/utils.js +289 -0
  39. package/dist/utils.js.map +1 -0
  40. package/dist/webinar-script.d.ts +11 -0
  41. package/dist/webinar-script.d.ts.map +1 -0
  42. package/dist/webinar-script.js +457 -0
  43. package/dist/webinar-script.js.map +1 -0
  44. package/package.json +15 -18
@@ -0,0 +1,238 @@
1
+ import { analyzeContent, generateImprovedVersion, countWords, avgWordsPerSentence, calculateReadability } from './utils.js';
2
+ // Default goals by content type
3
+ const DEFAULT_GOALS = {
4
+ blog_post: 'Engage readers and drive shares/comments',
5
+ email: 'Get opens, clicks, and responses',
6
+ landing_page: 'Convert visitors to signups/purchases',
7
+ social_post: 'Drive engagement and shares',
8
+ sales_email: 'Get meetings booked',
9
+ product_description: 'Clearly explain value and drive purchases',
10
+ press_release: 'Get media coverage',
11
+ case_study: 'Build credibility and drive inquiries'
12
+ };
13
+ export function generateContentImprover(args) {
14
+ const content = args.content;
15
+ const contentType = args.content_type || 'blog_post';
16
+ const goal = args.goal || DEFAULT_GOALS[contentType] || 'Improve clarity and engagement';
17
+ const audience = args.audience || 'general audience';
18
+ const tonePreference = args.tone_preference || 'keep_same';
19
+ // Note if goal was auto-assigned
20
+ const goalNote = args.goal ? '' : ` *(auto-assigned based on content type)*`;
21
+ // Perform actual analysis
22
+ const analysis = analyzeContent(content, contentType, goal);
23
+ const readability = calculateReadability(content);
24
+ const wordCount = countWords(content);
25
+ const avgSentenceLength = avgWordsPerSentence(content);
26
+ // Generate improved version
27
+ const improvedContent = generateImprovedVersion(content, analysis);
28
+ // Create specific recommendations based on analysis
29
+ const priorityFixes = [];
30
+ // Sort by lowest scores first
31
+ const dimensions = [
32
+ { name: 'Clarity', ...analysis.clarity },
33
+ { name: 'Structure', ...analysis.structure },
34
+ { name: 'Engagement', ...analysis.engagement },
35
+ { name: 'Goal Alignment', ...analysis.goalAlignment }
36
+ ].sort((a, b) => a.score - b.score);
37
+ for (const dim of dimensions) {
38
+ if (dim.score < 7 && dim.suggestions.length > 0) {
39
+ priorityFixes.push(`**${dim.name}** (${dim.score}/10): ${dim.suggestions[0]}`);
40
+ }
41
+ }
42
+ let output = `# ๐Ÿ“ Content Analysis & Improvement Report
43
+
44
+ ## Content Overview
45
+ - **Type:** ${contentType.replace(/_/g, ' ')}
46
+ - **Goal:** ${goal}${goalNote}
47
+ - **Audience:** ${audience}
48
+ - **Word Count:** ${wordCount}
49
+ - **Avg Sentence Length:** ${avgSentenceLength} words
50
+
51
+ ---
52
+
53
+ ## ๐Ÿ“Š Overall Score: ${analysis.overall.score}/10 (${analysis.overall.rating})
54
+
55
+ | Dimension | Score | Status |
56
+ |-----------|-------|--------|
57
+ | Clarity | ${analysis.clarity.score}/10 | ${analysis.clarity.score >= 7 ? 'โœ…' : analysis.clarity.score >= 5 ? 'โš ๏ธ' : 'โŒ'} |
58
+ | Structure | ${analysis.structure.score}/10 | ${analysis.structure.score >= 7 ? 'โœ…' : analysis.structure.score >= 5 ? 'โš ๏ธ' : 'โŒ'} |
59
+ | Engagement | ${analysis.engagement.score}/10 | ${analysis.engagement.score >= 7 ? 'โœ…' : analysis.engagement.score >= 5 ? 'โš ๏ธ' : 'โŒ'} |
60
+ | Goal Alignment | ${analysis.goalAlignment.score}/10 | ${analysis.goalAlignment.score >= 7 ? 'โœ…' : analysis.goalAlignment.score >= 5 ? 'โš ๏ธ' : 'โŒ'} |
61
+
62
+ ---
63
+
64
+ ## ๐Ÿ“– Readability Analysis
65
+
66
+ **Flesch Score:** ${readability.score}/100 (${readability.grade})
67
+
68
+ ${readability.analysis}
69
+
70
+ ---
71
+
72
+ ## ๐Ÿ” Detailed Analysis
73
+
74
+ ### Clarity Issues Found
75
+ ${analysis.clarity.issues.length > 0
76
+ ? analysis.clarity.issues.map(i => `- โš ๏ธ ${i}`).join('\n')
77
+ : '- โœ… No major clarity issues'}
78
+
79
+ ### Structure Issues Found
80
+ ${analysis.structure.issues.length > 0
81
+ ? analysis.structure.issues.map(i => `- โš ๏ธ ${i}`).join('\n')
82
+ : '- โœ… Well-structured content'}
83
+
84
+ ### Engagement Issues Found
85
+ ${analysis.engagement.issues.length > 0
86
+ ? analysis.engagement.issues.map(i => `- โš ๏ธ ${i}`).join('\n')
87
+ : '- โœ… Engaging content'}
88
+
89
+ ### Goal Alignment Issues Found
90
+ ${analysis.goalAlignment.issues.length > 0
91
+ ? analysis.goalAlignment.issues.map(i => `- โš ๏ธ ${i}`).join('\n')
92
+ : '- โœ… Well-aligned with goals'}
93
+
94
+ ---
95
+
96
+ ## ๐ŸŽฏ Priority Fixes (Do These First)
97
+
98
+ ${priorityFixes.length > 0
99
+ ? priorityFixes.map((fix, i) => `${i + 1}. ${fix}`).join('\n\n')
100
+ : 'โœ… No critical fixes needed - your content is in good shape!'}
101
+
102
+ ---
103
+
104
+ ## โœจ Improved Version
105
+
106
+ Below is an auto-improved version addressing common issues:
107
+
108
+ ---
109
+
110
+ ${improvedContent}
111
+
112
+ ---
113
+
114
+ ## ๐Ÿ“‹ Before/After Comparison
115
+
116
+ ### Original First Sentence:
117
+ > ${content.split(/[.!?]/)[0]?.trim() || 'N/A'}
118
+
119
+ ### Suggested Opening:
120
+ > ${generateBetterHook(content, contentType, goal)}
121
+
122
+ ---
123
+
124
+ ## ๐Ÿ’ก ${contentType.replace(/_/g, ' ').toUpperCase()}-Specific Tips
125
+
126
+ ${getContentTypeTips(contentType, goal)}
127
+
128
+ ---
129
+
130
+ ## โœ… Quick Checklist
131
+
132
+ ${generateChecklist(contentType, goal, analysis)}
133
+ `;
134
+ return output;
135
+ }
136
+ function generateBetterHook(content, contentType, goal) {
137
+ const goalLower = goal.toLowerCase();
138
+ if (goalLower.includes('convert') || goalLower.includes('sign up')) {
139
+ return `Struggling with [problem]? Here's the solution that [benefit] in just [timeframe].`;
140
+ }
141
+ if (goalLower.includes('educate') || goalLower.includes('inform')) {
142
+ return `Everything you need to know about [topic] โ€” explained simply.`;
143
+ }
144
+ if (goalLower.includes('engage') || contentType === 'social_post') {
145
+ return `Unpopular opinion: [contrarian take on topic]. Here's why...`;
146
+ }
147
+ if (contentType === 'sales_email') {
148
+ return `[Name], I noticed [specific observation about their company]. Quick question: [relevant question]?`;
149
+ }
150
+ if (contentType === 'landing_page') {
151
+ return `[Primary benefit] without [primary pain point]. Get started in [timeframe].`;
152
+ }
153
+ return `[Hook that addresses reader's main pain point or desire]`;
154
+ }
155
+ function getContentTypeTips(contentType, goal) {
156
+ const tips = {
157
+ blog_post: `
158
+ - **Ideal length:** 1,500-2,500 words for SEO
159
+ - **Subheadings:** Every 300-400 words
160
+ - **Include:** At least one image, list, or quote
161
+ - **CTA placement:** Middle and end of post
162
+ - **Meta description:** 150-160 characters summarizing value`,
163
+ email: `
164
+ - **Subject line:** 6-10 words, personalized if possible
165
+ - **Preview text:** Complement (don't repeat) subject line
166
+ - **Length:** 50-125 words for highest engagement
167
+ - **CTA:** One clear, specific action
168
+ - **P.S. line:** Second CTA or urgency element`,
169
+ landing_page: `
170
+ - **Headline:** Clear benefit in 10 words or less
171
+ - **Subheadline:** Expand on how you deliver the benefit
172
+ - **Social proof:** Above the fold
173
+ - **CTA:** Visible without scrolling, repeated 3x
174
+ - **Form fields:** Minimize - each field reduces conversion`,
175
+ social_post: `
176
+ - **Hook:** First line must stop the scroll
177
+ - **Format:** Short paragraphs, line breaks, emojis sparingly
178
+ - **Engagement:** Ask a question or opinion
179
+ - **Hashtags:** 3-5 relevant tags
180
+ - **CTA:** What action do you want?`,
181
+ sales_email: `
182
+ - **Subject:** Personalized, curiosity-driven
183
+ - **Opening:** About THEM, not you
184
+ - **Value prop:** One clear benefit
185
+ - **Proof:** Brief case study or metric
186
+ - **CTA:** Specific, low-commitment ask
187
+ - **Length:** Under 150 words`,
188
+ product_description: `
189
+ - **Lead with benefits:** What problem it solves
190
+ - **Features as proof:** How it delivers benefits
191
+ - **Social proof:** Reviews, testimonials, ratings
192
+ - **Sensory language:** Help them visualize using it
193
+ - **Urgency:** Stock levels, time-limited offers`,
194
+ press_release: `
195
+ - **Headline:** Newsworthy angle, not promotional
196
+ - **Lead paragraph:** Who, what, when, where, why
197
+ - **Quotes:** From executives and/or customers
198
+ - **Boilerplate:** Company description at end
199
+ - **Contact:** Clear media contact info`,
200
+ case_study: `
201
+ - **Structure:** Challenge โ†’ Solution โ†’ Results
202
+ - **Specifics:** Named customer, real numbers
203
+ - **Quotes:** Direct customer testimonials
204
+ - **Visuals:** Screenshots, graphs, before/after
205
+ - **CTA:** "See how you can achieve similar results"`
206
+ };
207
+ return tips[contentType] || `
208
+ - Focus on your primary goal: ${goal}
209
+ - Match tone to audience expectations
210
+ - Include a clear call to action
211
+ - Use specific examples and data`;
212
+ }
213
+ function generateChecklist(contentType, goal, analysis) {
214
+ const checks = [];
215
+ // Universal checks
216
+ checks.push(analysis.clarity.score >= 7 ? 'โœ…' : 'โฌœ' + ' Clear, jargon-free language');
217
+ checks.push(analysis.structure.score >= 7 ? 'โœ…' : 'โฌœ' + ' Logical structure with headers');
218
+ checks.push(analysis.engagement.score >= 7 ? 'โœ…' : 'โฌœ' + ' Engaging opening hook');
219
+ checks.push(analysis.goalAlignment.score >= 7 ? 'โœ…' : 'โฌœ' + ' Aligns with stated goal');
220
+ // Content-type specific
221
+ if (contentType === 'email' || contentType === 'sales_email') {
222
+ checks.push('โฌœ Subject line optimized');
223
+ checks.push('โฌœ Single clear CTA');
224
+ checks.push('โฌœ Mobile-friendly format');
225
+ }
226
+ if (contentType === 'landing_page') {
227
+ checks.push('โฌœ Benefit-driven headline');
228
+ checks.push('โฌœ Social proof included');
229
+ checks.push('โฌœ CTA above the fold');
230
+ }
231
+ if (contentType === 'blog_post') {
232
+ checks.push('โฌœ SEO-optimized title');
233
+ checks.push('โฌœ Meta description written');
234
+ checks.push('โฌœ Internal/external links added');
235
+ }
236
+ return checks.join('\n');
237
+ }
238
+ //# sourceMappingURL=content-improver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-improver.js","sourceRoot":"","sources":["../src/content-improver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,UAAU,EAAE,mBAAmB,EAAE,oB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string;
4
+ target_formats?: string;
5
+ brand_voice?: string;
6
+ key_message?: string;
7
+ }): string;
8
+ //# sourceMappingURL=content-repurposer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-repurposer.d.ts","sourceRoot":"","sources":["../src/content-repurposer.ts"],"names":[],"mappings":"AAKA,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,MAAM,CA+DT"}
@@ -0,0 +1,423 @@
1
+ import { parseListItems, extractKeyPoints, countWords } from './utils.js';
2
+ // Default formats when user doesn't specify
3
+ const DEFAULT_FORMATS = ['linkedin_post', 'twitter_thread', 'email', 'blog_summary', 'quote_cards'];
4
+ export function generateContentRepurposer(args) {
5
+ const content = args.source_content;
6
+ const sourceType = args.source_type;
7
+ const targetFormats = args.target_formats ? parseListItems(args.target_formats) : DEFAULT_FORMATS;
8
+ const voice = args.brand_voice || 'professional';
9
+ const keyMessage = args.key_message || '';
10
+ // Extract key information from source
11
+ const keyPoints = extractKeyPoints(content);
12
+ const wordCount = countWords(content);
13
+ const title = extractTitle(content);
14
+ let output = `# ๐Ÿ”„ Content Repurposing Kit
15
+
16
+ ## Source Content Analysis
17
+
18
+ | Attribute | Value |
19
+ |-----------|-------|
20
+ | **Source Type** | ${sourceType.replace(/_/g, ' ')} |
21
+ | **Word Count** | ${wordCount} |
22
+ | **Key Points Found** | ${keyPoints.length} |
23
+ | **Brand Voice** | ${voice} |
24
+ | **Core Message** | ${keyMessage || 'Extracted from content'} |
25
+ | **Formats** | ${args.target_formats ? 'Custom selection' : 'Default top 5'} |
26
+
27
+ ### Key Points Extracted
28
+ ${keyPoints.map((p, i) => `${i + 1}. ${p}`).join('\n')}
29
+
30
+ ---
31
+
32
+ ## ๐Ÿ“ฆ Repurposed Content
33
+
34
+ `;
35
+ // Generate each requested format
36
+ for (const format of targetFormats) {
37
+ const formatOutput = generateFormat(format.toLowerCase().replace(/\s+/g, '_'), content, keyPoints, title, voice, keyMessage, sourceType);
38
+ output += formatOutput;
39
+ }
40
+ output += `
41
+ ---
42
+
43
+ ## ๐Ÿ“Š Content Distribution Matrix
44
+
45
+ | Format | Platform | Best Time | Engagement Goal |
46
+ |--------|----------|-----------|-----------------|
47
+ ${targetFormats.map(f => `| ${f} | ${getPlatform(f)} | ${getBestTime(f)} | ${getEngagementGoal(f)} |`).join('\n')}
48
+
49
+ ---
50
+
51
+ ## โœ… Repurposing Checklist
52
+
53
+ - [ ] Review each piece for brand consistency
54
+ - [ ] Customize for platform-specific best practices
55
+ - [ ] Update links/CTAs for each channel
56
+ - [ ] Schedule according to optimal times
57
+ - [ ] Prepare responses for expected engagement
58
+ - [ ] Track performance across formats
59
+
60
+ `;
61
+ return output;
62
+ }
63
+ function extractTitle(content) {
64
+ // Try to extract title from headers or first line
65
+ const headerMatch = content.match(/^#\s+(.+)$/m);
66
+ if (headerMatch)
67
+ return headerMatch[1];
68
+ const firstLine = content.split('\n')[0];
69
+ if (firstLine.length < 100)
70
+ return firstLine;
71
+ return 'Content';
72
+ }
73
+ function generateFormat(format, content, keyPoints, title, voice, keyMessage, sourceType) {
74
+ const generators = {
75
+ linkedin_post: () => `
76
+ ### ๐Ÿ“ฑ LinkedIn Post
77
+
78
+ ---
79
+
80
+ ${generateLinkedInPost(content, keyPoints, voice, keyMessage)}
81
+
82
+ ---
83
+
84
+ **Posting Notes:**
85
+ - Best time: Tuesday-Thursday, 8-10am
86
+ - Engage with comments in first 60 min
87
+ - Add 3-5 relevant hashtags
88
+
89
+ `,
90
+ twitter_thread: () => `
91
+ ### ๐Ÿฆ Twitter/X Thread
92
+
93
+ ---
94
+
95
+ ${generateTwitterThread(content, keyPoints, title)}
96
+
97
+ ---
98
+
99
+ **Posting Notes:**
100
+ - Thread with 5-10 tweets performs best
101
+ - First tweet is crucial for engagement
102
+ - Add a "follow for more" at the end
103
+
104
+ `,
105
+ email: () => `
106
+ ### ๐Ÿ“ง Email Version
107
+
108
+ ---
109
+
110
+ **Subject Line Options:**
111
+ 1. ${title}: Key insights you need to know
112
+ 2. What we learned about ${keyPoints[0]?.split(' ').slice(0, 3).join(' ') || 'this topic'}
113
+ 3. [First Name], don't miss this ${sourceType.replace(/_/g, ' ')} summary
114
+
115
+ **Email Body:**
116
+
117
+ ${generateEmailVersion(content, keyPoints, keyMessage)}
118
+
119
+ ---
120
+
121
+ `,
122
+ blog_summary: () => `
123
+ ### ๐Ÿ“ Blog Summary (300 words)
124
+
125
+ ---
126
+
127
+ ${generateBlogSummary(content, keyPoints, title)}
128
+
129
+ ---
130
+
131
+ `,
132
+ infographic_outline: () => `
133
+ ### ๐Ÿ“Š Infographic Outline
134
+
135
+ ---
136
+
137
+ **Title:** ${title}
138
+
139
+ **Header Section:**
140
+ - Main statistic or hook from content
141
+ - Visual: [Icon representing topic]
142
+
143
+ **Body Sections:**
144
+
145
+ ${keyPoints.slice(0, 5).map((p, i) => `
146
+ **Section ${i + 1}: ${p.split(' ').slice(0, 5).join(' ')}...**
147
+ - Key stat/visual: [Extract number or create icon]
148
+ - Supporting point: ${p}
149
+ `).join('\n')}
150
+
151
+ **Footer:**
152
+ - CTA: [Action you want viewers to take]
153
+ - Branding: Logo + website
154
+
155
+ ---
156
+
157
+ `,
158
+ video_script: () => `
159
+ ### ๐ŸŽฅ Video Script (60-90 seconds)
160
+
161
+ ---
162
+
163
+ **[HOOK - 5 seconds]**
164
+ "${keyPoints[0] ? `Did you know that ${keyPoints[0].toLowerCase()}?` : `Here's something important about ${title}...`}"
165
+
166
+ **[INTRO - 10 seconds]**
167
+ "I just shared ${sourceType.replace(/_/g, ' ')} about ${title}. Here are the key takeaways you need to know."
168
+
169
+ **[BODY - 45-60 seconds]**
170
+ ${keyPoints.slice(0, 3).map((p, i) => `
171
+ "Point ${i + 1}: ${p}"
172
+ [VISUAL: Supporting image/graphic]
173
+ `).join('\n')}
174
+
175
+ **[CTA - 10 seconds]**
176
+ "${keyMessage || 'Link in bio for the full version. Follow for more insights like this.'}"
177
+
178
+ ---
179
+
180
+ `,
181
+ podcast_talking_points: () => `
182
+ ### ๐ŸŽ™๏ธ Podcast Talking Points
183
+
184
+ ---
185
+
186
+ **Episode Title:** ${title}: A Deep Dive
187
+
188
+ **Intro (1-2 min):**
189
+ - Hook: Why this matters now
190
+ - Context: Where this ${sourceType.replace(/_/g, ' ')} came from
191
+
192
+ **Main Discussion Points:**
193
+
194
+ ${keyPoints.map((p, i) => `
195
+ **Point ${i + 1}:** ${p}
196
+ - Story/example to illustrate
197
+ - Implications for listeners
198
+ - Practical application
199
+ `).join('\n')}
200
+
201
+ **Wrap-up:**
202
+ - Key takeaway summary
203
+ - CTA for listeners
204
+ - Tease next episode
205
+
206
+ ---
207
+
208
+ `,
209
+ slide_deck_outline: () => `
210
+ ### ๐Ÿ“Š Slide Deck Outline
211
+
212
+ ---
213
+
214
+ **Slide 1: Title**
215
+ - ${title}
216
+ - [Presenter name, date]
217
+
218
+ **Slide 2: Why This Matters**
219
+ - Context for the content
220
+ - Key problem being addressed
221
+
222
+ ${keyPoints.map((p, i) => `
223
+ **Slide ${i + 3}: ${p.split(' ').slice(0, 5).join(' ')}**
224
+ - Main point: ${p}
225
+ - Supporting visual
226
+ - Key statistic (if available)
227
+ `).join('\n')}
228
+
229
+ **Slide ${keyPoints.length + 3}: Summary**
230
+ - ${keyPoints.length} key takeaways
231
+ - One-line for each
232
+
233
+ **Slide ${keyPoints.length + 4}: Next Steps/CTA**
234
+ - What to do with this information
235
+ - Contact/follow-up details
236
+
237
+ ---
238
+
239
+ `,
240
+ quote_cards: () => `
241
+ ### ๐Ÿ’ฌ Quote Cards (Social Graphics)
242
+
243
+ ---
244
+
245
+ ${extractQuotes(content, keyPoints).map((q, i) => `
246
+ **Quote Card ${i + 1}:**
247
+ > "${q}"
248
+
249
+ - Background: [Solid color or subtle pattern]
250
+ - Font: Bold, readable
251
+ - Branding: Logo bottom corner
252
+
253
+ `).join('\n')}
254
+
255
+ **Design Notes:**
256
+ - Keep text readable on mobile
257
+ - Use brand colors
258
+ - Square format (1080x1080) for Instagram/LinkedIn
259
+ - Add visual hierarchy with font sizes
260
+
261
+ ---
262
+
263
+ `,
264
+ newsletter_section: () => `
265
+ ### ๐Ÿ“ฐ Newsletter Section
266
+
267
+ ---
268
+
269
+ **Section Header:** ${title}
270
+
271
+ ${generateNewsletterSection(content, keyPoints, keyMessage)}
272
+
273
+ **[Read the full ${sourceType.replace(/_/g, ' ')} โ†’]**
274
+
275
+ ---
276
+
277
+ `
278
+ };
279
+ return generators[format] ? generators[format]() : `
280
+ ### ${format.replace(/_/g, ' ').toUpperCase()}
281
+
282
+ Content repurposed for ${format}:
283
+
284
+ ${keyPoints.map(p => `โ€ข ${p}`).join('\n')}
285
+
286
+ [CTA based on format requirements]
287
+
288
+ ---
289
+
290
+ `;
291
+ }
292
+ function generateLinkedInPost(content, keyPoints, voice, keyMessage) {
293
+ const hook = keyPoints[0] ? `${keyPoints[0].charAt(0).toUpperCase() + keyPoints[0].slice(1)}` : 'Here\'s what I learned';
294
+ return `${hook}
295
+
296
+ ${keyPoints.length > 1 ? `After diving deep into this topic, here's what stands out:
297
+
298
+ ${keyPoints.slice(0, 4).map((p, i) => `${i + 1}. ${p}`).join('\n')}` : ''}
299
+
300
+ ${keyMessage || 'The bottom line: this changes how we should think about the problem.'}
301
+
302
+ What's your take? ๐Ÿ‘‡
303
+
304
+ #${content.split(' ').slice(0, 3).join('').replace(/[^a-zA-Z]/g, '')} #Insights #${voice}`;
305
+ }
306
+ function generateTwitterThread(content, keyPoints, title) {
307
+ let thread = `**Tweet 1 (Hook):**
308
+ ${title} - A thread ๐Ÿงต
309
+
310
+ Here's what you need to know:\n\n`;
311
+ keyPoints.slice(0, 6).forEach((p, i) => {
312
+ thread += `**Tweet ${i + 2}:**
313
+ ${i + 1}/ ${p}
314
+
315
+ `;
316
+ });
317
+ thread += `**Final Tweet:**
318
+ ${keyPoints.length + 2}/ That's the TL;DR.
319
+
320
+ Full breakdown linked in bio.
321
+
322
+ Follow for more threads like this ๐Ÿ‘‹`;
323
+ return thread;
324
+ }
325
+ function generateEmailVersion(content, keyPoints, keyMessage) {
326
+ return `Hi [First Name],
327
+
328
+ Quick summary of something important:
329
+
330
+ ${keyPoints.slice(0, 3).map(p => `โ†’ ${p}`).join('\n')}
331
+
332
+ ${keyMessage || 'This matters because [reason].'}
333
+
334
+ Worth a read when you have a few minutes.
335
+
336
+ [CTA Button: Read the Full Version]
337
+
338
+ Best,
339
+ [Your name]`;
340
+ }
341
+ function generateBlogSummary(content, keyPoints, title) {
342
+ return `## ${title}: Key Takeaways
343
+
344
+ ${keyPoints[0] || 'This content explores important topics'} โ€” and that's just the beginning.
345
+
346
+ In this ${content.length > 5000 ? 'comprehensive' : 'focused'} piece, we cover:
347
+
348
+ ${keyPoints.map(p => `- **${p.split(' ').slice(0, 4).join(' ')}:** ${p}`).join('\n')}
349
+
350
+ Whether you're [audience segment 1] or [audience segment 2], these insights apply to your work.
351
+
352
+ **The bottom line:** ${keyPoints[0] || 'There\'s actionable value here.'}
353
+
354
+ [Read the full version for examples, data, and implementation details โ†’]`;
355
+ }
356
+ function generateNewsletterSection(content, keyPoints, keyMessage) {
357
+ return `${keyPoints[0] || 'Key insight from this content.'}
358
+
359
+ Here's the quick version:
360
+
361
+ ${keyPoints.slice(1, 4).map(p => `โ€ข ${p}`).join('\n')}
362
+
363
+ ${keyMessage || 'Worth your time if you care about this topic.'}`;
364
+ }
365
+ function extractQuotes(content, keyPoints) {
366
+ // Look for actual quotes in content
367
+ const quotesInContent = content.match(/"[^"]{20,150}"/g) || [];
368
+ // Generate quotable statements from key points
369
+ const generated = keyPoints.slice(0, 3).map(p => {
370
+ const words = p.split(' ');
371
+ if (words.length > 15) {
372
+ return words.slice(0, 12).join(' ') + '...';
373
+ }
374
+ return p;
375
+ });
376
+ return [...quotesInContent.map(q => q.replace(/"/g, '')), ...generated].slice(0, 5);
377
+ }
378
+ function getPlatform(format) {
379
+ const platforms = {
380
+ linkedin_post: 'LinkedIn',
381
+ twitter_thread: 'Twitter/X',
382
+ email: 'Email list',
383
+ blog_summary: 'Blog',
384
+ infographic_outline: 'Instagram, Pinterest',
385
+ video_script: 'YouTube, TikTok',
386
+ podcast_talking_points: 'Podcast',
387
+ slide_deck_outline: 'SlideShare, presentations',
388
+ quote_cards: 'All social',
389
+ newsletter_section: 'Newsletter'
390
+ };
391
+ return platforms[format.toLowerCase().replace(/\s+/g, '_')] || 'Multiple';
392
+ }
393
+ function getBestTime(format) {
394
+ const times = {
395
+ linkedin_post: 'Tue-Thu 8-10am',
396
+ twitter_thread: 'Mon-Fri 12pm',
397
+ email: 'Tue 10am',
398
+ blog_summary: 'Tuesday AM',
399
+ infographic_outline: 'Wed/Sun',
400
+ video_script: 'Sat/Sun',
401
+ podcast_talking_points: 'Monday AM',
402
+ slide_deck_outline: 'Anytime',
403
+ quote_cards: 'Daily',
404
+ newsletter_section: 'Weekly'
405
+ };
406
+ return times[format.toLowerCase().replace(/\s+/g, '_')] || 'Varies';
407
+ }
408
+ function getEngagementGoal(format) {
409
+ const goals = {
410
+ linkedin_post: 'Comments, shares',
411
+ twitter_thread: 'Retweets, follows',
412
+ email: 'Opens, clicks',
413
+ blog_summary: 'Traffic, time on page',
414
+ infographic_outline: 'Saves, shares',
415
+ video_script: 'Watch time, subs',
416
+ podcast_talking_points: 'Downloads, reviews',
417
+ slide_deck_outline: 'Views, downloads',
418
+ quote_cards: 'Shares, saves',
419
+ newsletter_section: 'Click-through'
420
+ };
421
+ return goals[format.toLowerCase().replace(/\s+/g, '_')] || 'Engagement';
422
+ }
423
+ //# sourceMappingURL=content-repurposer.js.map