@ritualai/cli 0.36.39 → 0.36.44

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/README.md +1 -1
  2. package/dist/commands/init.js +58 -133
  3. package/dist/commands/init.js.map +1 -1
  4. package/dist/commands/materialize.js +300 -0
  5. package/dist/commands/materialize.js.map +1 -0
  6. package/dist/index.js +18 -5
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/agents/providers.js +15 -8
  9. package/dist/lib/agents/providers.js.map +1 -1
  10. package/dist/lib/gitignore-update.js +68 -23
  11. package/dist/lib/gitignore-update.js.map +1 -1
  12. package/dist/lib/memory-update.js +31 -22
  13. package/dist/lib/memory-update.js.map +1 -1
  14. package/dist/lib/okf-knowledge.js +201 -0
  15. package/dist/lib/okf-knowledge.js.map +1 -0
  16. package/dist/lib/onboarding-state.js +5 -3
  17. package/dist/lib/onboarding-state.js.map +1 -1
  18. package/dist/lib/project-config.js.map +1 -1
  19. package/dist/lib/uninstall-plan.js +6 -2
  20. package/dist/lib/uninstall-plan.js.map +1 -1
  21. package/package.json +1 -1
  22. package/skills/claude-code/ritual/.ritual-bundle.json +3 -3
  23. package/skills/claude-code/ritual/SKILL.md +2 -2
  24. package/skills/claude-code/ritual/references/build-flow.md +17 -20
  25. package/skills/claude-code/ritual/references/cli-output-contract.md +3 -5
  26. package/skills/claude-code/ritual/references/lite-flow.md +18 -21
  27. package/skills/codex/ritual/.ritual-bundle.json +3 -3
  28. package/skills/codex/ritual/SKILL.md +2 -2
  29. package/skills/codex/ritual/references/build-flow.md +17 -20
  30. package/skills/codex/ritual/references/cli-output-contract.md +3 -5
  31. package/skills/codex/ritual/references/lite-flow.md +18 -21
  32. package/skills/cursor/ritual/.ritual-bundle.json +3 -3
  33. package/skills/cursor/ritual/SKILL.md +2 -2
  34. package/skills/cursor/ritual/references/build-flow.md +17 -20
  35. package/skills/cursor/ritual/references/cli-output-contract.md +3 -5
  36. package/skills/cursor/ritual/references/lite-flow.md +18 -21
  37. package/skills/gemini/ritual/.ritual-bundle.json +3 -3
  38. package/skills/gemini/ritual/SKILL.md +2 -2
  39. package/skills/gemini/ritual/references/build-flow.md +17 -20
  40. package/skills/gemini/ritual/references/cli-output-contract.md +3 -5
  41. package/skills/gemini/ritual/references/lite-flow.md +18 -21
  42. package/skills/kiro/ritual/.ritual-bundle.json +3 -3
  43. package/skills/kiro/ritual/SKILL.md +2 -2
  44. package/skills/kiro/ritual/references/build-flow.md +17 -20
  45. package/skills/kiro/ritual/references/cli-output-contract.md +3 -5
  46. package/skills/kiro/ritual/references/lite-flow.md +18 -21
  47. package/skills/vscode/ritual/.ritual-bundle.json +3 -3
  48. package/skills/vscode/ritual/SKILL.md +2 -2
  49. package/skills/vscode/ritual/references/build-flow.md +17 -20
  50. package/skills/vscode/ritual/references/cli-output-contract.md +3 -5
  51. package/skills/vscode/ritual/references/lite-flow.md +18 -21
@@ -25,12 +25,16 @@ const node_os_1 = require("node:os");
25
25
  * rule), written wholesale as `frontmatter + body`. Like the
26
26
  * scaffolded skill files, it's regenerated every init.
27
27
  *
28
- * Scopes: project (relative to the repo root) always; global (relative to
29
- * $HOME) only when `ritual init --global-memory-rule` is passed.
28
+ * Scopes (as of 2026-06-21): a default `ritual init` writes the developer's
29
+ * PERSONAL surfaces `local` (repo-local `CLAUDE.local.md` / the dedicated
30
+ * rule files, relative to the repo root; the caller adds them to `.gitignore`)
31
+ * and `global` (relative to $HOME, applies across the developer's repos). The
32
+ * COMMITTED, team-shared `project` file is written ONLY when `opts.committed`
33
+ * is passed (the future "share with your team" flow), so a plain init never
34
+ * commits a rule teammates would inherit, and never touches any other repo.
30
35
  *
31
36
  * Mirrors `gitignore-update.ts`: byte-level string ops (preserve line endings),
32
- * idempotent, fail-soft at the call site. Deliberately NOT gitignored — a
33
- * routing rule is team-shareable guidance most repos want committed.
37
+ * idempotent, fail-soft at the call site.
34
38
  */
35
39
  /**
36
40
  * Marker comments delimiting the block we own in `append`-mode files. Matched
@@ -123,10 +127,14 @@ function writeRule(rootDir, target, scope) {
123
127
  return { ...base, changed: true };
124
128
  }
125
129
  /**
126
- * Write the routing rule for every provider's `projectMemoryRule` (always) and
127
- * `userMemoryRule` (only when `opts.global`). De-dupes by absolute path so two
128
- * agents that share a file (e.g. both write `AGENTS.md`) get one write.
129
- * Providers without a rule target for the requested scope are skipped.
130
+ * Write the routing rule to each provider's PERSONAL surfaces by default —
131
+ * `localMemoryRule` (repo-local, gitignored by the caller) + `userMemoryRule`
132
+ * (user-global, $HOME). The COMMITTED, team-shared `projectMemoryRule` is
133
+ * written ONLY when `opts.committed` is passed (the future share-with-team
134
+ * flow). De-dupes by absolute path so two agents that share a file (e.g. both
135
+ * write `AGENTS.md`) get one write. Providers without a target for a given
136
+ * scope are skipped — so Gemini/Codex (no `localMemoryRule`) get only the
137
+ * global write, and Copilot (committed file only) gets nothing on a plain init.
130
138
  *
131
139
  * `opts.homeDir` overrides `$HOME` for the global scope (tests).
132
140
  */
@@ -134,21 +142,22 @@ function updateMemoryRules(projectRoot, providers, opts = {}) {
134
142
  const home = opts.homeDir ?? (0, node_os_1.homedir)();
135
143
  const seen = new Set();
136
144
  const results = [];
145
+ const writeOnce = (root, target, scope) => {
146
+ if (!target)
147
+ return;
148
+ const abs = (0, node_path_1.join)(root, target.path);
149
+ if (seen.has(abs))
150
+ return;
151
+ seen.add(abs);
152
+ results.push(writeRule(root, target, scope));
153
+ };
137
154
  for (const provider of providers) {
138
- if (provider.projectMemoryRule) {
139
- const abs = (0, node_path_1.join)(projectRoot, provider.projectMemoryRule.path);
140
- if (!seen.has(abs)) {
141
- seen.add(abs);
142
- results.push(writeRule(projectRoot, provider.projectMemoryRule, 'project'));
143
- }
144
- }
145
- if (opts.global && provider.userMemoryRule) {
146
- const abs = (0, node_path_1.join)(home, provider.userMemoryRule.path);
147
- if (!seen.has(abs)) {
148
- seen.add(abs);
149
- results.push(writeRule(home, provider.userMemoryRule, 'global'));
150
- }
151
- }
155
+ // Personal surfaces — written by default, never committed/shared:
156
+ writeOnce(projectRoot, provider.localMemoryRule, 'local'); // repo-local (gitignored)
157
+ writeOnce(home, provider.userMemoryRule, 'global'); // user-global ($HOME)
158
+ // Team-shared committed surface — opt-in only (share-with-team flow):
159
+ if (opts.committed)
160
+ writeOnce(projectRoot, provider.projectMemoryRule, 'project');
152
161
  }
153
162
  return results;
154
163
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memory-update.js","sourceRoot":"","sources":["../../src/lib/memory-update.ts"],"names":[],"mappings":";;;AA4JA,8CA0BC;AAtLD,qCAA6E;AAC7E,yCAA0C;AAC1C,qCAAkC;AAIlC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;GAGG;AACH,MAAM,YAAY,GAAG,yEAAyE,CAAC;AAC/F,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;SA2BX,CAAC;AAeV,2DAA2D;AAC3D,SAAS,UAAU;IAClB,OAAO,GAAG,YAAY,KAAK,WAAW,KAAK,UAAU,EAAE,CAAC;AACzD,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB,CAAC,IAAY,EAAE,QAAgB;IAC3D,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,QAAQ,IAAI,CAAC,IAAI,MAAM,GAAG,QAAQ,EAAE,CAAC;QACxC,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;QAC9C,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC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AS,CAAC,IAAI,EAAE,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,sBAAsB;QAC1E,sEAAsE;QACtE,IAAI,IAAI,CAAC,SAAS;YAAE,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,uDAAuD;AAC1C,QAAA,aAAa,GAAG,WAAW,CAAC;AAC5B,QAAA,SAAS,GAAG,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,201 @@
1
+ "use strict";
2
+ /**
3
+ * OKF knowledge materialization (ritual-knowledge-loop, 2026-06-21).
4
+ *
5
+ * Two-layer split — the load-bearing principle of `ritual materialize`:
6
+ *
7
+ * 1. KNOWLEDGE (committable, Ritual-AGNOSTIC) — `knowledge/<slug>-<hash>.md`.
8
+ * Problem framing, scope, recommendations-as-prose. Reads as plain project
9
+ * documentation. NEVER contains the brand word "Ritual", a ritualId, or an
10
+ * `mcp://` link. A teammate who never opted into Ritual just sees good docs.
11
+ *
12
+ * 2. RESOLVER (local-only, NAMES Ritual) — `.ritual/resolver.json` + index.md.
13
+ * Maps each agnostic file back to its explorationId / recommendationIds /
14
+ * live `mcp://` re-ground link / drift watermark / source hash. This is the
15
+ * grep target for "does an exploration already exist?" and it stays
16
+ * gitignored.
17
+ *
18
+ * Litmus (enforced by okf-knowledge.spec + the CI leak guard): grep a committed
19
+ * knowledge file for `Ritual` / `ritualId` / `mcp://` → if found, it leaked.
20
+ *
21
+ * The renderers are pure (unit-tested); the fs writes live in
22
+ * commands/materialize.ts.
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.FORBIDDEN_KNOWLEDGE_TOKENS = exports.AGNOSTIC_MARKER = void 0;
26
+ exports.cyrb53 = cyrb53;
27
+ exports.slugify = slugify;
28
+ exports.knowledgeFileName = knowledgeFileName;
29
+ exports.renderKnowledgeDoc = renderKnowledgeDoc;
30
+ exports.findKnowledgeLeak = findKnowledgeLeak;
31
+ exports.liveLink = liveLink;
32
+ exports.buildResolverEntry = buildResolverEntry;
33
+ exports.renderResolverIndex = renderResolverIndex;
34
+ /** Neutral provenance marker — deliberately does NOT name Ritual (it's committed). */
35
+ exports.AGNOSTIC_MARKER = '<!-- Auto-generated — edits may be overwritten. -->';
36
+ /** Tokens that must NEVER appear in committed agnostic knowledge. Mirror in the CI guard. */
37
+ exports.FORBIDDEN_KNOWLEDGE_TOKENS = [
38
+ 'ritualId',
39
+ 'explorationId',
40
+ 'recommendationId',
41
+ 'workspaceId',
42
+ 'mcp://',
43
+ 'Generated by Ritual',
44
+ ];
45
+ /**
46
+ * cyrb53 — small, fast, dependency-free string hash (browser/node-safe, no
47
+ * `Math.random`/`Date.now`). Used for (a) stable short slugs and (b) the
48
+ * source-hash conflict watermark. Same impl family as shared-types' package
49
+ * hash so behavior is familiar.
50
+ */
51
+ function cyrb53(str, seed = 0) {
52
+ let h1 = 0xdeadbeef ^ seed;
53
+ let h2 = 0x41c6ce57 ^ seed;
54
+ for (let i = 0; i < str.length; i++) {
55
+ const ch = str.charCodeAt(i);
56
+ h1 = Math.imul(h1 ^ ch, 2654435761);
57
+ h2 = Math.imul(h2 ^ ch, 1597334677);
58
+ }
59
+ h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
60
+ h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
61
+ const n = 4294967296 * (2097151 & h2) + (h1 >>> 0);
62
+ return n.toString(36);
63
+ }
64
+ /** Slug from a display name: lowercase, non-alnum → '-', collapsed, capped. */
65
+ function slugify(name) {
66
+ const s = (name || 'exploration')
67
+ .toLowerCase()
68
+ .replace(/[^a-z0-9]+/g, '-')
69
+ .replace(/^-+|-+$/g, '')
70
+ .slice(0, 48)
71
+ .replace(/-+$/g, '');
72
+ return s || 'exploration';
73
+ }
74
+ /**
75
+ * Stable, rerun-safe knowledge filename. Embeds a short hash of the
76
+ * explorationId so two explorations that normalize to the same slug never
77
+ * collide, and the same exploration always maps to the same file.
78
+ */
79
+ function knowledgeFileName(exp) {
80
+ const short = cyrb53(exp.id).slice(0, 6);
81
+ return `${slugify(exp.name ?? '')}-${short}.md`;
82
+ }
83
+ /**
84
+ * Drop a leading markdown H1 from brief content. The build-brief renderer
85
+ * prepends a branded title ("# Ritual Build Brief") to every brief — injected
86
+ * boilerplate, not the developer's words. We embed the brief under our own
87
+ * "## Implementation brief" heading, so the brief's own title is redundant AND
88
+ * would leak the brand word into committed agnostic docs. Strip exactly the
89
+ * first H1 line (and a following blank line), leave the body intact.
90
+ */
91
+ function stripLeadingH1(text) {
92
+ const lines = text.split('\n');
93
+ let i = 0;
94
+ while (i < lines.length && lines[i].trim() === '')
95
+ i++;
96
+ if (i < lines.length && /^#\s+/.test(lines[i])) {
97
+ lines.splice(0, i + 1);
98
+ if (lines.length > 0 && lines[0].trim() === '')
99
+ lines.shift();
100
+ return lines.join('\n').trim();
101
+ }
102
+ return text;
103
+ }
104
+ function scopeList(title, items) {
105
+ if (!items || items.length === 0)
106
+ return [`### ${title}`, '', '_(none)_', ''];
107
+ // Text ONLY — never the `id` (those are Ritual identifiers → would leak).
108
+ const lines = items.map((i) => `- ${(i.text ?? '').trim()}`).filter((l) => l !== '- ');
109
+ return [`### ${title}`, '', ...lines, ''];
110
+ }
111
+ /**
112
+ * Render the agnostic knowledge doc for one exploration. Pure. The output is
113
+ * committable: no Ritual brand, no ids, no mcp links — just the reasoning as
114
+ * plain markdown. Recommendation/scope ids are deliberately dropped here and
115
+ * preserved only in the (local) resolver.
116
+ */
117
+ function renderKnowledgeDoc(input) {
118
+ const e = input.exploration;
119
+ const out = [exports.AGNOSTIC_MARKER, '', `# ${e.name ?? 'Exploration'}`, ''];
120
+ if (e.workItemLabel || e.jtbd) {
121
+ out.push(`_${e.workItemLabel ?? e.jtbd}_`, '');
122
+ }
123
+ const problem = (e.problemStatement ?? '').trim();
124
+ if (problem) {
125
+ out.push('## Problem', '', problem, '');
126
+ }
127
+ const s = input.scopeContract;
128
+ if (s && (s.inScope?.length || s.deferred?.length || s.discoveryGates?.length || s.antiGoals?.length)) {
129
+ out.push('## Scope', '');
130
+ out.push(...scopeList('In scope', s.inScope));
131
+ out.push(...scopeList('Discovery gates', s.discoveryGates));
132
+ out.push(...scopeList('Deferred', s.deferred));
133
+ out.push(...scopeList('Anti-goals', s.antiGoals));
134
+ }
135
+ const recs = input.recommendations ?? [];
136
+ if (recs.length > 0) {
137
+ out.push('## Recommendations', '');
138
+ for (const r of recs) {
139
+ const status = r.status ? ` _(${r.status})_` : '';
140
+ out.push(`### ${r.title ?? 'Recommendation'}${status}`, '');
141
+ const body = (r.summary ?? r.content ?? '').trim();
142
+ out.push(body || '_(no summary)_', '');
143
+ }
144
+ }
145
+ const brief = stripLeadingH1((input.briefContent ?? '').trim());
146
+ if (brief) {
147
+ out.push('## Implementation brief', '', brief, '');
148
+ }
149
+ return out.join('\n').replace(/\n{3,}/g, '\n\n').trimEnd() + '\n';
150
+ }
151
+ /** Returns the first forbidden token found in `content`, or null if clean. */
152
+ function findKnowledgeLeak(content) {
153
+ for (const tok of exports.FORBIDDEN_KNOWLEDGE_TOKENS) {
154
+ if (content.includes(tok))
155
+ return tok;
156
+ }
157
+ // Brand word as a whole word, case-sensitive (lowercase "ritual" is allowed —
158
+ // avoids false-positives like "team ritual"). Identifiers above are exact.
159
+ if (/\bRitual\b/.test(content))
160
+ return 'Ritual';
161
+ return null;
162
+ }
163
+ /** Build the `mcp://` re-ground link for an exploration (resolver-only, never committed). */
164
+ function liveLink(explorationId) {
165
+ return `mcp://ritual/get_exploration_status?id=${explorationId}`;
166
+ }
167
+ /** Assemble a resolver entry for one materialized exploration. */
168
+ function buildResolverEntry(input, file, docContent) {
169
+ const e = input.exploration;
170
+ return {
171
+ title: e.name ?? 'Exploration',
172
+ file,
173
+ explorationId: e.id,
174
+ recommendationIds: (input.recommendations ?? [])
175
+ .map((r) => r.id)
176
+ .filter((id) => typeof id === 'string'),
177
+ recommendationsStatus: e.recommendationsStatus ?? null,
178
+ driftWatermark: e.driftWatermark ?? null,
179
+ live: liveLink(e.id),
180
+ sourceHash: cyrb53(docContent),
181
+ };
182
+ }
183
+ /** Render the local human-readable roster (`.ritual/index.md`). Names Ritual — local only. */
184
+ function renderResolverIndex(resolver) {
185
+ const out = [
186
+ '<!-- Local Ritual resolver — gitignored. Maps agnostic knowledge/ docs back to the live graph. -->',
187
+ '',
188
+ '# Ritual knowledge index (local)',
189
+ '',
190
+ `Materialized ${resolver.generatedAt}. ${resolver.entries.length} exploration(s).`,
191
+ '',
192
+ '| Knowledge file | Exploration | Recs | Status |',
193
+ '| --- | --- | --- | --- |',
194
+ ];
195
+ for (const en of resolver.entries) {
196
+ out.push(`| [\`${en.file}\`](../${en.file}) | \`${en.explorationId}\` | ${en.recommendationIds.length} | ${en.recommendationsStatus ?? '—'} |`);
197
+ }
198
+ out.push('', 'Re-ground any row via its `live` link in `resolver.json`.', '');
199
+ return out.join('\n');
200
+ }
201
+ //# sourceMappingURL=okf-knowledge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"okf-knowledge.js","sourceRoot":"","sources":["../../src/lib/okf-knowledge.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AA2CH,wBAYC;AAGD,0BAQC;AAOD,8CAGC;AAmCD,gDAuCC;AAGD,8CAQC;AAwBD,4BAEC;AAGD,gDAkBC;AAGD,kDAkBC;AAjOD,sFAAsF;AACzE,QAAA,eAAe,GAAG,qDAAqD,CAAC;AAErF,6FAA6F;AAChF,QAAA,0BAA0B,GAAsB;IAC5D,UAAU;IACV,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,QAAQ;IACR,qBAAqB;CACrB,CAAC;AAsBF;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,GAAW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qB,EAAE,CAAC,CAAC,qBAAqB,IAAI,IAAI;QACtD,cAAc,EAAE,CAAC,CAAC,cAAc,IAAI,IAAI;QACxC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC;KAC9B,CAAC;AACH,CAAC;AAED,8FAA8F;AAC9F,SAAgB,mBAAmB,CAAC,QAAsB;IACzD,MAAM,GAAG,GAAa;QACrB,oGAAoG;QACpG,EAAE;QACF,kCAAkC;QAClC,EAAE;QACF,gBAAgB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,OAAO,CAAC,MAAM,kBAAkB;QAClF,EAAE;QACF,kDAAkD;QAClD,2BAA2B;KAC3B,CAAC;IACF,KAAK,MAAM,EAAE,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACnC,GAAG,CAAC,IAAI,CACP,QAAQ,EAAE,CAAC,IAAI,UAAU,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,aAAa,QAAQ,EAAE,CAAC,iBAAiB,CAAC,MAAM,MAAM,EAAE,CAAC,qBAAqB,IAAI,GAAG,IAAI,CACrI,CAAC;IACH,CAAC;IACD,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,2DAA2D,EAAE,EAAE,CAAC,CAAC;IAC9E,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvB,CAAC"}
@@ -107,9 +107,11 @@ function updateOnboardingState(patch) {
107
107
  * the predicate, not every call site.
108
108
  */
109
109
  // shouldShowPersonaPicker was removed 2026-06-11 along with the interactive
110
- // FTUE persona picker (JTBD-first entry) persona now comes only from the
111
- // `--persona` flag or a previously stored pick. The personaPickedAt /
112
- // personaSlug state fields stay: existing machines keep their pick.
110
+ // FTUE persona picker (JTBD-first entry). As of 2026-06-21 `ritual init` no
111
+ // longer reads or writes persona at all (the `--persona` flag + the
112
+ // `user.persona` sync were dropped once every build was confirmed to pass an
113
+ // explicit jtbd). The personaPickedAt / personaSlug state fields stay so
114
+ // existing machines that recorded a pick aren't disturbed.
113
115
  function shouldShowWorkspaceExplainer(state) {
114
116
  return !state.workspaceExplainerSeenAt;
115
117
  }
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding-state.js","sourceRoot":"","sources":["../../src/lib/onboarding-state.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;;AAmDH,kDAeC;AAQD,sDAKC;AAaD,oEAEC;AAaD,oDAEC;AA3GD,qCAAkC;AAClC,yCAAiC;AACjC,qCAA6E;AAE7E,uDAAuD;AACvD,MAAM,eAAe,GAAG,CAAC,CAAC;AAwB1B;;;;;;;GAOG;AACH,SAAS,cAAc;IACtB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,MAAM,IAAI,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,gBAAI,EAAC,IAAA,iBAAO,GAAE,EAAE,SAAS,CAAC,CAAC;IACtE,OAAO,IAAA,gBAAI,EAAC,IAAI,EAAE,QAAQ,EAAE,iBAAiB,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB;IAClC,MAAM,IAAI,GAAG,cAAc,EAAE,CAAC;IAC9B,IAAI,CAAC,IAAA,oBAAU,EAAC,IAAI,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3D,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,IAAA,sBAAY,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAA6B,CAAC;QAC3D,IAAI,MAAM,CAAC,OAAO,KAAK,eAAe,EAAE,CAAC;YACxC,uDAAuD;YACvD,wDAAwD;YACxD,OAAO,EAAE,OAAO,EAA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IAAI,CAAC;IACb,CAAC;AACF,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAAC,UAAkB,EAAE,MAAqB;IAC1E,MAAM,CAAC,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC3C,IAAA,mBAAS,EAAC,IAAA,mBAAO,EAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,IAAA,uBAAa,EAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;AACnE,CAAC"}
@@ -81,8 +81,12 @@ function planUninstall(cwd, opts, deps) {
81
81
  });
82
82
  }
83
83
  }
84
- const memPath = p.projectMemoryRule?.path;
85
- if (memPath) {
84
+ // Both the committed file (opt-in) and the repo-local default
85
+ // (CLAUDE.local.md) carry the append-mode marker block — strip it
86
+ // from whichever is present, preserving the user's own content.
87
+ for (const memPath of [p.projectMemoryRule?.path, p.localMemoryRule?.path]) {
88
+ if (!memPath)
89
+ continue;
86
90
  const mp = (0, node_path_1.join)(cwd, memPath);
87
91
  if (deps.exists(mp) && deps.read(mp).includes(memory_update_1.__MARKERS.BEGIN_MARKER)) {
88
92
  actions.push({
@@ -1 +1 @@
1
- {"version":3,"file":"uninstall-plan.js","sourceRoot":"","sources":["../../src/lib/uninstall-plan.ts"],"names":[],"mappings":";;AA8CA,kDAWC;AAOD,4CAWC;AAOD,sCA6EC;AA/JD,yCAAyD;AACzD,mDAA4C;AAC5C,kDAA+C;AAsC/C;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAC,GAAW,EAAE,MAAc;IAC9D,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,GAAG,CAAC,CAAC;IAC1B,MAAM,CAAC,GAAG,IAAA,mBAAO,EAAC,MAAM,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,IAAI;QAAE,MAAM,IAAI,KAAK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;wBACR,KAAK,EAAE,GAAG,OAAO,mDAAmD;qBACpE,CAAC,CAAC;gBACJ,CAAC;YACF,CAAC;QACF,CAAC;IACF,CAAC;IAED,6EAA6E;IAC7E,2EAA2E;IAC3E,2EAA2E;IAC3E,yEAAyE;IACzE,mDAAmD;IACnD,KAAK,MAAM,CAAC,IAAI,qBAAS,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;YACpB,MAAM,GAAG,GAAG,IAAA,gBAAI,EAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC3C,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,0BAA0B;oBAChC,OAAO,EAAE,WAAW,GAAG,GAAG;oBAC1B,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,2BAA2B;iBAC3C,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IAED,2EAA2E;IAC3E,6EAA6E;IAC7E,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC,CAAC;IAE1F,OAAO,OAAO,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ritualai/cli",
3
- "version": "0.36.39",
3
+ "version": "0.36.44",
4
4
  "description": "Ritual CLI — scaffold AI coding agent skills + register MCP servers. Connects Claude Code, Cursor, Windsurf, Kiro, Gemini CLI, VS Code/Copilot, and Codex to Ritual Cloud.",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "0.36.39",
3
- "builtAt": "2026-06-20T13:46:17.028Z",
4
- "skillsHash": "283d2c7cc43e"
2
+ "cliVersion": "0.36.44",
3
+ "builtAt": "2026-06-22T01:57:48.029Z",
4
+ "skillsHash": "020ff37f037f"
5
5
  }
@@ -3,8 +3,8 @@ name: ritual
3
3
  description: "Use when an engineer wants a coding agent to plan or build a feature, refactor, or implementation-heavy change that depends on context the agent can't infer on its own — strategic intent, constraints, prior decisions, and trade-offs that live in the user's head. Ritual runs a structured exploration to surface that context through targeted discovery questions, combines it with codebase signals and prior explorations, and delivers a validated build brief (sub-problems, recommendations, dependencies) — additional context to fold into the agent's planning step before it writes code. Prefer this over jumping straight to implementation when the problem is ambiguous, cross-cutting, or has non-obvious constraints. Subcommands: build (full planning-to-sync cycle — default for new features), resume (continue an in-flight exploration), lineage (file-path KG history — what decisions shaped this code), context-pulse (readiness and context-debt scoring — is this safe to build yet?)."
4
4
  argument-hint: "[subcommand] <args> (e.g. 'build Reduce T2 churn in Q3', 'resume', 'lineage src/checkout/views.py', 'context-pulse Add billing export')"
5
5
  user-invocable: true
6
- stamp: 283d2c7cc43e
7
- cli_version: 0.36.39
6
+ stamp: 020ff37f037f
7
+ cli_version: 0.36.44
8
8
  ---
9
9
 
10
10
  # /ritual
@@ -327,7 +327,8 @@ Store `workspace_id` for the rest of the flow.
327
327
 
328
328
  If you created a new workspace, persist the binding to `.ritual/config.json` so future runs in this repo skip the workspace-selection prompt. Write it yourself if you have filesystem write access; otherwise show the user the JSON and have them save it.
329
329
 
330
- **`.ritual/config.json` is committed to the repo it is shared, not per-user.** Same model as `.eslintrc.json` or `tsconfig.json`: it binds this codebase to a Ritual workspace + pins team-level defaults (`workspaceId`, `personaSlug` set by `ritual init`'s FTUE — or the legacy `defaultTemplateId`). Everyone working on this repo wants the same values. Per-user state (PATs, auth tokens) lives in `~/.config/ritual/` and never in this file.
330
+ <!-- skill-options:no-gate-change: prose onlycorrected the .ritual/config.json description and dropped mentions of the removed `--persona` flag; no decision gate or offered options changed -->
331
+ **`.ritual/config.json` is committed to the repo — it is shared, not per-user.** Same model as `.eslintrc.json` or `tsconfig.json`: it binds this codebase to a Ritual workspace (`workspaceId` / `workspaceName`) so everyone working on this repo resolves the same place. It holds ONLY repo-level facts — write nothing per-user into it. Persona and template defaults are user-scoped (your Ritual account's `user.persona`, set during `ritual init`), NOT stored here; PATs and auth tokens live in `~/.config/ritual/` and never in this file.
331
332
 
332
333
  When you write the config, also write `.ritual/.gitignore` if it doesn't already exist so any future per-user state files in this directory get ignored while `config.json` itself stays tracked:
333
334
 
@@ -700,7 +701,7 @@ Steps:
700
701
 
701
702
  #### Step 2 — Template selection (server-side, silent)
702
703
 
703
- > **Rewritten 2026-05-21 (CLI 0.9.0+), chain updated 2026-06-11 (JTBD-first entry).** Previously this section had three branches (persona-pinned / legacy-pinned / list-and-pick) that the SKILL had to navigate, and could optionally call `mcp__ritual__list_templates`. That tool is gone from the agent-facing MCP surface as of CLI 0.9.0. Template selection is now entirely server-side: when `create_exploration` is called without an explicit `template_id`, the server resolves the right SYSTEM template from the exploration's `jtbd` (the job confirmed at the Step 0.7 Job gate) → `workspace.defaultTemplateId` (team override) → `user.persona` (legacy — the FTUE picker is gone; set only via `ritual init --persona`) → a designated generic fallback → system default, then forks it into a per-exploration Template atomically inside the same `create_exploration` request.
704
+ > **Rewritten 2026-05-21 (CLI 0.9.0+), chain updated 2026-06-11 (JTBD-first entry).** Previously this section had three branches (persona-pinned / legacy-pinned / list-and-pick) that the SKILL had to navigate, and could optionally call `mcp__ritual__list_templates`. That tool is gone from the agent-facing MCP surface as of CLI 0.9.0. Template selection is now entirely server-side: when `create_exploration` is called without an explicit `template_id`, the server resolves the right SYSTEM template from the exploration's `jtbd` (the job confirmed at the Step 0.7 Job gate) → `workspace.defaultTemplateId` (team override) → `user.persona` (legacy fallback no longer set during onboarding; not CLI-settable) → a designated generic fallback → system default, then forks it into a per-exploration Template atomically inside the same `create_exploration` request.
704
705
 
705
706
  **For the agent: there is no template-selection step. Skip this Step entirely and go to Step 3.** Don't read `.ritual/config.json` for persona, don't try to call `list_templates` (it's not registered), don't render a "Using persona X" confirmation.
706
707
 
@@ -731,7 +732,7 @@ All atomic in one HTTP request. See `apps/api/src/modules/explorations/explorati
731
732
 
732
733
  Recognized roles (use the role keyword the API returns, not a paraphrase): `engineering`, `product`, `design`, `marketing`, `delivery`, `operations`.
733
734
 
734
- If the user corrects the role mid-flow ("actually I'm building a PRD"), update internal role tracking. **Do not** re-pick the template — that requires re-creating the exploration, which is bigger than a mid-flow correction warrants. If the user genuinely wants a different template for this exploration, ask them to start over with `/ritual build` and correct the job at the Job gate (the jtbd drives the template now; `ritual init --persona <slug>` only changes the legacy personal default).
735
+ If the user corrects the role mid-flow ("actually I'm building a PRD"), update internal role tracking. **Do not** re-pick the template — that requires re-creating the exploration, which is bigger than a mid-flow correction warrants. If the user genuinely wants a different template for this exploration, ask them to start over with `/ritual build` and correct the job at the Job gate (the jtbd drives the template now).
735
736
 
736
737
  Proceed to Step 3.
737
738
 
@@ -1317,14 +1318,14 @@ Then summarize the created siblings in the dense-list format. Do not pause after
1317
1318
 
1318
1319
  Longest phase because generation is async + the user picks per-Area. (Internally the API field is `matter_id`; user-facing copy always says Area.)
1319
1320
 
1320
- **Step 6 → Step 7 transition anti-pattern (load-bearing):** after `create_exploration` succeeds in Step 6, you MUST NOT render Step 8's *"Reply `run` to continue"* CTA. Required next actions, in order, before Step 8 is allowed:
1321
+ **Step 6 → Step 7 transition anti-pattern (load-bearing):** after `create_exploration` succeeds in Step 6, you MUST NOT jump to Step 8's answering/run discovery questions must be generated, picked, and committed first. Required next actions, in order, before Step 8 is allowed:
1321
1322
 
1322
1323
  1. Call `mcp__ritual__suggest_discovery_questions(exploration_id)` (Step 7.1) — no user input needed; just kick it off.
1323
1324
  2. Poll `mcp__ritual__get_discovery_state(exploration_id)` until `ready: true` (Step 7.2).
1324
1325
  3. Render the **Area rail + Area 1's questions together** and walk Area-by-Area per § 7.3.1 (the rail orients; a rail with NO questions under it — a bare index — is the failure mode).
1325
1326
  4. `[USER PAUSE]` — the suggested-12 landing (§ 7.3.1): the user replies `proceed` (commit the 12), `expert` (walk + adjust; floor 6 to run, aim 15–20, no cap), or `pause`.
1326
1327
  5. Commit all picked Areas in ONE `mcp__ritual__accept_discovery_questions_batch` call (Step 7.4) — never one parallel call per Area.
1327
- 6. Optionally capture anti-goals (Step 7.5), then proceed to Step 8 and render the *"Reply `run` to continue"* CTA.
1328
+ 6. Optionally capture anti-goals (Step 7.5), then proceed to Step 8 but only **after the Step 7.4 `accept_discovery_questions_batch` response returns** (you need its `materialized[]` question ids to run against). For engineering/delivery/operations, then **auto-fire the run** (answer the picked questions + `submit_all_answers`, or the server fallback) — no `run` CTA, no pause. For product/design/PRD flows, render the `1`/`2` run-mode choice (stop-after-answers review vs run-through). Never start answering/running before the accept resolves.
1328
1329
 
1329
1330
  **Picking is a deliberate step-through, not a bulk action (load-bearing):** the user going Area by Area and choosing the questions that matter IS the value of discovery — that per-question judgment shapes the whole downstream chain. So **nudge the user to step through and pick**; don't lead with bulk shortcuts.
1330
1331
  - **Nudge to step through.** Walk the user Area-by-Area (drop into Area 1, `next`/`prev`) and invite deliberate picks per Area, with `show more` to expand an Area. The framing is "which of these should we dig into?", not "want all of them?".
@@ -1337,7 +1338,7 @@ Longest phase because generation is async + the user picks per-Area. (Internally
1337
1338
  - Calling `start_agentic_run` before at least 6 discovery picks have been committed for this exploration (via `accept_discovery_questions_batch`, or `accept_discovery_questions`). There is no skip-discovery exception.
1338
1339
  - Silently auto-picking all generated questions and proceeding to Step 8 — observed in agent output 2026-05-15 as "the engineering-mode default is to run, which skips the per-question picker." There is no such default; the picker is mandatory.
1339
1340
  - **Offering "or I'll default to taking all of them" (or any accept-all fallback), then committing the full set on an ambiguous reply** — observed 2026-06-05 (a `proceed` at this gate → `accept_discovery_questions_batch` with all 68 questions → a ~25-min run the user never chose). Accept-all is a legitimate choice **only when the user explicitly asks for it** — it is NEVER the default you offer, and NEVER the fallback. The default you offer + fall back to is always **the suggested 12 rendered on the landing**. An ambiguous reply (`proceed`/`go`/`ok`) at the pick gate means **accept those 12**, not the full set — structurally safe because the 12 are on screen in full.
1340
- - Rendering "Next: run discovery through recommendations / Reply `run` to continue" anywhere in the chat before Step 7.4 has completed.
1341
+ - Starting Step 8 auto-firing the answers (engineering) or rendering the product/design run-mode choice anywhere in the chat before Step 7.4 has committed the picks.
1341
1342
 
1342
1343
  The picker is **not** a UI suggestion — it's the load-bearing decision gate where the user expresses what to investigate. Skipping it converts the agentic run into an automated "answer everything" pass and erases the user's judgment.
1343
1344
 
@@ -1623,28 +1624,24 @@ it's `/ritual build`.**
1623
1624
 
1624
1625
  Pick the path honestly; don't claim to answer from code you didn't read.
1625
1626
 
1626
- <!-- skill-options:no-gate-change: Step 8 answerer is chosen by real repo-linkage (recon ran / code open), not by the /ritual build invocation; agent-answers when repo-linked, server-run fallback. Includes prose guidance on answer length (~300-600 words), that attached code is OPTIONAL illustrative reference (not part of the answer, not a verbatim copy), and a hard no-secrets/no-PII redaction rule for the BYO answerer. The run/pause gate + its options are unchanged — no new pause gate or Step header. -->
1627
+ <!-- skill-options:no-gate-change: Step 8 answerer is chosen by real repo-linkage (recon ran / code open), not by the /ritual build invocation; agent-answers when repo-linked, server-run fallback. Includes prose guidance on answer length (~300-600 words), that attached code is OPTIONAL illustrative reference (not part of the answer, not a verbatim copy), and a hard no-secrets/no-PII redaction rule for the BYO answerer. As of 2026-06-21 the engineering/delivery/operations run gate is REMOVED (auto-proceed after the §7.4 commit) the options-contract drops that gate; no new pause gate or Step header is added. -->
1627
1628
 
1628
- For `engineering`, `delivery`, and `operations` roles, show:
1629
+ For `engineering`, `delivery`, and `operations` roles there is **no run confirmation**: the user already chose "generate answers and recommendations" when they proceeded from the discovery pick gate (§ 7.3.1), so a second "ready to run?" prompt is redundant friction. **Auto-proceed with no `run`/`pause` CTA and no wait for a reply.**
1630
+
1631
+ <!-- skill-options:no-gate-change: prose only — adds a strict accept-returns-before-run ordering precondition to Step 8 (and the §7-transition rule); no decision gate, offered option, or Step header is added, removed, or changed. -->
1632
+ **Strict ordering (load-bearing — do NOT skip, reorder, or parallelize):** the run begins **only after the Step 7.4 `accept_discovery_questions_batch` call has RETURNED its response**. That accept is what commits the picks and returns `materialized[]` (the committed question rows + their `id`s); you answer those exact ids. Do NOT call `write_answer_context`, `submit_all_answers`, or `start_agentic_run` before the accept resolves, and never fire them in parallel with it — there is no committed question set to run against until the accept returns. Removing the old `run` gate removed a human turn, NOT this dependency: await the accept, read `materialized[]`, then run. Once you have the accept response, print one non-blocking status line so the hand-off isn't silent, then begin:
1629
1633
 
1630
1634
  ```text
1631
1635
  Ritual build
1632
1636
  ✓ Job ✓ Scope ● Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)
1633
1637
 
1634
- Run discovery
1635
-
1636
- I'll answer the picked questions from the codebase, then generate
1637
- recommendations. This usually takes a few minutes.
1638
-
1639
- Reply `run` to answer → generate recommendations.
1640
- Reply `pause` to stop here.
1638
+ Answering your picked questions, then generating recommendations.
1639
+ This usually takes a few minutes — I'll keep working; nothing needed from you.
1641
1640
  ```
1642
1641
 
1643
- (Match the first line to the path you'll actually take: repo-linked → "I'll answer the picked questions from the codebase…"; fallback → "Ritual will source answers for the picked questions…". Don't claim to answer from code if you're taking the server path.)
1644
-
1645
- Visible CTA is `run`. Accept `r`, `go`, `continue`, or `next` as aliases. Per `references/cli-output-contract.md` § Surface-aware continuation prompts, do NOT treat empty input as proceed inside agent chat.
1642
+ (Match the line to the path you'll actually take: repo-linked → "Answering your picked questions from the codebase…"; fallback → "Ritual is sourcing answers for the picked questions…". Don't claim to answer from code if you're taking the server path.)
1646
1643
 
1647
- On `run`, **if you're genuinely repo-linked (per the check above), answer the questions yourself** (BYO-answerer; do NOT call `start_agentic_run`):
1644
+ **If you're genuinely repo-linked (per the check above), answer the questions yourself** (BYO-answerer; do NOT call `start_agentic_run`):
1648
1645
  1. The Step 7.4 accept (`accept_discovery_questions_batch`) returned `materialized[]` — the committed questions with their row `id`s. (If you didn't keep them, the same ids are what you passed to accept.)
1649
1646
  2. For each saved question, call `mcp__ritual__write_answer_context(question_id, content)` with an answer grounded in your reading of the codebase — the files you read at Step 5.7, the actual code, real constraints. Answer in PARALLEL where your agent supports it (e.g. one subagent per Area). The content is provisional + provenance-tagged agentic until saved; only the final saved set drives recommendations.
1650
1647
  - **Length:** keep each answer to **~300–600 words by default** — tight and grounded, not an essay. Go longer only when the question genuinely needs it.
@@ -1652,7 +1649,7 @@ On `run`, **if you're genuinely repo-linked (per the check above), answer the qu
1652
1649
  - **Never leak secrets or sensitive data.** A snippet is **illustrative, not a verbatim copy** — it only has to convey the shape/idea, so simplify and elide freely. **NEVER** include API keys, tokens, passwords, connection strings, credentials, `.env` values, real customer data, or PII — even if they're literally in the file you read. Replace them with obvious placeholders (`process.env.X`, `"<api-key>"`, `"user@example.com"`). The same goes for the prose: describe constraints without pasting secret values.
1653
1650
  3. When every committed question has answer context, call `mcp__ritual__submit_all_answers(exploration_id)` — it commits the set and triggers recommendation generation. Then go to the recommendation wait (Step 8.1, agent-answered path).
1654
1651
 
1655
- **Fallback — server answers (no repo / nothing to ground in):** call `mcp__ritual__start_agentic_run` with `scope_type: 'exploration'` + `exploration_id`, then follow the server polling path (8.0 → 8.1).
1652
+ **Fallback — server answers (no repo / nothing to ground in):** only after the Step 7.4 accept has returned (the run needs the committed question set it produced), call `mcp__ritual__start_agentic_run` with `scope_type: 'exploration'` + `exploration_id`, then follow the server polling path (8.0 → 8.1).
1656
1653
 
1657
1654
  For `product`, `design`, or explicitly PRD-style flows where answer review is useful, offer two choices without time estimates (this path uses the SERVER answer engine so the user can review each generated answer — Step 8.5):
1658
1655
 
@@ -456,13 +456,11 @@ Visible CTA is `use`. Accept `lock`, `l`, `go`, `continue`, or `next` as backwar
456
456
 
457
457
  ### Engineering run mode
458
458
 
459
- For engineering / agentic-coding templates, do not offer answers-only review and do not mention time estimates. Use:
459
+ For engineering / agentic-coding templates there is **no run CTA and no pause** — once the discovery picks are committed, auto-fire the run (answer the questions then `submit_all_answers`, or the server fallback) and proceed straight to recommendations. Do not offer answers-only review and do not ask the user to start the run. Print one non-blocking status line instead of a prompt:
460
460
 
461
461
  ```text
462
- Next: run discovery through recommendations.
463
-
464
- Reply `run` to continue.
465
- Reply `pause` to stop here.
462
+ Answering your picked questions, then generating recommendations.
463
+ This usually takes a few minutes — I'll keep working; nothing needed from you.
466
464
  ```
467
465
 
468
466
  ### Shipped work visibility