fraim-framework 2.0.30 → 2.0.33
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.
- package/dist/src/cli/commands/init.js +29 -2
- package/dist/src/cli/commands/sync.js +18 -1
- package/dist/src/utils/script-sync-utils.js +218 -0
- package/dist/tests/debug-tools.js +6 -5
- package/dist/tests/test-chalk-regression.js +58 -8
- package/dist/tests/test-cli.js +70 -5
- package/dist/tests/test-end-to-end-hybrid-validation.js +349 -0
- package/dist/tests/test-first-run-journey.js +43 -3
- package/dist/tests/test-hybrid-script-execution.js +369 -0
- package/dist/tests/test-mcp-connection.js +2 -2
- package/dist/tests/test-mcp-issue-integration.js +12 -4
- package/dist/tests/test-mcp-lifecycle-methods.js +4 -4
- package/dist/tests/test-node-compatibility.js +24 -2
- package/dist/tests/test-prep-issue.js +4 -1
- package/dist/tests/test-script-location-independence.js +173 -0
- package/dist/tests/test-script-sync.js +557 -0
- package/dist/tests/test-session-rehydration.js +2 -2
- package/dist/tests/test-standalone.js +3 -3
- package/dist/tests/test-sync-version-update.js +1 -1
- package/dist/tests/test-telemetry.js +2 -2
- package/dist/tests/test-user-journey.js +8 -4
- package/dist/tests/test-utils.js +13 -0
- package/dist/tests/test-wizard.js +2 -2
- package/package.json +3 -3
- package/registry/rules/agent-testing-guidelines.md +502 -502
- package/registry/rules/ephemeral-execution.md +37 -27
- package/registry/rules/local-development.md +253 -251
- package/registry/rules/successful-debugging-patterns.md +491 -482
- package/registry/scripts/prep-issue.sh +468 -468
- package/registry/workflows/bootstrap/evaluate-code-quality.md +8 -2
- package/registry/workflows/bootstrap/verify-test-coverage.md +8 -2
- package/registry/workflows/customer-development/thank-customers.md +203 -193
- package/registry/workflows/customer-development/weekly-newsletter.md +366 -362
- package/registry/workflows/performance/analyze-performance.md +65 -63
- package/registry/workflows/product-building/implement.md +6 -2
- package/registry/workflows/product-building/prep-issue.md +11 -24
- package/registry/workflows/product-building/resolve.md +5 -1
- package/registry/workflows/replicate/replicate-discovery.md +336 -0
- package/registry/workflows/replicate/replicate-to-issues.md +319 -0
- package/registry/workflows/reviewer/review-implementation-vs-design-spec.md +632 -632
- package/.windsurf/rules/windsurf-rules.md +0 -7
- package/.windsurf/workflows/resolve-issue.md +0 -6
- package/.windsurf/workflows/retrospect.md +0 -6
- package/.windsurf/workflows/start-design.md +0 -6
- package/.windsurf/workflows/start-impl.md +0 -6
- package/.windsurf/workflows/start-spec.md +0 -6
- package/.windsurf/workflows/start-tests.md +0 -6
- package/bin/fraim.js +0 -23
- package/registry/scripts/build-scripts-generator.ts +0 -216
- package/registry/scripts/cleanup-branch.ts +0 -303
- package/registry/scripts/fraim-config.ts +0 -63
- package/registry/scripts/generate-engagement-emails.ts +0 -744
- package/registry/scripts/generic-issues-api.ts +0 -110
- package/registry/scripts/newsletter-helpers.ts +0 -874
- package/registry/scripts/openapi-generator.ts +0 -695
- package/registry/scripts/performance/profile-server.ts +0 -370
- package/registry/scripts/run-thank-you-workflow.ts +0 -122
- package/registry/scripts/send-newsletter-simple.ts +0 -104
- package/registry/scripts/send-thank-you-emails.ts +0 -57
- package/registry/workflows/replicate/re-implementation-strategy.md +0 -226
- package/registry/workflows/replicate/use-case-extraction.md +0 -135
- package/registry/workflows/replicate/visual-analysis.md +0 -154
- package/registry/workflows/replicate/website-discovery-analysis.md +0 -231
- package/sample_package.json +0 -18
- /package/registry/scripts/{replicate/comprehensive-explorer.py → comprehensive-explorer.py} +0 -0
- /package/registry/scripts/{replicate/interactive-explorer.py → interactive-explorer.py} +0 -0
- /package/registry/scripts/{replicate/scrape-site.py → scrape-site.py} +0 -0
|
@@ -1,362 +1,366 @@
|
|
|
1
|
-
# Weekly Newsletter Workflow
|
|
2
|
-
|
|
3
|
-
## INTENT
|
|
4
|
-
To generate and distribute a compelling weekly newsletter that showcases the AI Agent's amazing new features and improvements, creating excitement among current users and FOMO for subscribers who haven't joined yet.
|
|
5
|
-
|
|
6
|
-
## PRINCIPLES
|
|
7
|
-
- **Value-Focused**: Highlight features and improvements that deliver real value to users
|
|
8
|
-
- **User-Facing Only**: Do NOT include internal features (admin dashboards, monitoring, backups, devops)
|
|
9
|
-
- **Authentic Testimonials**: Only use real testimonials from actual users - NO fake quotes
|
|
10
|
-
- **FOMO-Inducing**: Create urgency and excitement about missing out
|
|
11
|
-
- **Visually Stunning**: Beautiful design that catches the eye
|
|
12
|
-
- **Concise**: Scannable format with clear sections
|
|
13
|
-
- **AI Creativity**: AI agent makes all editorial decisions - what's a feature vs bug, what's worth highlighting
|
|
14
|
-
|
|
15
|
-
## WORKFLOW TRIGGER
|
|
16
|
-
**User triggers this workflow manually**:
|
|
17
|
-
- Weekly, typically Monday morning
|
|
18
|
-
- User says: "Generate this week's newsletter" or similar
|
|
19
|
-
|
|
20
|
-
## AI AGENT PROCESS
|
|
21
|
-
|
|
22
|
-
### Step 1: Issue Retrieval
|
|
23
|
-
**AI Agent calls function**:
|
|
24
|
-
```typescript
|
|
25
|
-
//
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
const { saveNewsletter } = await import(
|
|
143
|
-
|
|
144
|
-
// 2. Save newsletter JSON and generate HTML
|
|
145
|
-
const savedPath = saveNewsletter(newsletter);
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
**This function will**:
|
|
149
|
-
- Save the JSON file
|
|
150
|
-
- Generate beautiful HTML from the template
|
|
151
|
-
- Save the HTML file
|
|
152
|
-
- Return path to JSON file
|
|
153
|
-
|
|
154
|
-
### Step 6: User Review
|
|
155
|
-
**AI Agent**:
|
|
156
|
-
1. **Points user to the generated file**: `docs/customer-development/newsletters/newsletter-YYYY-MM-DD.json`
|
|
157
|
-
2. **Shows preview**: Points to HTML file for browser preview
|
|
158
|
-
3. **Requests review** and any edits needed (user can edit JSON directly)
|
|
159
|
-
4. **Waits for user approval** before proceeding
|
|
160
|
-
|
|
161
|
-
**Note**: User can:
|
|
162
|
-
- Edit titles to be more compelling
|
|
163
|
-
- Add/remove items
|
|
164
|
-
- Adjust descriptions
|
|
165
|
-
- Add real testimonials (verify authenticity!)
|
|
166
|
-
- Add "coming next" teaser
|
|
167
|
-
|
|
168
|
-
### Step 7: Send Newsletter (Separate Command)
|
|
169
|
-
**When user says "Send the newsletter" or similar**:
|
|
170
|
-
|
|
171
|
-
**User runs deterministic script**:
|
|
172
|
-
```bash
|
|
173
|
-
npm run send-newsletter
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
//
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
-
|
|
228
|
-
- **
|
|
229
|
-
-
|
|
230
|
-
-
|
|
231
|
-
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
|
|
238
|
-
**
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
-
|
|
249
|
-
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
-
|
|
256
|
-
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
3
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
- "
|
|
323
|
-
- "
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
-
|
|
333
|
-
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
- [ ]
|
|
345
|
-
- [ ]
|
|
346
|
-
- [ ]
|
|
347
|
-
- [ ]
|
|
348
|
-
- [ ]
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
-
|
|
362
|
-
|
|
1
|
+
# Weekly Newsletter Workflow
|
|
2
|
+
|
|
3
|
+
## INTENT
|
|
4
|
+
To generate and distribute a compelling weekly newsletter that showcases the AI Agent's amazing new features and improvements, creating excitement among current users and FOMO for subscribers who haven't joined yet.
|
|
5
|
+
|
|
6
|
+
## PRINCIPLES
|
|
7
|
+
- **Value-Focused**: Highlight features and improvements that deliver real value to users
|
|
8
|
+
- **User-Facing Only**: Do NOT include internal features (admin dashboards, monitoring, backups, devops)
|
|
9
|
+
- **Authentic Testimonials**: Only use real testimonials from actual users - NO fake quotes
|
|
10
|
+
- **FOMO-Inducing**: Create urgency and excitement about missing out
|
|
11
|
+
- **Visually Stunning**: Beautiful design that catches the eye
|
|
12
|
+
- **Concise**: Scannable format with clear sections
|
|
13
|
+
- **AI Creativity**: AI agent makes all editorial decisions - what's a feature vs bug, what's worth highlighting
|
|
14
|
+
|
|
15
|
+
## WORKFLOW TRIGGER
|
|
16
|
+
**User triggers this workflow manually**:
|
|
17
|
+
- Weekly, typically Monday morning
|
|
18
|
+
- User says: "Generate this week's newsletter" or similar
|
|
19
|
+
|
|
20
|
+
## AI AGENT PROCESS
|
|
21
|
+
|
|
22
|
+
### Step 1: Issue Retrieval
|
|
23
|
+
**AI Agent calls function**:
|
|
24
|
+
```typescript
|
|
25
|
+
// Import newsletter helper functions directly from synced location
|
|
26
|
+
const os = require('os');
|
|
27
|
+
const path = require('path');
|
|
28
|
+
|
|
29
|
+
const scriptsDir = path.join(os.homedir(), '.fraim', 'scripts');
|
|
30
|
+
const scriptPath = path.join(scriptsDir, 'newsletter-helpers.ts');
|
|
31
|
+
|
|
32
|
+
// Import from the synced script
|
|
33
|
+
const { getResolvedIssuesForNewsletter } = await import(scriptPath);
|
|
34
|
+
|
|
35
|
+
// Use the function
|
|
36
|
+
const resolvedIssues = await getResolvedIssuesForNewsletter();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Note**: The `getResolvedIssuesForNewsletter()` function automatically:
|
|
40
|
+
- Finds the most recent newsletter date from existing files
|
|
41
|
+
- Uses that date as the starting point to fetch issues resolved AFTER that date
|
|
42
|
+
- If no newsletter files exist, falls back to last 7 days
|
|
43
|
+
- Returns ALL closed issues - AI agent decides what to include
|
|
44
|
+
|
|
45
|
+
### Step 2: Intelligent Categorization & Filtering
|
|
46
|
+
**AI Agent does creative analysis**:
|
|
47
|
+
|
|
48
|
+
1. **Go through each resolved issue** and make editorial decisions:
|
|
49
|
+
- Is this user-facing or internal?
|
|
50
|
+
- Is this a feature, improvement, or bug fix?
|
|
51
|
+
- Is this worth highlighting to users?
|
|
52
|
+
- How should this be described to non-technical users?
|
|
53
|
+
|
|
54
|
+
2. **Filter out internal-only issues**:
|
|
55
|
+
- Admin dashboards, monitoring, analytics (internal tools)
|
|
56
|
+
- Database backups, devops improvements
|
|
57
|
+
- CI/CD, deployment automation
|
|
58
|
+
- Developer tools, debugging features
|
|
59
|
+
- Documentation updates, dependency updates
|
|
60
|
+
- **API route fixes, endpoint refactoring, code structure changes**
|
|
61
|
+
- **Environment variable updates, configuration file changes**
|
|
62
|
+
- **Developer setup improvements, build process updates**
|
|
63
|
+
- **Internal bug fixes that don't impact user experience**
|
|
64
|
+
- Any change without user-facing impact
|
|
65
|
+
|
|
66
|
+
3. **Categorize remaining issues**:
|
|
67
|
+
- **Features**: Adds NEW capability users didn't have before
|
|
68
|
+
- **Improvements**: Makes existing functionality better/faster/easier
|
|
69
|
+
- **Bug Fixes**: Fixes something that was broken
|
|
70
|
+
|
|
71
|
+
4. **Select hero feature** (optional):
|
|
72
|
+
- Pick the MOST impactful feature or improvement
|
|
73
|
+
- Must have clear user value and ideally a quantifiable impact statement
|
|
74
|
+
|
|
75
|
+
### Step 3: Write Compelling Content
|
|
76
|
+
**AI Agent writes newsletter content** - be creative, exciting, and user-focused!
|
|
77
|
+
|
|
78
|
+
**Guidelines**:
|
|
79
|
+
- **NO TECHNICAL JARGON**: Don't mention internal systems, code, or technical details
|
|
80
|
+
- **USER VALUE FOCUS**: Describe what the user can now do, not how it works
|
|
81
|
+
- **ACTIVE, EXCITING LANGUAGE**: "You can now...", "The AI Agent now automatically...", "Your calendar finally..."
|
|
82
|
+
- **QUANTIFY IMPACT**: "85% reduction in...", "5 hours saved per week", "3x faster"
|
|
83
|
+
- **CREATE FOMO**: "Current users are already...", "Join 500+ executives who..."
|
|
84
|
+
|
|
85
|
+
**For each item, write**:
|
|
86
|
+
- **Title**: Short, benefit-focused (e.g., "Smart Timezone Detection" not "Implement timezone handling")
|
|
87
|
+
- **Description**: What the user can do now, why it matters (2-3 sentences)
|
|
88
|
+
- **Impact** (optional): Quantified benefit or user testimonial
|
|
89
|
+
|
|
90
|
+
**Example**:
|
|
91
|
+
```json
|
|
92
|
+
{
|
|
93
|
+
"title": "Work Hours & Focus Blocks on Your Calendar",
|
|
94
|
+
"description": "Your work hours and focus blocks now automatically appear as visual blocks on your calendar! No more scheduling conflicts during your protected time. The AI creates beautiful calendar events that sync across all your devices, making it crystal clear when you're available and when you're in deep work mode.",
|
|
95
|
+
"impact": "Users report 85% reduction in meeting conflicts during focus time. Your calendar finally shows the complete picture of your day!"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Step 4: Generate Newsletter JSON
|
|
100
|
+
**AI Agent creates ONE file**:
|
|
101
|
+
- File: `docs/customer-development/newsletters/newsletter-YYYY-MM-DD.json`
|
|
102
|
+
- Format: Structured JSON for deterministic rendering
|
|
103
|
+
- Contains ALL content ready for user review
|
|
104
|
+
|
|
105
|
+
**File format** (JSON):
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"metadata": {
|
|
109
|
+
"generatedOn": "2025-11-01T00:00:00.000Z",
|
|
110
|
+
"weekStart": "2025-10-25",
|
|
111
|
+
"weekEnd": "2025-11-01",
|
|
112
|
+
...
|
|
113
|
+
},
|
|
114
|
+
"content": {
|
|
115
|
+
"weekTitle": "Work Hours & Focus Blocks Now on Your Calendar! 🎯",
|
|
116
|
+
"weekSubtitle": "8 powerful updates that supercharge your productivity",
|
|
117
|
+
"weekDate": "Oct 25 - Nov 1, 2025",
|
|
118
|
+
"openingMessage": "This week has been HUGE! We've shipped game-changing features that make the AI Agent even more powerful at protecting your time and managing your schedule. Current users are already saving hours every week - here's what you've been missing! 🚀",
|
|
119
|
+
"heroFeature": { ... },
|
|
120
|
+
"newFeatures": [ ... ],
|
|
121
|
+
"improvements": [ ... ],
|
|
122
|
+
"bugFixes": [ ... ],
|
|
123
|
+
"testimonial": {
|
|
124
|
+
"text": "The AI saved me 5 hours this week just by protecting my focus blocks...",
|
|
125
|
+
"author": "Sid Mathur",
|
|
126
|
+
"role": "Founder"
|
|
127
|
+
},
|
|
128
|
+
"comingNext": "Next week: Voice commands for calendar management, smart meeting summaries...",
|
|
129
|
+
"ctaLink": "https://example.com/wellness/ai-agent",
|
|
130
|
+
"ctaText": "Start Your Free Trial"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Step 5: Generate HTML
|
|
136
|
+
// Import helper functions directly from synced location
|
|
137
|
+
const os = require('os');
|
|
138
|
+
const path = require('path');
|
|
139
|
+
const scriptsDir = path.join(os.homedir(), '.fraim', 'scripts');
|
|
140
|
+
const scriptPath = path.join(scriptsDir, 'newsletter-helpers.ts');
|
|
141
|
+
|
|
142
|
+
const { saveNewsletter } = await import(scriptPath);
|
|
143
|
+
|
|
144
|
+
// 2. Save newsletter JSON and generate HTML
|
|
145
|
+
const savedPath = saveNewsletter(newsletter);
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**This function will**:
|
|
149
|
+
- Save the JSON file
|
|
150
|
+
- Generate beautiful HTML from the template
|
|
151
|
+
- Save the HTML file
|
|
152
|
+
- Return path to JSON file
|
|
153
|
+
|
|
154
|
+
### Step 6: User Review
|
|
155
|
+
**AI Agent**:
|
|
156
|
+
1. **Points user to the generated file**: `docs/customer-development/newsletters/newsletter-YYYY-MM-DD.json`
|
|
157
|
+
2. **Shows preview**: Points to HTML file for browser preview
|
|
158
|
+
3. **Requests review** and any edits needed (user can edit JSON directly)
|
|
159
|
+
4. **Waits for user approval** before proceeding
|
|
160
|
+
|
|
161
|
+
**Note**: User can:
|
|
162
|
+
- Edit titles to be more compelling
|
|
163
|
+
- Add/remove items
|
|
164
|
+
- Adjust descriptions
|
|
165
|
+
- Add real testimonials (verify authenticity!)
|
|
166
|
+
- Add "coming next" teaser
|
|
167
|
+
|
|
168
|
+
### Step 7: Send Newsletter (Separate Command)
|
|
169
|
+
**When user says "Send the newsletter" or similar**:
|
|
170
|
+
|
|
171
|
+
**User runs deterministic script**:
|
|
172
|
+
```bash
|
|
173
|
+
npm run send-newsletter
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
// Import helper functions directly from synced location
|
|
177
|
+
const os = require('os');
|
|
178
|
+
const path = require('path');
|
|
179
|
+
const scriptsDir = path.join(os.homedir(), '.fraim', 'scripts');
|
|
180
|
+
const scriptPath = path.join(scriptsDir, 'newsletter-helpers.ts');
|
|
181
|
+
|
|
182
|
+
const { sendNewsletterToExecutives } = await import(scriptPath);
|
|
183
|
+
|
|
184
|
+
// 2. Send newsletter to all active executives
|
|
185
|
+
await sendNewsletterToExecutives('docs/customer-development/newsletters/newsletter-2025-11-01.json');
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
**This function will**:
|
|
189
|
+
- Load the approved newsletter JSON
|
|
190
|
+
- Get all active executives from database
|
|
191
|
+
- For each executive:
|
|
192
|
+
- Get their AI Agent email address
|
|
193
|
+
- Get their OAuth tokens
|
|
194
|
+
- Send personalized newsletter from their AI identity
|
|
195
|
+
- Log results and exit
|
|
196
|
+
|
|
197
|
+
## NEWSLETTER STRUCTURE
|
|
198
|
+
|
|
199
|
+
### Hero Section
|
|
200
|
+
- **Week Title**: Catchy title based on hero feature or main theme
|
|
201
|
+
- **Subtitle**: Count of updates
|
|
202
|
+
- **Stats Banner**: Features | Improvements | Bug Fixes counters
|
|
203
|
+
|
|
204
|
+
### Content Sections
|
|
205
|
+
1. **Opening Message**: Exciting intro about what shipped (AI agent writes this)
|
|
206
|
+
2. **Hero Feature** (optional): Spotlights the most impactful change with red "HERO FEATURE" badge
|
|
207
|
+
3. **New Capabilities**: Major new features added
|
|
208
|
+
4. **Major Improvements**: Significant enhancements
|
|
209
|
+
5. **Fixes & Polish**: Bug fixes and minor improvements
|
|
210
|
+
6. **Testimonial** (optional): Real user quote about impact (VERIFY AUTHENTICITY)
|
|
211
|
+
7. **Coming Next** (optional): Preview of upcoming features
|
|
212
|
+
|
|
213
|
+
### Call-to-Actions
|
|
214
|
+
- **FOMO CTA**: "Don't Miss Out!" with signup link
|
|
215
|
+
- **Feedback CTA**: Link to ChatGPT interface
|
|
216
|
+
|
|
217
|
+
## EDITORIAL GUIDELINES
|
|
218
|
+
|
|
219
|
+
### What to Include ✅
|
|
220
|
+
- New features that add capability for users
|
|
221
|
+
- Improvements that save time or improve UX
|
|
222
|
+
- Bug fixes that had user impact
|
|
223
|
+
- Real user testimonials (ONLY - verify authenticity)
|
|
224
|
+
- Quantified benefits (time saved, conflicts reduced, etc.)
|
|
225
|
+
|
|
226
|
+
### What to Exclude ❌
|
|
227
|
+
- Internal infrastructure changes
|
|
228
|
+
- **Admin dashboards, monitoring, analytics (internal-only)**
|
|
229
|
+
- **Backups, database operations, devops**
|
|
230
|
+
- **API route fixes, duplicate endpoint resolution**
|
|
231
|
+
- **Environment configuration, .env file updates**
|
|
232
|
+
- **Developer setup scripts, build configuration**
|
|
233
|
+
- CI/CD improvements
|
|
234
|
+
- Documentation updates
|
|
235
|
+
- Dependency updates
|
|
236
|
+
- Technical debt cleanup
|
|
237
|
+
- Developer tools and debugging features
|
|
238
|
+
- **Internal bug fixes (code structure, not user experience)**
|
|
239
|
+
- Issues without user-facing impact
|
|
240
|
+
- **FAKE TESTIMONIALS - authenticity is critical**
|
|
241
|
+
|
|
242
|
+
**Rule of thumb**: If the user wouldn't notice the change in their daily use of the AI Assistant, don't include it.
|
|
243
|
+
|
|
244
|
+
### Writing Style
|
|
245
|
+
|
|
246
|
+
**Titles:**
|
|
247
|
+
- Short, punchy, benefit-focused
|
|
248
|
+
- ❌ "Implement timezone handling in calendar service"
|
|
249
|
+
- ✅ "Smart Timezone Detection"
|
|
250
|
+
|
|
251
|
+
**Descriptions:**
|
|
252
|
+
- Start with the benefit to the user
|
|
253
|
+
- Use "you" and "your" to make it personal
|
|
254
|
+
- Be specific about what changed
|
|
255
|
+
- ❌ "Fixed bug where calendar events weren't syncing correctly"
|
|
256
|
+
- ✅ "Your calendar now stays perfectly in sync across all devices, no more mysterious missing meetings!"
|
|
257
|
+
|
|
258
|
+
**Impact Statements:**
|
|
259
|
+
- Quantify whenever possible
|
|
260
|
+
- Include real user feedback
|
|
261
|
+
- ❌ "Improved performance"
|
|
262
|
+
- ✅ "Calendar loads 3x faster, getting you to your day in seconds instead of minutes"
|
|
263
|
+
|
|
264
|
+
### Creating FOMO
|
|
265
|
+
|
|
266
|
+
- **Quantify Success**: "500+ executives already using this feature"
|
|
267
|
+
- **Show Savings**: "Don't miss out on 5 hours saved per week"
|
|
268
|
+
- **Create Urgency**: "Limited spots available"
|
|
269
|
+
- **Social Proof**: Real testimonials, growth stats, company names (with permission)
|
|
270
|
+
|
|
271
|
+
## EXAMPLES
|
|
272
|
+
|
|
273
|
+
### Example 1: Feature-Rich Week
|
|
274
|
+
```
|
|
275
|
+
User: "Generate this week's newsletter"
|
|
276
|
+
|
|
277
|
+
AI Agent:
|
|
278
|
+
1. Calls getResolvedIssuesForNewsletter() → gets 15 issues
|
|
279
|
+
2. Analyzes each issue:
|
|
280
|
+
- 3 user-facing features
|
|
281
|
+
- 5 improvements
|
|
282
|
+
- 2 bugs
|
|
283
|
+
- 5 internal/devops (FILTERED OUT)
|
|
284
|
+
3. Writes compelling content for each item
|
|
285
|
+
4. Selects "Voice Commands for Calendar" as hero feature
|
|
286
|
+
5. Writes exciting opening: "This week has been HUGE!..."
|
|
287
|
+
6. Creates newsletter JSON with all content
|
|
288
|
+
7. Calls saveNewsletter() → generates HTML
|
|
289
|
+
8. Shows preview: "Newsletter ready! docs/customer-development/newsletters/newsletter-2025-11-01.html"
|
|
290
|
+
|
|
291
|
+
User: "Looks great, send it"
|
|
292
|
+
|
|
293
|
+
AI Agent or User:
|
|
294
|
+
Runs: npm run send-newsletter
|
|
295
|
+
OR
|
|
296
|
+
Calls: sendNewsletterToExecutives('newsletter-2025-11-01.json')
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Example 2: User Adds Testimonial
|
|
300
|
+
```
|
|
301
|
+
User: "Generate newsletter"
|
|
302
|
+
|
|
303
|
+
AI Agent:
|
|
304
|
+
[Creates newsletter with 5 improvements, no testimonial]
|
|
305
|
+
|
|
306
|
+
User: "Add a testimonial from me - I saved 5 hours this week thanks to focus blocks"
|
|
307
|
+
|
|
308
|
+
AI Agent:
|
|
309
|
+
[Edits JSON to add testimonial with user's name]
|
|
310
|
+
[Regenerates HTML]
|
|
311
|
+
Shows: "Updated! Ready to send?"
|
|
312
|
+
|
|
313
|
+
User: "Yes, send it"
|
|
314
|
+
|
|
315
|
+
User runs: npm run send-newsletter
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## TIPS FOR COMPELLING NEWSLETTERS
|
|
319
|
+
|
|
320
|
+
### Highlight User Value
|
|
321
|
+
- Focus on what users can DO, not how it works
|
|
322
|
+
- "You can now..." not "We implemented..."
|
|
323
|
+
- "Your calendar automatically..." not "The system now..."
|
|
324
|
+
|
|
325
|
+
### Use Concrete Examples
|
|
326
|
+
- "Schedule meetings in seconds" not "Faster scheduling"
|
|
327
|
+
- "85% fewer conflicts" not "Better conflict detection"
|
|
328
|
+
- "Save 5 hours per week" not "More efficient"
|
|
329
|
+
|
|
330
|
+
### Create Narrative
|
|
331
|
+
- Opening: "This week has been incredible!"
|
|
332
|
+
- Hero feature: Build excitement around main change
|
|
333
|
+
- Coming next: Build anticipation for next week
|
|
334
|
+
|
|
335
|
+
### Make it Scannable
|
|
336
|
+
- Short paragraphs (2-3 sentences max)
|
|
337
|
+
- Clear section headers
|
|
338
|
+
- Visual hierarchy with emojis and formatting
|
|
339
|
+
- Impact callouts that stand out
|
|
340
|
+
|
|
341
|
+
## QUALITY CHECKLIST
|
|
342
|
+
|
|
343
|
+
Before approving newsletter, verify:
|
|
344
|
+
- [ ] All items are user-facing (no internal/devops features)
|
|
345
|
+
- [ ] Testimonials are real and verified
|
|
346
|
+
- [ ] Impact statements are accurate and quantified
|
|
347
|
+
- [ ] Descriptions focus on user value, not implementation
|
|
348
|
+
- [ ] Opening message is exciting and FOMO-inducing
|
|
349
|
+
- [ ] Links are correct (Azure signup URL)
|
|
350
|
+
- [ ] No mention of API credits or costs (the service is free)
|
|
351
|
+
- [ ] Grammar and spelling are perfect
|
|
352
|
+
- [ ] Preview HTML looks beautiful in browser
|
|
353
|
+
|
|
354
|
+
## FREQUENCY
|
|
355
|
+
|
|
356
|
+
**Recommended**: Weekly, sent Monday morning
|
|
357
|
+
- Catches people starting their week
|
|
358
|
+
- Fresh in mind for decision-making
|
|
359
|
+
- Consistent schedule builds anticipation
|
|
360
|
+
|
|
361
|
+
**Alternative**: Bi-weekly if weekly feels too frequent
|
|
362
|
+
|
|
363
|
+
**Special editions**:
|
|
364
|
+
- Major feature launches
|
|
365
|
+
- Milestone celebrations (e.g., "100 users!")
|
|
366
|
+
- Holiday/end-of-year roundups
|