fraim-framework 2.0.35 → 2.0.36

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 (51) hide show
  1. package/bin/fraim.js +52 -5
  2. package/dist/registry/scripts/cleanup-branch.js +62 -33
  3. package/dist/registry/scripts/generate-engagement-emails.js +119 -44
  4. package/dist/registry/scripts/newsletter-helpers.js +208 -268
  5. package/dist/registry/scripts/profile-server.js +387 -0
  6. package/dist/tests/test-chalk-regression.js +18 -2
  7. package/dist/tests/test-client-scripts-validation.js +133 -0
  8. package/dist/tests/test-prep-issue.js +1 -34
  9. package/dist/tests/test-script-location-independence.js +76 -28
  10. package/package.json +2 -2
  11. package/registry/agent-guardrails.md +62 -62
  12. package/registry/rules/communication.md +121 -121
  13. package/registry/rules/continuous-learning.md +54 -54
  14. package/registry/rules/hitl-ppe-record-analysis.md +302 -302
  15. package/registry/rules/software-development-lifecycle.md +104 -104
  16. package/registry/scripts/cleanup-branch.ts +341 -0
  17. package/registry/scripts/code-quality-check.sh +559 -559
  18. package/registry/scripts/detect-tautological-tests.sh +38 -38
  19. package/registry/scripts/generate-engagement-emails.ts +830 -0
  20. package/registry/scripts/markdown-to-pdf.js +7 -3
  21. package/registry/scripts/newsletter-helpers.ts +777 -0
  22. package/registry/scripts/prep-issue.sh +30 -61
  23. package/registry/scripts/profile-server.ts +424 -0
  24. package/registry/scripts/run-thank-you-workflow.ts +122 -0
  25. package/registry/scripts/send-newsletter-simple.ts +102 -0
  26. package/registry/scripts/send-thank-you-emails.ts +57 -0
  27. package/registry/scripts/validate-openapi-limits.ts +366 -366
  28. package/registry/scripts/validate-test-coverage.ts +280 -280
  29. package/registry/scripts/verify-pr-comments.sh +70 -70
  30. package/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +53 -53
  31. package/registry/templates/evidence/Implementation-BugEvidence.md +85 -85
  32. package/registry/templates/evidence/Implementation-FeatureEvidence.md +120 -120
  33. package/registry/workflows/customer-development/insight-analysis.md +156 -156
  34. package/registry/workflows/customer-development/interview-preparation.md +421 -421
  35. package/registry/workflows/customer-development/strategic-brainstorming.md +146 -146
  36. package/registry/workflows/quality-assurance/iterative-improvement-cycle.md +562 -562
  37. package/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +669 -669
  38. package/dist/registry/scripts/build-scripts-generator.js +0 -205
  39. package/dist/registry/scripts/fraim-config.js +0 -61
  40. package/dist/registry/scripts/generic-issues-api.js +0 -100
  41. package/dist/registry/scripts/openapi-generator.js +0 -664
  42. package/dist/registry/scripts/performance/profile-server.js +0 -390
  43. package/dist/test-utils.js +0 -96
  44. package/dist/tests/esm-compat.js +0 -11
  45. package/dist/tests/test-chalk-esm-issue.js +0 -159
  46. package/dist/tests/test-chalk-real-world.js +0 -265
  47. package/dist/tests/test-chalk-resolution-issue.js +0 -304
  48. package/dist/tests/test-fraim-install-chalk-issue.js +0 -254
  49. package/dist/tests/test-npm-resolution-diagnostic.js +0 -140
  50. package/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
  51. package/registry/workflows/marketing/storytelling.md +0 -65
@@ -0,0 +1,102 @@
1
+ #!/usr/bin/env tsx
2
+
3
+ /**
4
+ * Send Newsletter - Deterministic Script
5
+ *
6
+ * Simple script that users run after approving newsletter JSON.
7
+ * No decisions, just sends the newsletter.
8
+ *
9
+ * Usage:
10
+ * npm run send-newsletter # Send to all executives and potential customers
11
+ * npm run send-newsletter -- --showonly # List recipients without sending
12
+ * npm run send-newsletter -- --no-potential-customers # Send only to active executives
13
+ * npm run send-newsletter -- --only-potential-customers # Send only to potential customers
14
+ * npm run send-newsletter -- --email=user@example.com # Send to specific email
15
+ * npm run send-newsletter -- exec-XXX exec-YYY # Send to specific executive IDs
16
+ */
17
+
18
+ import { sendNewsletterToExecutives } from './newsletter-helpers';
19
+ import { readdirSync, existsSync } from 'fs';
20
+ import { join } from 'path';
21
+
22
+ async function main() {
23
+ console.log('šŸ“§ Weekly Newsletter Sender\n');
24
+
25
+ // Parse command line arguments
26
+ const args = process.argv.slice(2);
27
+ const showOnly = args.includes('--showonly');
28
+ const excludePotentialCustomers = args.includes('--no-potential-customers');
29
+ const onlyPotentialCustomers = args.includes('--only-potential-customers');
30
+ const filterEmails: string[] = [];
31
+ const filterExecIds: string[] = [];
32
+
33
+ // Parse email filters (--email=address)
34
+ args.forEach(arg => {
35
+ if (arg.startsWith('--email=')) {
36
+ filterEmails.push(arg.substring(8));
37
+ } else if (arg.startsWith('exec-')) {
38
+ filterExecIds.push(arg);
39
+ }
40
+ });
41
+
42
+ // Find the most recent newsletter
43
+ const newslettersDir = join(process.cwd(), 'docs', 'customer-development', 'newsletters');
44
+
45
+ if (!existsSync(newslettersDir)) {
46
+ console.error('āŒ Error: No newsletters directory found');
47
+ console.error(' Expected: docs/customer-development/newsletters/');
48
+ console.error(' Generate a newsletter first using the AI agent workflow');
49
+ process.exit(1);
50
+ }
51
+
52
+ const files = readdirSync(newslettersDir)
53
+ .filter(f => f.startsWith('newsletter-') && f.endsWith('.json'))
54
+ .sort()
55
+ .reverse(); // Most recent first
56
+
57
+ if (files.length === 0) {
58
+ console.error('āŒ Error: No newsletter files found');
59
+ console.error(' Generate a newsletter first using the AI agent workflow');
60
+ process.exit(1);
61
+ }
62
+
63
+ const latestNewsletter = files[0];
64
+ const newsletterPath = join(newslettersDir, latestNewsletter);
65
+
66
+ console.log(`šŸ“„ Found newsletter: ${latestNewsletter}`);
67
+
68
+ if (showOnly) {
69
+ console.log(`šŸ“‹ Listing recipients (--showonly mode - no emails will be sent)...\n`);
70
+ } else if (filterEmails.length > 0 || filterExecIds.length > 0) {
71
+ console.log(`šŸ“§ Sending to filtered recipients...\n`);
72
+ console.log(`āš ļø This will send real emails. Make sure the newsletter is approved!`);
73
+ } else {
74
+ if (onlyPotentialCustomers) {
75
+ console.log(`šŸ“§ Sending to potential customers only...\n`);
76
+ } else {
77
+ console.log(`šŸ“§ Sending to all active executives${excludePotentialCustomers ? '' : ' and potential customers'}...\n`);
78
+ }
79
+ console.log(`āš ļø This will send real emails. Make sure the newsletter is approved!`);
80
+ }
81
+
82
+ console.log(` Preview: ${newsletterPath.replace('.json', '.html')}\n`);
83
+
84
+ // Determine what to include based on flags
85
+ const includePotentialCustomers = onlyPotentialCustomers || !excludePotentialCustomers;
86
+ const includeExecutives = !onlyPotentialCustomers;
87
+
88
+ // Send newsletter (or show only)
89
+ await sendNewsletterToExecutives(
90
+ newsletterPath,
91
+ filterEmails.length > 0 ? filterEmails : undefined,
92
+ filterExecIds.length > 0 ? filterExecIds : undefined,
93
+ includePotentialCustomers,
94
+ showOnly,
95
+ includeExecutives
96
+ );
97
+ }
98
+
99
+ main().catch(error => {
100
+ console.error('āŒ Error:', error.message);
101
+ process.exit(1);
102
+ });
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env tsx
2
+
3
+ /**
4
+ * Send Thank-You Emails from Candidates JSON File
5
+ *
6
+ * Usage:
7
+ * npm run send-thank-you -- <filename> [exec-id-1] [exec-id-2] ...
8
+ *
9
+ * Examples:
10
+ * npm run send-thank-you -- docs/customer-development/thank-you-notes/thank-you-candidates-2025-10-29.json
11
+ * npm run send-thank-you -- docs/customer-development/thank-you-notes/thank-you-candidates-2025-10-29.json exec-123 exec-456
12
+ */
13
+
14
+ import { sendCustomerMail } from './generate-engagement-emails';
15
+
16
+ async function main() {
17
+ const args = process.argv.slice(2);
18
+
19
+ if (args.length === 0) {
20
+ console.error('āŒ Error: Missing required argument: filename');
21
+ console.error('');
22
+ console.error('Usage: npm run send-thank-you -- <filename> [exec-id-1] [exec-id-2] ...');
23
+ console.error('');
24
+ console.error('Examples:');
25
+ console.error(' npm run send-thank-you -- docs/customer-development/thank-you-notes/thank-you-candidates-2025-10-29.json');
26
+ console.error(' npm run send-thank-you -- docs/customer-development/thank-you-notes/thank-you-candidates-2025-10-29.json exec-1760627251980-31qmjy5y4');
27
+ process.exit(1);
28
+ }
29
+
30
+ const filename = args[0];
31
+ const execIds = args.slice(1).filter(arg => arg.startsWith('exec-'));
32
+
33
+ if (execIds.length === 0) {
34
+ // Send to all pending candidates
35
+ console.log(`šŸ“§ Sending emails from: ${filename}`);
36
+ console.log(`šŸŽÆ Sending to ALL pending candidates`);
37
+ await sendCustomerMail(filename);
38
+ } else if (execIds.length === 1) {
39
+ // Send to specific executive
40
+ console.log(`šŸ“§ Sending emails from: ${filename}`);
41
+ console.log(`šŸŽÆ Sending to executive: ${execIds[0]}`);
42
+ await sendCustomerMail(filename, execIds[0]);
43
+ } else {
44
+ // Multiple executives - send to each one
45
+ console.log(`šŸ“§ Sending emails from: ${filename}`);
46
+ console.log(`šŸŽÆ Sending to ${execIds.length} executives: ${execIds.join(', ')}`);
47
+ for (const execId of execIds) {
48
+ console.log(`\nšŸ“§ Processing executive: ${execId}`);
49
+ await sendCustomerMail(filename, execId);
50
+ }
51
+ }
52
+ }
53
+
54
+ main().catch(error => {
55
+ console.error('āŒ Error:', error);
56
+ process.exit(1);
57
+ });