marketing-mindset 1.4.0 → 1.6.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 (3) hide show
  1. package/README.md +15 -0
  2. package/bin/cli.js +157 -0
  3. package/package.json +6 -3
package/README.md CHANGED
@@ -67,3 +67,18 @@ npx -y marketing-mindset@1.4.0 warmup --start 2026-09-21 --target 200 --days 21
67
67
  ```
68
68
 
69
69
  Day-by-day ramp for a new sending domain: starts at 20/day (or the target, if smaller), grows by half a day, never above the target, and prints the four stop rules (bounce >2%/day, complaints >0.1%, any reply ends that sequence, opens halving with flat sends -> drop back two ramp days). `--json` gives the machine-readable schedule. Work with me: https://axelfreeman.com/marketing-engineer.html
70
+
71
+ ### Test budget: `budget`
72
+
73
+ ```
74
+ npx -y marketing-mindset@1.5.0 budget --base 0.03 --lift 0.2 --cpl 4 --daily 500
75
+ ```
76
+
77
+ The money side of the same floor `sample` computes: contacts needed in both arms, cost per arm and cost to read the test at your cost per contact, days to the floor at a given daily volume, and the spend guard (below the floor the difference is noise, not a result). `--json` for agents. Work with me: https://axelfreeman.com/marketing-engineer.html
78
+ ### Dated plan: `plan`
79
+
80
+ ```
81
+ npx -y marketing-mindset@1.6.0 plan --base 0.03 --lift 0.2 --daily 500 --weeks 4
82
+ ```
83
+
84
+ The floor from `sample`/`budget` laid out on a calendar: contacts per week, cumulative volume against the floor, the first date the test can honestly be read, the mechanics-only first week, and an honest verdict when the volume cannot reach the floor inside the plan. `--json` for agents. Work with me: https://axelfreeman.com/marketing-engineer.html
package/bin/cli.js CHANGED
@@ -233,6 +233,153 @@ function runWarmup(opts) {
233
233
  return 0;
234
234
  }
235
235
 
236
+ /* budget — the money it takes to read a test, from the same sample-size floor as `sample`. */
237
+ function runBudget(opts) {
238
+ const base = Number(opts.base === undefined ? 0 : opts.base);
239
+ const lift = Number(opts.lift === undefined ? 0 : opts.lift);
240
+ if (!isFinite(base) || base <= 0 || base >= 1) {
241
+ console.error("budget: --base must be a rate between 0 and 1 (got: " + JSON.stringify(opts.base) + ")");
242
+ return 1;
243
+ }
244
+ if (!isFinite(lift) || lift <= 0) {
245
+ console.error("budget: --lift must be a positive relative lift, e.g. 0.2 for +20% (got: " + JSON.stringify(opts.lift) + ")");
246
+ return 1;
247
+ }
248
+ const cpl = Number(opts.cpl === undefined ? 0 : opts.cpl);
249
+ if (!isFinite(cpl) || cpl <= 0) {
250
+ console.error("budget: --cpl must be a positive cost per contact (got: " + JSON.stringify(opts.cpl) + ")");
251
+ return 1;
252
+ }
253
+ const power = opts.power === undefined ? 0.8 : opts.power;
254
+ const alpha = opts.alpha === undefined ? 0.05 : opts.alpha;
255
+ const daily = opts.daily === undefined ? 0 : Number(opts.daily);
256
+ if (opts.daily !== undefined && (!isFinite(daily) || daily <= 0)) {
257
+ console.error("budget: --daily must be a positive number of contacts per day");
258
+ return 1;
259
+ }
260
+ const perArm = sampleSize(base, lift, power, alpha);
261
+ const bothArms = perArm * 2;
262
+ const perArmCost = Math.round(perArm * cpl * 100) / 100;
263
+ const totalCost = Math.round(bothArms * cpl * 100) / 100;
264
+ const days = daily > 0 ? Math.ceil(bothArms / daily) : null;
265
+ const p2 = base * (1 + lift);
266
+ const expectedLift = Math.round((p2 - base) * 10000) / 10000;
267
+ if (opts.json) {
268
+ console.log(JSON.stringify({
269
+ base_rate: base, target_rate: Math.round(p2 * 10000) / 10000, relative_lift: lift, power: power, alpha: alpha,
270
+ per_arm: perArm, contacts_needed: bothArms, cost_per_contact: cpl,
271
+ cost_per_arm: perArmCost, cost_to_read_the_test: totalCost,
272
+ daily_contacts: daily > 0 ? daily : null, days_to_read: days,
273
+ spend_guard: [
274
+ "below the per-arm floor the difference is noise, not a result - that spend is a donation",
275
+ "decide the kill rule before the first send: what result ends the test and what result doubles it",
276
+ "if cost_to_read_the_test is more than the deal is worth, change the base rate or the channel, not the sample"
277
+ ],
278
+ method: "two-proportion sample size; same formula as `marketing-mindset sample`"
279
+ }, null, 2));
280
+ return 0;
281
+ }
282
+ console.log("Honest test budget: base " + (base * 100).toFixed(2) + "% -> target " + (p2 * 100).toFixed(2)
283
+ + "% (relative lift " + lift + "), power " + power + ", alpha " + alpha);
284
+ console.log("Per arm: " + perArm + " contacts | both arms: " + bothArms + " contacts");
285
+ console.log("At $" + cpl + " per contact: $" + perArmCost + " per arm, $" + totalCost + " to read the test");
286
+ if (days) console.log("At " + daily + " contacts/day: " + days + " days to reach the floor");
287
+ console.log("Spend guard: under the floor the difference is noise, not a result - that spend is a donation.");
288
+ console.log("Kill rule first: what result ends the test, what result doubles it.");
289
+ console.log("Method and packages: https://axelfreeman.com/marketing-engineer.html");
290
+ return 0;
291
+ }
292
+
293
+
294
+ /* plan — the same floor as `sample`/`budget`, laid out on a calendar: weekly volume, the date the
295
+ * test can first be read, the mechanics-only week, and an honest verdict when it does not fit. */
296
+ function runPlan(opts) {
297
+ const base = Number(opts.base === undefined ? 0 : opts.base);
298
+ const lift = Number(opts.lift === undefined ? 0 : opts.lift);
299
+ if (!isFinite(base) || base <= 0 || base >= 1) {
300
+ console.error("plan: --base must be a rate between 0 and 1 (got: " + JSON.stringify(opts.base) + ")");
301
+ return 1;
302
+ }
303
+ if (!isFinite(lift) || lift <= 0) {
304
+ console.error("plan: --lift must be a positive relative lift, e.g. 0.2 for +20%");
305
+ return 1;
306
+ }
307
+ const daily = Number(opts.daily === undefined ? 0 : opts.daily);
308
+ if (!isFinite(daily) || daily <= 0) {
309
+ console.error("plan: --daily must be a positive number of contacts per day (got: " + JSON.stringify(opts.daily) + ")");
310
+ return 1;
311
+ }
312
+ const weeks = opts.weeks === undefined ? 4 : Number(opts.weeks);
313
+ if (!isFinite(weeks) || weeks < 1 || weeks > 52 || Math.floor(weeks) !== weeks) {
314
+ console.error("plan: --weeks must be a whole number between 1 and 52");
315
+ return 1;
316
+ }
317
+ const power = opts.power === undefined ? 0.8 : opts.power;
318
+ const alpha = opts.alpha === undefined ? 0.05 : opts.alpha;
319
+ const start = typeof opts.start === "string" && /^\d{4}-\d{2}-\d{2}$/.test(opts.start)
320
+ ? opts.start : new Date().toISOString().slice(0, 10);
321
+ const t0 = Date.parse(start + "T00:00:00Z");
322
+ const day = (n) => new Date(t0 + n * 86400000).toISOString().slice(0, 10);
323
+
324
+ const perArm = sampleSize(base, lift, power, alpha);
325
+ const need = perArm * 2;
326
+ const daysToRead = Math.ceil(need / daily);
327
+ const weekRows = [];
328
+ for (let w = 1; w <= weeks; w++) {
329
+ const confirmed = Math.min(daily * 7 * w, need);
330
+ weekRows.push({
331
+ week: w,
332
+ start: day((w - 1) * 7),
333
+ end: day(w * 7 - 1),
334
+ planned_contacts: daily * 7,
335
+ cumulative: daily * 7 * w,
336
+ against_floor_pct: Math.round(Math.min(100, (daily * 7 * w / need) * 1000) / 10)
337
+ });
338
+ }
339
+ const capacity = daily * 7 * weeks;
340
+ const readable = capacity >= need;
341
+ const p2 = base * (1 + lift);
342
+ const out = {
343
+ start_date: start,
344
+ base_rate: base, target_rate: Math.round(p2 * 10000) / 10000, relative_lift: lift,
345
+ power: power, alpha: alpha,
346
+ per_arm: perArm, contacts_needed: need, daily_contacts: daily, weeks_planned: weeks,
347
+ weekly_volume: daily * 7, planned_capacity: capacity,
348
+ capacity_vs_floor_pct: Math.round((capacity / need) * 1000) / 10,
349
+ days_to_read: daysToRead,
350
+ read_date: day(daysToRead - 1),
351
+ readable_within_plan: readable,
352
+ plan: weekRows,
353
+ gates: [
354
+ "Week 1 is mechanics only: delivery, bounces, replies per 100 sent. Do not read a conversion rate.",
355
+ "First honest read: " + day(daysToRead - 1) + " - before that date a difference between variants is noise.",
356
+ "Every week: if the delivered volume is under half of the planned volume, fix the channel first; the test is not running."
357
+ ],
358
+ kill_rule: "What result ends the test and what result doubles it is decided before the first send, in writing.",
359
+ verdict: readable
360
+ ? "Readable in " + weeks + " week(s): the floor lands on " + day(daysToRead - 1) + " at " + daily + " contacts/day."
361
+ : "Not readable in " + weeks + " week(s): " + capacity + " contacts planned against a floor of " + need +
362
+ ". At " + daily + " contacts/day it needs " + daysToRead + " days - extend the plan, raise the volume, or change the offer.",
363
+ method: "two-proportion sample size; same formula as `marketing-mindset sample`"
364
+ };
365
+ if (opts.json) {
366
+ console.log(JSON.stringify(out, null, 2));
367
+ return 0;
368
+ }
369
+ console.log("Plan from " + out.start_date + ": base " + (base * 100).toFixed(2) + "% -> " +
370
+ (p2 * 100).toFixed(2) + "% (lift " + lift + "), " + daily + " contacts/day, " + weeks + " week(s)");
371
+ console.log("Floor: " + perArm + " per arm, " + need + " contacts in total. Weekly volume: " + daily * 7 + ".");
372
+ weekRows.forEach((w) => {
373
+ console.log(" Week " + w + " (" + w.start + " .. " + w.end + "): " + w.planned_contacts +
374
+ " contacts, cumulative " + w.cumulative + " (" + w.against_floor_pct + "% of the floor)");
375
+ });
376
+ console.log("First honest read: " + out.read_date + " (day " + daysToRead + ").");
377
+ console.log(out.verdict);
378
+ out.gates.forEach((g) => console.log(" gate: " + g));
379
+ console.log("Packages and the walkthrough: https://axelfreeman.com/marketing-engineer.html");
380
+ return 0;
381
+ }
382
+
236
383
  const cmd = (process.argv[2] || "").toLowerCase();
237
384
  const rest = process.argv.slice(3);
238
385
 
@@ -267,6 +414,10 @@ if (cmd === "sample") {
267
414
  }, null, 2));
268
415
  } else if (cmd === "aeo") {
269
416
  process.exit(runAeo(flags(rest)));
417
+ } else if (cmd === "plan") {
418
+ process.exit(runPlan(flags(rest)));
419
+ } else if (cmd === "budget") {
420
+ process.exit(runBudget(flags(rest)));
270
421
  } else if (cmd === "warmup") {
271
422
  process.exit(runWarmup(flags(rest)));
272
423
  } else if (cmd === "jd") {
@@ -293,6 +444,12 @@ Usage:
293
444
  --base 0.03 --lift 0.2 --power 0.8 --alpha 0.05
294
445
  npx marketing-mindset kill kill rule for a running test
295
446
  --base 0.03 --n 1500 --lift 0.2
447
+ npx marketing-mindset budget what an honest test costs before you can read it
448
+ --base 0.03 --lift 0.2 --cpl 4 [--daily 500]
449
+ npx marketing-mindset plan dated plan: weekly volume, gates, first honest read
450
+ --base 0.03 --lift 0.2 --daily 500 [--weeks 4] [--start 2026-09-21]
451
+ npx marketing-mindset plan dated plan: weekly volume, gates, first honest read
452
+ --base 0.03 --lift 0.2 --daily 500 [--weeks 4] [--start 2026-09-21]
296
453
  npx marketing-mindset warmup day-by-day sending ramp with stop rules
297
454
  --start 2026-09-21 --target 200 --days 21 --mailboxes 4
298
455
  npx marketing-mindset jd marketing engineer job description
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "marketing-mindset",
3
- "version": "1.4.0",
4
- "description": "A marketer's operating mindset as an installable agent skill and CLI: test-size floors, kill rules, agent-readiness checklist, marketing-engineer job description. npx marketing-mindset sample|kill|warmup|aeo|jd|sections|read|install.",
3
+ "version": "1.6.0",
4
+ "description": "A marketer's operating mindset as an installable agent skill and CLI: test-size floors, kill rules, agent-readiness checklist, marketing-engineer job description. npx marketing-mindset sample|kill|budget|warmup|aeo|jd|sections|read|install.",
5
5
  "keywords": [
6
6
  "agent-skill",
7
7
  "skill",
@@ -16,7 +16,10 @@
16
16
  "job-description",
17
17
  "cold-email",
18
18
  "deliverability",
19
- "warmup"
19
+ "warmup",
20
+ "budget",
21
+ "cac",
22
+ "unit-economics"
20
23
  ],
21
24
  "license": "MIT",
22
25
  "author": "Axel Freeman",