marketing-mindset 1.0.0 → 1.1.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 (2) hide show
  1. package/bin/cli.js +129 -0
  2. package/package.json +4 -3
package/bin/cli.js ADDED
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env node
2
+ /* marketing-mindset CLI — the skill and its numbers without opening a file.
3
+ * marketing-mindset help + the test-size floors
4
+ * marketing-mindset sample required per-arm sample size for a two-proportion test
5
+ * marketing-mindset kill the kill rule for a running test
6
+ * marketing-mindset sections list every section of SKILL.md
7
+ * marketing-mindset read <text> print one section by fuzzy title match
8
+ * marketing-mindset install copy the skill into your agent's skills directory
9
+ */
10
+ const fs = require("fs");
11
+ const path = require("path");
12
+
13
+ const pkgRoot = path.join(__dirname, "..");
14
+ const SKILL = path.join(pkgRoot, "skill", "SKILL.md");
15
+
16
+ const ZA = { "0.05": 1.9599639845, "0.01": 2.5758293036, "0.1": 1.6448536270, "0.975": 1.9599639845 };
17
+ const ZB = { "0.8": 0.8416212336, "0.9": 1.2815515655 };
18
+
19
+ function sampleSize(rate, lift, power, alpha) {
20
+ const p1 = Math.min(Math.max(rate, 0.000001), 0.999999);
21
+ const p2 = Math.min(p1 * (1 + lift), 0.999999);
22
+ const pbar = (p1 + p2) / 2;
23
+ const za = ZA[String(alpha)] || ZA["0.05"];
24
+ const zb = ZB[String(power)] || ZB["0.8"];
25
+ const num = Math.pow(za * Math.sqrt(2 * pbar * (1 - pbar)) + zb * Math.sqrt(p1 * (1 - p1) + p2 * (1 - p2)), 2);
26
+ return Math.ceil(num / Math.pow(p2 - p1, 2));
27
+ }
28
+
29
+ function flags(argv) {
30
+ const out = {};
31
+ argv.forEach((a, i) => {
32
+ if (a.startsWith("--")) {
33
+ const v = argv[i + 1];
34
+ out[a.slice(2)] = v && !v.startsWith("--") ? Number(v) : true;
35
+ }
36
+ });
37
+ return out;
38
+ }
39
+
40
+ function sections(md) {
41
+ const lines = md.split("\n");
42
+ const out = [];
43
+ let cur = null;
44
+ lines.forEach((l) => {
45
+ const m = /^##\s+(.*)$/.exec(l);
46
+ if (m) {
47
+ if (cur) out.push(cur);
48
+ cur = { title: m[1].trim(), body: [] };
49
+ } else if (cur) cur.body.push(l);
50
+ });
51
+ if (cur) out.push(cur);
52
+ return out;
53
+ }
54
+
55
+ function readSkill() {
56
+ if (!fs.existsSync(SKILL)) {
57
+ console.error("SKILL.md missing from this install (expected at " + SKILL + ")");
58
+ process.exit(2);
59
+ }
60
+ return fs.readFileSync(SKILL, "utf8");
61
+ }
62
+
63
+ const cmd = (process.argv[2] || "").toLowerCase();
64
+ const rest = process.argv.slice(3);
65
+
66
+ if (cmd === "sample") {
67
+ const f = flags(rest);
68
+ const rate = Number(f.base !== undefined ? f.base : 0.03);
69
+ const lift = Number(f.lift !== undefined ? f.lift : 0.2) ;
70
+ const power = Number(f.power !== undefined ? f.power : 0.8);
71
+ const alpha = Number(f.alpha !== undefined ? f.alpha : 0.05);
72
+ const n = sampleSize(rate, lift, power, alpha);
73
+ console.log(JSON.stringify({
74
+ baseline_rate: rate, min_relative_lift: lift, power, alpha,
75
+ per_arm: n, total: n * 2,
76
+ note: "Below this, a difference between variants is random noise. Declare this number before the test starts."
77
+ }, null, 2));
78
+ } else if (cmd === "kill") {
79
+ const f = flags(rest);
80
+ const rate = Number(f.base !== undefined ? f.base : 0.03);
81
+ const n = Number(f.n !== undefined ? f.n : 1500);
82
+ const lift = Number(f.lift !== undefined ? f.lift : 0.2);
83
+ const floor = Math.max(0, Math.floor(rate * n - 1.2816 * Math.sqrt(n * rate * (1 - rate))));
84
+ const needed = sampleSize(rate, lift, 0.8, 0.05);
85
+ console.log(JSON.stringify({
86
+ baseline_rate: rate, n, min_relative_lift: lift,
87
+ expected_conversions: Math.round(rate * n * 10) / 10,
88
+ kill_floor: floor,
89
+ target_conversions: Math.round(rate * (1 + lift) * n * 10) / 10,
90
+ volume_needed_per_arm: needed,
91
+ verdict: n < needed
92
+ ? "keep running — below the required volume, a verdict now is noise"
93
+ : "read it — volume is sufficient; kill if conversions are at or under the floor"
94
+ }, null, 2));
95
+ } else if (cmd === "sections") {
96
+ sections(readSkill()).forEach((s, i) => console.log(String(i + 1).padStart(2) + ". " + s.title));
97
+ } else if (cmd === "read") {
98
+ const q = rest.join(" ").toLowerCase();
99
+ if (!q) { console.error("usage: marketing-mindset read <part of a section title>"); process.exit(1); }
100
+ const hit = sections(readSkill()).find((s) => s.title.toLowerCase().includes(q));
101
+ if (!hit) {
102
+ console.error("no section matches: " + q + " — run: marketing-mindset sections");
103
+ process.exit(1);
104
+ }
105
+ console.log("## " + hit.title + "\n" + hit.body.join("\n").trim());
106
+ } else if (cmd === "install") {
107
+ require(path.join(__dirname, "install.js"));
108
+ } else {
109
+ console.log(`marketing-mindset — the marketing OS for AI agents
110
+
111
+ Usage:
112
+ npx marketing-mindset this help + the floors
113
+ npx marketing-mindset sample required per-arm sample size
114
+ --base 0.03 --lift 0.2 --power 0.8 --alpha 0.05
115
+ npx marketing-mindset kill kill rule for a running test
116
+ --base 0.03 --n 1500 --lift 0.2
117
+ npx marketing-mindset sections every section of the skill
118
+ npx marketing-mindset read numbers print one section
119
+ npx marketing-mindset install copy the skill into your agent's skills dir
120
+
121
+ Floors that do not move (see SKILL.md):
122
+ cold email reply-rate test ~1,500-2,000 sends per variant
123
+ landing page smoke test 100-200 targeted visitors
124
+ strict A/B test ~10,000 visitors per variation
125
+ paid ads spend gate 1-3x target CPA, 48-72h
126
+
127
+ Docs: https://axelfreeman.github.io/marketing-mindset/
128
+ Skill: https://github.com/axelfreeman/marketing-mindset`);
129
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "marketing-mindset",
3
- "version": "1.0.0",
4
- "description": "A marketer's operating mindset as an installable agent skill: test-size floors, kill rules, channel economics. Installs SKILL.md for Claude Code, Codex, Hermes and any agent that reads markdown skills.",
3
+ "version": "1.1.0",
4
+ "description": "A marketer's operating mindset as an installable agent skill and CLI: test-size floors, kill rules, channel economics. npx marketing-mindset sample|kill|sections|read|install.",
5
5
  "keywords": [
6
6
  "agent-skill",
7
7
  "skill",
@@ -22,7 +22,8 @@
22
22
  "url": "git+https://github.com/axelfreeman/marketing-mindset.git"
23
23
  },
24
24
  "bin": {
25
- "marketing-mindset": "bin/install.js"
25
+ "marketing-mindset": "bin/cli.js",
26
+ "marketing-mindset-install": "bin/install.js"
26
27
  },
27
28
  "files": [
28
29
  "bin/",