@primitive.ai/prim 0.1.0-alpha.120 → 0.1.0-alpha.122

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 (46) hide show
  1. package/README.md +45 -9
  2. package/SKILL.md +7 -2
  3. package/dist/{chunk-P2O7NLVN.js → chunk-4GYJHN26.js} +117 -18
  4. package/dist/{chunk-VOC4KOOP.js → chunk-4M23K2KZ.js} +2 -2
  5. package/dist/{chunk-NQFRQ56V.js → chunk-4NUGCUQC.js} +2 -2
  6. package/dist/{chunk-GYQOZGGF.js → chunk-5ME3WD3P.js} +2 -2
  7. package/dist/{chunk-CCGFRNAA.js → chunk-7LXRFXZG.js} +248 -127
  8. package/dist/{chunk-MWNRXAEB.js → chunk-AKGRY7OU.js} +1 -1
  9. package/dist/{chunk-D235RJNO.js → chunk-DQ4I3FLF.js} +3 -3
  10. package/dist/{chunk-R2NUH4B7.js → chunk-FT673ALA.js} +2 -2
  11. package/dist/{chunk-TC4FTRYO.js → chunk-HG7FJK7R.js} +2 -2
  12. package/dist/{chunk-5BQ2NEMP.js → chunk-HLMC7VS4.js} +2615 -941
  13. package/dist/{chunk-L52OD62C.js → chunk-JYPVPYW3.js} +14 -8
  14. package/dist/{chunk-2AKDX4RU.js → chunk-JZC2LHS6.js} +1 -1
  15. package/dist/{chunk-SLDZJD6Q.js → chunk-NMZSCSMY.js} +1 -1
  16. package/dist/{chunk-LTTF4MBE.js → chunk-OXW6PSPT.js} +2 -2
  17. package/dist/{chunk-EYBE724K.js → chunk-QG3GASJO.js} +4 -4
  18. package/dist/{chunk-A6M2M5A2.js → chunk-RRAC76LJ.js} +1 -1
  19. package/dist/{chunk-U67RBNIZ.js → chunk-S3ZIMGXV.js} +1 -1
  20. package/dist/{chunk-HXICZG5J.js → chunk-T2T45KF6.js} +4 -4
  21. package/dist/{chunk-LBCPRHNG.js → chunk-WN7OURQ3.js} +1 -1
  22. package/dist/{chunk-YTF6OCF3.js → chunk-ZQ7UK5US.js} +5 -5
  23. package/dist/daemon/server.js +2603 -867
  24. package/dist/hook-runtime/daemon/server.js +2603 -867
  25. package/dist/hook-runtime/hooks/post-commit.js +2671 -935
  26. package/dist/hook-runtime/hooks/post-rewrite.js +2664 -928
  27. package/dist/hook-runtime/hooks/post-tool-use.js +2606 -870
  28. package/dist/hook-runtime/hooks/pre-commit.js +9 -5
  29. package/dist/hook-runtime/hooks/pre-tool-use-worker.js +2625 -947
  30. package/dist/hook-runtime/hooks/prim-hook.js +2609 -873
  31. package/dist/hook-runtime/hooks/session-end.js +75 -13
  32. package/dist/hook-runtime/hooks/session-start.js +2801 -1056
  33. package/dist/hook-runtime/index.js +3741 -1556
  34. package/dist/hook-runtime/statusline-main.js +76 -14
  35. package/dist/hooks/post-commit.js +7 -7
  36. package/dist/hooks/post-rewrite.js +6 -6
  37. package/dist/hooks/post-tool-use.js +15 -15
  38. package/dist/hooks/pre-commit.js +4 -4
  39. package/dist/hooks/pre-tool-use-worker.js +9 -9
  40. package/dist/hooks/prim-hook.js +17 -17
  41. package/dist/hooks/session-end.js +4 -4
  42. package/dist/hooks/session-start.js +11 -11
  43. package/dist/index.js +419 -112
  44. package/dist/statusline-main.js +76 -14
  45. package/package.json +4 -2
  46. package/skills/prim-welcome/SKILL.md +197 -0
@@ -521,26 +521,87 @@ function daemonRequest(method, params = {}, opts = {}) {
521
521
  }
522
522
 
523
523
  // src/lib/activation.ts
524
- import { execFileSync as execFileSync2 } from "child_process";
524
+ import { execFileSync as execFileSync3 } from "child_process";
525
525
  import { existsSync as existsSync4, readFileSync as readFileSync6 } from "fs";
526
526
  import { homedir as homedir2 } from "os";
527
527
  import { join as join8 } from "path";
528
528
 
529
- // src/lib/git.ts
529
+ // src/lib/demo-pause.ts
530
530
  import { execFileSync } from "child_process";
531
+ var DEMO_PAUSE_MS = 30 * 6e4;
532
+ var PAUSE_KEY = "prim.demoPause";
533
+ var GIT_TIMEOUT_MS = 1e3;
534
+ function git(cwd, args) {
535
+ try {
536
+ return execFileSync("git", args, {
537
+ cwd,
538
+ encoding: "utf-8",
539
+ stdio: ["ignore", "pipe", "ignore"],
540
+ timeout: GIT_TIMEOUT_MS
541
+ });
542
+ } catch {
543
+ return void 0;
544
+ }
545
+ }
546
+ function setLocal(cwd, key, value) {
547
+ try {
548
+ execFileSync(
549
+ "git",
550
+ value === null ? ["config", "--local", "--unset", key] : ["config", "--local", key, value],
551
+ { cwd, stdio: ["ignore", "ignore", "pipe"], timeout: GIT_TIMEOUT_MS }
552
+ );
553
+ } catch (error) {
554
+ if (value !== null || error.status !== 5) throw error;
555
+ }
556
+ }
557
+ function parsePause(value) {
558
+ const [runId = "", until, previous, state] = value.trim().split(" ");
559
+ const flag = previous === "true" || previous === "false" ? previous : "unset";
560
+ return { runId, until: Number(until) || 0, previous: flag, ending: state !== "active" };
561
+ }
562
+ function readCaptureConfig(cwd) {
563
+ let active;
564
+ let pause;
565
+ const out = git(cwd, ["config", "--get-regexp", "^prim\\.(active|demopause)$"]) ?? "";
566
+ for (const line of out.split("\n")) {
567
+ const space = line.indexOf(" ");
568
+ const key = line.slice(0, space).toLowerCase();
569
+ const value = line.slice(space + 1);
570
+ if (key === "prim.active") active = value === "true" || value === "false" ? value : void 0;
571
+ if (key === "prim.demopause") pause = parsePause(value);
572
+ }
573
+ return { active, pause };
574
+ }
575
+ function resumeCapture(cwd, pause) {
576
+ setLocal(cwd, "prim.active", pause.previous === "unset" ? null : pause.previous);
577
+ setLocal(cwd, PAUSE_KEY, null);
578
+ }
579
+ function healDemoPause(cwd, pause, options = {}) {
580
+ if (pause.until > (options.now ?? Date.now()) && !(pause.ending && options.userPrompt))
581
+ return false;
582
+ try {
583
+ resumeCapture(cwd, pause);
584
+ return true;
585
+ } catch {
586
+ return false;
587
+ }
588
+ }
589
+
590
+ // src/lib/git.ts
591
+ import { execFileSync as execFileSync2 } from "child_process";
531
592
  import { createHash as createHash4 } from "crypto";
532
593
  import { lstatSync as lstatSync2, realpathSync } from "fs";
533
594
  import { basename, dirname as dirname5, isAbsolute as isAbsolute3, relative, resolve as resolve2, sep } from "path";
534
- var GIT_TIMEOUT_MS = 1e3;
595
+ var GIT_TIMEOUT_MS2 = 1e3;
535
596
  var GITHUB_OWNER_PATTERN = /^(?![A-Za-z0-9-]*--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,37}[A-Za-z0-9])?$/u;
536
597
  var GITHUB_REPOSITORY_PATTERN = /^[A-Za-z0-9._-]{1,100}$/u;
537
598
  function gitToplevel(cwd) {
538
599
  try {
539
- return execFileSync("git", ["rev-parse", "--show-toplevel"], {
600
+ return execFileSync2("git", ["rev-parse", "--show-toplevel"], {
540
601
  cwd,
541
602
  encoding: "utf-8",
542
603
  stdio: ["ignore", "pipe", "ignore"],
543
- timeout: GIT_TIMEOUT_MS
604
+ timeout: GIT_TIMEOUT_MS2
544
605
  }).trim();
545
606
  } catch {
546
607
  return null;
@@ -548,11 +609,11 @@ function gitToplevel(cwd) {
548
609
  }
549
610
  function gitValue(cwd, args) {
550
611
  try {
551
- const value = execFileSync("git", args, {
612
+ const value = execFileSync2("git", args, {
552
613
  cwd,
553
614
  encoding: "utf-8",
554
615
  stdio: ["ignore", "pipe", "ignore"],
555
- timeout: GIT_TIMEOUT_MS
616
+ timeout: GIT_TIMEOUT_MS2
556
617
  }).trim();
557
618
  return value || void 0;
558
619
  } catch {
@@ -579,17 +640,17 @@ var PRIM_ACTIVE_KEY = "prim.active";
579
640
  var PRIM_REPO_SYNC_ID_KEY = "prim.repoSyncId";
580
641
  var PRIM_REPO_SYNC_REPOSITORY_KEY = "prim.repoSyncRepository";
581
642
  var PRIM_REPO_BINDING_STATE_KEY = "prim.repoBindingState";
582
- var GIT_TIMEOUT_MS2 = 1e3;
643
+ var GIT_TIMEOUT_MS3 = 1e3;
583
644
  var REPO_SYNC_ID_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
584
645
  var PROJECT_INSTALL_FILES = [".claude/settings.json", ".codex/hooks.json", ".cursor/hooks.json"];
585
646
  var PRIM_HOOK_BINS = ["prim-hook", "prim-pre-tool-use", "prim-post-tool-use"];
586
647
  function repoActiveFlag(cwd, strict = false) {
587
648
  try {
588
- const value = execFileSync2("git", ["config", "--get", PRIM_ACTIVE_KEY], {
649
+ const value = execFileSync3("git", ["config", "--get", PRIM_ACTIVE_KEY], {
589
650
  cwd,
590
651
  encoding: "utf-8",
591
652
  stdio: ["ignore", "pipe", "ignore"],
592
- timeout: GIT_TIMEOUT_MS2
653
+ timeout: GIT_TIMEOUT_MS3
593
654
  }).trim();
594
655
  if (value === "true") return "true";
595
656
  if (value === "false") return "false";
@@ -606,11 +667,11 @@ function isValidRepoSyncId(value) {
606
667
  }
607
668
  function localGitConfigValue(cwd, key) {
608
669
  try {
609
- const value = execFileSync2("git", ["config", "--local", "--get", key], {
670
+ const value = execFileSync3("git", ["config", "--local", "--get", key], {
610
671
  cwd,
611
672
  encoding: "utf-8",
612
673
  stdio: ["ignore", "pipe", "ignore"],
613
- timeout: GIT_TIMEOUT_MS2
674
+ timeout: GIT_TIMEOUT_MS3
614
675
  }).trim();
615
676
  return value || void 0;
616
677
  } catch {
@@ -647,8 +708,9 @@ function hasProjectPrimInstall(cwd) {
647
708
  }
648
709
  return false;
649
710
  }
650
- function isRepoActiveForCapture(cwd) {
651
- const flag = repoActiveFlag(cwd);
711
+ function isRepoActiveForCapture(cwd, options = {}) {
712
+ let { active: flag, pause } = readCaptureConfig(cwd);
713
+ if (pause && healDemoPause(cwd, pause, options)) flag = repoActiveFlag(cwd);
652
714
  if (flag === "true") return true;
653
715
  if (flag === "false") return false;
654
716
  return hasProjectPrimInstall(cwd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primitive.ai/prim",
3
- "version": "0.1.0-alpha.120",
3
+ "version": "0.1.0-alpha.122",
4
4
  "description": "CLI for Primitive's decision graph — passive decision capture, conflict gate, and team presence",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,7 +46,8 @@
46
46
  "assets",
47
47
  "LICENSE",
48
48
  "README.md",
49
- "SKILL.md"
49
+ "SKILL.md",
50
+ "skills/prim-welcome"
50
51
  ],
51
52
  "scripts": {
52
53
  "build": "tsup src/index.ts src/hooks/pre-commit.ts src/hooks/post-commit.ts src/hooks/post-rewrite.ts src/hooks/prim-hook.ts src/hooks/pre-tool-use.ts src/hooks/pre-tool-use-worker.ts src/hooks/post-tool-use.ts src/hooks/session-start.ts src/hooks/session-end.ts --format esm --clean && tsup src/statusline-main.ts src/daemon/server.ts --format esm --splitting false && tsup --config tsup.hook-runtime.config.ts",
@@ -54,6 +55,7 @@
54
55
  "contracts:check": "node scripts/generate-cli-contract.mjs --check",
55
56
  "contracts:provenance": "node scripts/update-cli-contract.mjs --check",
56
57
  "check:decision-identity-golden": "node scripts/check-decision-identity-golden.mjs",
58
+ "check:seed-metadata-golden": "node scripts/check-seed-metadata-golden.mjs",
57
59
  "check:gameplan-companion": "node scripts/check-gameplan-companion.mjs",
58
60
  "check:gameplan-e2e": "node scripts/check-gameplan-e2e.mjs",
59
61
  "check:gameplan-package": "node scripts/check-gameplan-package.mjs",
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: prim-welcome
3
+ description: Welcome a new Primitive user right after `prim setup` finishes - explain Primitive, offer a one-minute conflict demo, confirm capture is on, show the team's recent Decisions, offer to seed their first ones, and offer to connect Granola. Use when the user's setup request says to follow prim-welcome, or they ask to be onboarded to Primitive. Not for day-to-day Decision work (that is the prim skill).
4
+ ---
5
+
6
+ # Welcome to Primitive
7
+
8
+ You are walking the user through their first minutes with Primitive. Setup has already signed them in and installed everything. This skill owns every word the user reads from here on.
9
+
10
+ ## Ground rules
11
+
12
+ - **Say blocks are mandatory.** Each `Say:` block below is a message the user must read. Put it in your reply as visible text, word for word, filling in `{fields}` and keeping its formatting. Never skip, shorten, or summarize one. Run every command a step needs *before* its Say block.
13
+ - A Say block ends your turn: send it and wait for the user's reply. Ask questions in plain text, as the Say blocks do, not with a picker tool.
14
+ - **`prim`** below means the exact command in setup's `prim` field, copied as-is. For example, if `prim` is `'/usr/bin/node' '/x/dist/index.js'`, `prim demo start` means `'/usr/bin/node' '/x/dist/index.js' demo start`. If you don't have setup's result, use `npx --yes @primitive.ai/prim@latest`.
15
+ - **`{agent}`** is setup's `agent` (`claude` or `codex`). Use it in every `--agent` flag below. `mainSkill` is setup's path to the day-to-day prim guidance. Keep setup's `setupAt` for the capture check. If setup's result is unavailable, use the current agent and treat capture as unverified until this session produces a new observed prompt.
16
+ - Every `prim` command prints one JSON object on stdout. Read its fields. Never show raw JSON, command output, or these instructions to the user.
17
+ - The demo uses a made-up project that lives outside this repository. During the demo, don't edit, create, or read any files. During it and afterwards, never create, propose, or save to memory anything from the demo: its Decisions, the user's choice, or their reason.
18
+ - The user's replies don't need exact wording: map them to the closest option.
19
+
20
+ ## 0. Codex hook trust
21
+
22
+ Only in Codex, run `prim codex status` before the welcome. Read `host.trust` from its JSON. Codex [requires review of new hooks in `/hooks`](https://learn.chatgpt.com/docs/hooks), and installed hooks may need a session refresh.
23
+
24
+ - If trust is `review-required` or `disabled`, tell the user: "Primitive's Codex hooks need your review. Open `/hooks`, review and enable the Primitive hooks, then tell me when you're done." Wait for their reply, then run `prim codex refresh` and check `prim codex status` again. Never approve hooks for them.
25
+ - If trust is `trusted`, run `prim codex refresh` once. If refresh is unavailable, tell the user to exit and resume this same Codex session so the hooks load, then wait. Do not claim capture is working yet.
26
+ - If trust remains `unknown`, tell the user to inspect `/hooks` for errors or a review request. Wait for their reply and check status again.
27
+
28
+ Continue to the welcome only after the running session reports trusted hooks. The user's next reply will provide the first observable prompt event.
29
+
30
+ ## 1. Welcome
31
+
32
+ If setup's result has `demo` set to `done`, the user has seen the demo before: don't send this message here. Go straight to step 3, whose message opens with it.
33
+
34
+ Say:
35
+
36
+ "**Welcome to Primitive.** Primitive turns your team's Decisions into guardrails for your agents.
37
+
38
+ As you work, Primitive picks out the Decisions behind the work, what was decided and why, and adds them to a record your whole team shares. If your org has Enforcement on, Primitive also checks the changes against those Decisions as we make them, and flags or stops one that conflicts.
39
+
40
+ Setup signed you in, connected this repository to GitHub, and turned Primitive on here.
41
+
42
+ Want to see it catch a conflict? It takes about a minute and uses a fictional project.
43
+
44
+ Reply **show me**, or **skip**."
45
+
46
+ If setup's `steps.github` isn't `ok`, leave out "connected this repository to GitHub," from that sentence.
47
+
48
+ This message has no picker: send it in full and end your turn.
49
+
50
+ - **show me** → step 2
51
+ - **skip** → run `prim demo skip`, then step 3
52
+
53
+ ## 2. Demo
54
+
55
+ ### 2a. The task
56
+
57
+ In Codex, first run `prim doctor --agent codex --compact`. Start the demo only if `capture.state` is `observed`, `capture.hooks` is `ready`, and `capture.observedAt` is at or after setup's `setupAt`. The user's **show me** reply should supply that observation. If it did not, explain that this session has not shown a working prompt hook; run `prim codex refresh` once if available, otherwise ask the user to resume this same session. Wait for another user reply and recheck before starting. Do not pause capture for a demo while hook execution is unverified.
58
+
59
+ Run `prim demo start`. When `stage` is `prompt`, say:
60
+
61
+ "**Primitive Demo · fictional project**
62
+
63
+ For the sake of demonstration, imagine you've just joined {story.org}'s team, and your first task is adding CSV export for user records. Send this as your next message:
64
+
65
+ > {story.task}
66
+
67
+ (Primitive is paused while we do this, so none of the demo is recorded.)"
68
+
69
+ ### 2b. The conflict
70
+
71
+ When the user sends the task, run `prim demo attempt`. Don't implement the task. When `stage` is `conflict`, say:
72
+
73
+ "**Primitive caught a conflict.**
74
+
75
+ Your task exports user names *and email addresses*. That conflicts with a Decision {conflict.author} made on {conflict.date}:
76
+
77
+ > **{conflict.intent}**
78
+
79
+ **Why {conflict.author} decided this:** {conflict.rationale}
80
+
81
+ `{conflict.file}` today:
82
+
83
+ ```ts
84
+ {conflict.code}
85
+ ```
86
+
87
+ How do you want to resolve it?
88
+
89
+ Reply **adhere** to keep {conflict.author}'s Decision and export names only, or **supersede** to replace it and export names and emails."
90
+
91
+ This message has no picker: send it in full and end your turn. The user needs its formatting and the rationale to decide.
92
+
93
+ - **adhere** → step 2d with `--choice adhere`
94
+ - **supersede** → step 2c
95
+
96
+ ### 2c. The reason
97
+
98
+ Say:
99
+
100
+ "In a sentence, why should this Decision change?
101
+
102
+ (This is just for the demo, so any answer works.)"
103
+
104
+ Use the user's answer, unchanged, as `{reason}`. Never write a reason for them. Choosing supersede already approved the replacement, as in the real product, so don't ask for confirmation: go to step 2d with `--choice supersede --reason '{reason}'` (single-quote the reason, writing each `'` inside it as `'\''`).
105
+
106
+ ### 2d. Resolve
107
+
108
+ Run `prim demo resolve` with the choice above. When `stage` is `completed`, keep its `outcome` and `diff` for step 3 and go on to step 3. Say nothing yet.
109
+
110
+ ### If a demo step doesn't land
111
+
112
+ - `stage` is `pending`: run the same command once more.
113
+ - `stage` is `error` with `reason` `invalid` after the reason step (for example, a reason over 500 characters): ask for a shorter reason, then retry.
114
+ - Still `pending`, any other `error`, or the command fails: run `prim demo skip`, keep a plain-words cause for step 3, and go to step 3. Plain words for each `reason`: `repo-active` → "Primitive was turned back on partway through"; `not-a-repo` → "this folder isn't a git repository"; `not-started` → "the demo hadn't started"; otherwise use `detail`.
115
+ - The user asks to stop: run `prim demo skip`, then go to step 3.
116
+
117
+ `prim demo skip` and a completed demo both end the pause: capture resumes with the user's next message.
118
+
119
+ ## 3. Wrap up
120
+
121
+ Run both of these first:
122
+
123
+ 1. `prim doctor --agent {agent} --compact`. Read `capture`, not the overall `status` alone. Capture is verified for this session only when doctor `status` is not `fail`, `capture.hooks` is `ready`, `capture.observedAt` is at or after setup's `setupAt`, and `capture.state` is `observed` or `paused` with `resumeOnNextPrompt: true`. An ending pause means the next trusted user-prompt hook resumes capture. Otherwise report `capture.detail` and any relevant failed checks; never claim capture is on from an overall `warn` result alone.
124
+ 2. `prim welcome --after-demo --team-sample --agent {agent}`. Read its `org` and `recent` fields. If it fails, treat `org` as `unknown` and `recent` as empty.
125
+
126
+ Then say one message, built from these parts in order. It ends your turn.
127
+
128
+ **Welcome**, only if step 1 was skipped because the demo was `done`: the step 1 message without its last two paragraphs.
129
+
130
+ **a. Demo result.** If the demo completed:
131
+
132
+ "**Resolved.** You {outcome.choice: adhere → kept, supersede → replaced} {outcome.author}'s Decision, and the export changed to match:
133
+
134
+ ```diff
135
+ {diff}
136
+ ```"
137
+
138
+ If `outcome.email` is `queued` or `accepted`, add: "A summary of the Decision is on its way to {outcome.recipient}."
139
+
140
+ If the demo didn't finish: "The demo couldn't finish ({cause}), so it was skipped." If the user skipped it, leave part a out.
141
+
142
+ **b. Capture.** If capture is on:
143
+
144
+ "**Primitive is on for this repository.** From your next message on, it works in the background as you work."
145
+
146
+ If capture is unverified, off, or blocked: "**Primitive is installed, but capture needs attention:**" followed by `capture.detail` and the relevant agent-hook check's `detail`. For Codex, use `/hooks` for review or enablement; if hooks are trusted but the running session did not refresh, use `prim codex refresh` or resume this same session.
147
+
148
+ **c. Recent team Decisions**, only if `recent` isn't empty:
149
+
150
+ "**Recent Decisions on your team**"
151
+
152
+ followed by a numbered list with one item per `recent` entry, in order, each in this two-line shape (the second line indented under the first):
153
+
154
+ "1. **[{intent}]({url})**
155
+ _{author} · {area} · {date}_"
156
+
157
+ Leave out `{area}` and its `·` when an entry has none.
158
+
159
+ **d. How to work with it:**
160
+
161
+ "**How to work with Primitive**
162
+
163
+ - **It's automatic.** Primitive derives Decisions from your work as you go; you don't have to do anything.
164
+ - **Record one explicitly** when you want control over exactly how a Decision is worded and explained, for example: *Add a Decision to Primitive: we keep user emails out of exports, because...*
165
+ - **Ask before you change things**, for example: *What Decisions govern the files I'm about to touch?* or *What has the team decided about auth lately?*
166
+
167
+ See every Decision at https://app.getprimitive.ai."
168
+
169
+ **e. First Decisions**, only if `org` is `seed` (the user hasn't recorded a Decision yet):
170
+
171
+ "You haven't recorded any Decisions yet. Primitive can suggest a few from this conversation and this repository's shared memory files. You approve each one, and approved Decisions are visible to your team. Reply **yes** or **not now**."
172
+
173
+ **f. Granola**, only if you didn't say part e: the Granola question from step 4.
174
+
175
+ If you said part e, wait for the reply:
176
+
177
+ - **yes**: read the prim guidance at setup's `mainSkill` path (for Codex, the managed prim block in `AGENTS.md`) and follow its "Onboarding: seed the graph from memory" section, from its step 1. Leave out everything from the demo. End the final message of that section with the Granola question from step 4.
178
+ - **not now**: say "You can add a Decision to Primitive any time by asking for it." followed by the Granola question from step 4.
179
+
180
+ ## 4. Granola
181
+
182
+ The Granola question:
183
+
184
+ "One more thing: do you use **Granola** for meeting notes? Primitive can capture Decisions from your meetings. When you connect, you choose whether it can read your public notes, private notes, or both.
185
+
186
+ Reply **yes** or **no**."
187
+
188
+ When the user replies:
189
+
190
+ - **yes**: open https://app.getprimitive.ai/settings in their browser (`open <url>` on macOS, `xdg-open <url>` on Linux), then say:
191
+
192
+ "Primitive's Settings are open in your browser. Under **Integrations → Granola**, connect your account and paste your Granola API key (the **Set up your API key** link there opens it in Granola), then click **Sync now**. Primitive will capture Decisions from your meetings once they've synced."
193
+
194
+ If the browser couldn't open, replace "Primitive's Settings are open in your browser." with "Open https://app.getprimitive.ai/settings."
195
+ - **no**: say "No problem. You can connect Granola any time under Settings → Integrations at https://app.getprimitive.ai/settings."
196
+
197
+ Then stop. Don't offer further options.