@ritualai/cli 0.36.37 → 0.36.39

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 (39) hide show
  1. package/dist/commands/build.js +42 -3
  2. package/dist/commands/build.js.map +1 -1
  3. package/dist/commands/init.js +11 -0
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/login.js +43 -0
  6. package/dist/commands/login.js.map +1 -1
  7. package/dist/commands/telemetry.js +35 -0
  8. package/dist/commands/telemetry.js.map +1 -0
  9. package/dist/index.js +74 -1
  10. package/dist/index.js.map +1 -1
  11. package/dist/lib/config.js +1 -0
  12. package/dist/lib/config.js.map +1 -1
  13. package/dist/lib/telemetry.js +234 -0
  14. package/dist/lib/telemetry.js.map +1 -0
  15. package/package.json +1 -1
  16. package/skills/claude-code/ritual/.ritual-bundle.json +3 -3
  17. package/skills/claude-code/ritual/SKILL.md +4 -4
  18. package/skills/claude-code/ritual/references/build-flow.md +40 -26
  19. package/skills/claude-code/ritual/references/lite-flow.md +41 -27
  20. package/skills/codex/ritual/.ritual-bundle.json +3 -3
  21. package/skills/codex/ritual/SKILL.md +4 -4
  22. package/skills/codex/ritual/references/build-flow.md +40 -26
  23. package/skills/codex/ritual/references/lite-flow.md +41 -27
  24. package/skills/cursor/ritual/.ritual-bundle.json +3 -3
  25. package/skills/cursor/ritual/SKILL.md +4 -4
  26. package/skills/cursor/ritual/references/build-flow.md +40 -26
  27. package/skills/cursor/ritual/references/lite-flow.md +41 -27
  28. package/skills/gemini/ritual/.ritual-bundle.json +3 -3
  29. package/skills/gemini/ritual/SKILL.md +4 -4
  30. package/skills/gemini/ritual/references/build-flow.md +40 -26
  31. package/skills/gemini/ritual/references/lite-flow.md +41 -27
  32. package/skills/kiro/ritual/.ritual-bundle.json +3 -3
  33. package/skills/kiro/ritual/SKILL.md +4 -4
  34. package/skills/kiro/ritual/references/build-flow.md +40 -26
  35. package/skills/kiro/ritual/references/lite-flow.md +41 -27
  36. package/skills/vscode/ritual/.ritual-bundle.json +3 -3
  37. package/skills/vscode/ritual/SKILL.md +4 -4
  38. package/skills/vscode/ritual/references/build-flow.md +40 -26
  39. package/skills/vscode/ritual/references/lite-flow.md +41 -27
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFirstRun = isFirstRun;
4
+ exports.isEnabled = isEnabled;
5
+ exports.setOptOut = setOptOut;
6
+ exports.describeStatus = describeStatus;
7
+ exports.capture = capture;
8
+ exports.identify = identify;
9
+ exports.maybeShowFirstRunNotice = maybeShowFirstRunNotice;
10
+ exports.flush = flush;
11
+ const node_fs_1 = require("node:fs");
12
+ const node_os_1 = require("node:os");
13
+ const node_path_1 = require("node:path");
14
+ const node_crypto_1 = require("node:crypto");
15
+ const config_1 = require("./config");
16
+ const credentials_backup_1 = require("./credentials-backup");
17
+ const package_info_1 = require("./package-info");
18
+ /**
19
+ * Anonymous, opt-out usage analytics for the Ritual CLI.
20
+ *
21
+ * Design goals:
22
+ * - Never blocks a command. Every send is fire-and-forget with a hard
23
+ * timeout; failures are swallowed. This is load-bearing for `login`,
24
+ * whose browser-loopback must not wait on a telemetry POST.
25
+ * - Anonymous until you sign in. A random install id (in
26
+ * ~/.config/ritual/telemetry.json) is the distinct_id pre-login; on
27
+ * login we $identify it to the Keycloak `sub` so the pre-login funnel
28
+ * stitches to the account (and to the marketing-site signup, which
29
+ * uses the same PostHog project).
30
+ * - Easy to turn off: DO_NOT_TRACK, RITUAL_TELEMETRY=0, or
31
+ * `ritual telemetry off`. Always skipped in CI.
32
+ *
33
+ * Same PostHog project as ritual.work so the web + CLI funnels are one
34
+ * graph. Key + host are overridable for self-hosters / tests.
35
+ */
36
+ const POSTHOG_HOST = (process.env.RITUAL_POSTHOG_HOST || 'https://us.i.posthog.com').replace(/\/$/, '');
37
+ const POSTHOG_KEY = process.env.RITUAL_POSTHOG_KEY || 'phc_nNH8wifJVxDrCfAUabmwni44genZggRTT52CBdtQS4w4';
38
+ // Hard cap on how long a single send can hang. Reachable PostHog answers in
39
+ // ~100-300ms; this only bites when the host is firewalled/black-holed, and it
40
+ // bounds the worst-case latency a telemetry POST can add to a command's exit.
41
+ const SEND_TIMEOUT_MS = 800;
42
+ function statePath() {
43
+ return (0, node_path_1.join)((0, config_1.configDir)(), 'telemetry.json');
44
+ }
45
+ let cachedState = null;
46
+ const pending = [];
47
+ function isCI() {
48
+ const e = process.env;
49
+ return !!(e.CI ||
50
+ e.CONTINUOUS_INTEGRATION ||
51
+ e.GITHUB_ACTIONS ||
52
+ e.GITLAB_CI ||
53
+ e.CIRCLECI ||
54
+ e.TRAVIS ||
55
+ e.BUILDKITE ||
56
+ e.TF_BUILD ||
57
+ e.JENKINS_URL);
58
+ }
59
+ function envDisabled() {
60
+ const e = process.env;
61
+ if (e.DO_NOT_TRACK === '1' || e.DO_NOT_TRACK === 'true')
62
+ return true;
63
+ const t = (e.RITUAL_TELEMETRY || '').toLowerCase();
64
+ if (t === '0' || t === 'false' || t === 'off' || t === 'no')
65
+ return true;
66
+ return false;
67
+ }
68
+ /** True only the very first time the CLI runs on this machine. */
69
+ function isFirstRun() {
70
+ return !(0, node_fs_1.existsSync)(statePath());
71
+ }
72
+ function readStateRaw() {
73
+ try {
74
+ const parsed = JSON.parse((0, node_fs_1.readFileSync)(statePath(), 'utf-8'));
75
+ if (parsed && typeof parsed.installId === 'string')
76
+ return parsed;
77
+ }
78
+ catch {
79
+ /* missing / corrupt — caller decides */
80
+ }
81
+ return null;
82
+ }
83
+ /** Load (and create on first ever call) the telemetry state. */
84
+ function loadState() {
85
+ if (cachedState)
86
+ return cachedState;
87
+ const existing = readStateRaw();
88
+ if (existing) {
89
+ cachedState = existing;
90
+ return existing;
91
+ }
92
+ const fresh = {
93
+ installId: (0, node_crypto_1.randomUUID)(),
94
+ firstRunAt: new Date().toISOString(),
95
+ };
96
+ saveState(fresh);
97
+ return fresh;
98
+ }
99
+ function saveState(state) {
100
+ cachedState = state;
101
+ try {
102
+ (0, node_fs_1.mkdirSync)((0, config_1.configDir)(), { recursive: true });
103
+ // Same 0600 create-with-mode helper the credentials store uses —
104
+ // the install id is low-sensitivity, but keep it owner-only anyway.
105
+ (0, credentials_backup_1.writeFileMode0600)(statePath(), JSON.stringify(state, null, 2));
106
+ }
107
+ catch {
108
+ /* best-effort */
109
+ }
110
+ }
111
+ /**
112
+ * Is telemetry on? Env / CI checks come first so opted-out and CI users
113
+ * never even get an install id written to disk.
114
+ */
115
+ function isEnabled() {
116
+ if (envDisabled() || isCI())
117
+ return false;
118
+ return !loadState().optedOut;
119
+ }
120
+ /** Persist an explicit opt-in/opt-out (for `ritual telemetry on|off`). */
121
+ function setOptOut(optedOut) {
122
+ saveState({ ...loadState(), optedOut });
123
+ }
124
+ /** Current opt-out posture for `ritual telemetry status`. */
125
+ function describeStatus() {
126
+ if (envDisabled())
127
+ return { enabled: false, reason: 'disabled via DO_NOT_TRACK / RITUAL_TELEMETRY', installId: '—' };
128
+ if (isCI())
129
+ return { enabled: false, reason: 'CI environment detected', installId: '—' };
130
+ const s = loadState();
131
+ return {
132
+ enabled: !s.optedOut,
133
+ reason: s.optedOut ? 'disabled via `ritual telemetry off`' : 'enabled',
134
+ installId: s.installId,
135
+ };
136
+ }
137
+ function baseProps() {
138
+ return {
139
+ $lib: 'ritual-cli',
140
+ cli_version: (0, package_info_1.readPackageVersionSafe)(),
141
+ os: (0, node_os_1.platform)(),
142
+ arch: process.arch,
143
+ node_version: process.version,
144
+ is_ci: isCI(),
145
+ };
146
+ }
147
+ /** sub once signed in (stitched on $identify), else the anonymous install id. */
148
+ function distinctId() {
149
+ try {
150
+ const creds = (0, config_1.loadCredentials)();
151
+ if (creds?.user?.sub)
152
+ return creds.user.sub;
153
+ }
154
+ catch {
155
+ /* ignore */
156
+ }
157
+ return loadState().installId;
158
+ }
159
+ async function send(body) {
160
+ const controller = new AbortController();
161
+ const timer = setTimeout(() => controller.abort(), SEND_TIMEOUT_MS);
162
+ try {
163
+ await fetch(`${POSTHOG_HOST}/capture/`, {
164
+ method: 'POST',
165
+ headers: { 'content-type': 'application/json' },
166
+ body: JSON.stringify(body),
167
+ signal: controller.signal,
168
+ });
169
+ }
170
+ catch {
171
+ /* network down / aborted / blocked — never surface to the user */
172
+ }
173
+ finally {
174
+ clearTimeout(timer);
175
+ }
176
+ }
177
+ /** Fire-and-forget event. No-op when disabled. */
178
+ function capture(event, properties = {}) {
179
+ if (!isEnabled())
180
+ return;
181
+ pending.push(send({
182
+ api_key: POSTHOG_KEY,
183
+ event,
184
+ distinct_id: distinctId(),
185
+ properties: { ...baseProps(), ...properties },
186
+ timestamp: new Date().toISOString(),
187
+ }));
188
+ }
189
+ /**
190
+ * Link the anonymous install id to the signed-in user (Keycloak sub) and
191
+ * set durable person properties. Call once, right after a successful login.
192
+ */
193
+ function identify(sub, person = {}) {
194
+ if (!isEnabled())
195
+ return;
196
+ const installId = loadState().installId;
197
+ if (!sub || sub === installId)
198
+ return;
199
+ pending.push(send({
200
+ api_key: POSTHOG_KEY,
201
+ event: '$identify',
202
+ distinct_id: sub,
203
+ properties: {
204
+ $anon_distinct_id: installId, // merges prior anonymous events into the person
205
+ $set: { ...baseProps(), ...person },
206
+ },
207
+ timestamp: new Date().toISOString(),
208
+ }));
209
+ }
210
+ /**
211
+ * One-time disclosure. Printed to stderr so it never pollutes stdout that
212
+ * a script might parse. No-op in CI / when disabled / after first shown.
213
+ */
214
+ function maybeShowFirstRunNotice() {
215
+ if (envDisabled() || isCI())
216
+ return;
217
+ const s = loadState();
218
+ if (s.noticeShownAt || s.optedOut)
219
+ return;
220
+ saveState({ ...s, noticeShownAt: new Date().toISOString() });
221
+ process.stderr.write('\n Ritual CLI collects anonymous usage analytics to help improve the product.\n' +
222
+ ' Opt out anytime: `ritual telemetry off` (or set RITUAL_TELEMETRY=0).\n\n');
223
+ }
224
+ /** Await in-flight sends (bounded) so events leave before the process exits. */
225
+ async function flush(timeoutMs = SEND_TIMEOUT_MS + 250) {
226
+ if (pending.length === 0)
227
+ return;
228
+ const inFlight = pending.splice(0);
229
+ await Promise.race([
230
+ Promise.allSettled(inFlight),
231
+ new Promise((resolve) => setTimeout(resolve, timeoutMs)),
232
+ ]);
233
+ }
234
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/lib/telemetry.ts"],"names":[],"mappings":";;AA0EA,gCAEC;AA4CD,8BAGC;AAGD,8BAEC;AAGD,wCASC;AA0CD,0BAWC;AAMD,4BAgBC;AAMD,0DASC;AAGD,sBAOC;AAhPD,qCAA8D;AAC9D,qCAAmC;AACnC,yCAAiC;AACjC,6CAAyC;AACzC,qCAAsD;AACtD,6DAAyD;AACzD,iDAAwD;AAExD;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,YAAY,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,0BAA0B,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACxG,MAAM,WAAW,GAChB,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,kDAAkD,CAAC;AAEtF,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,MAAM,eAAe,GAAG,GAAG,CAAC;AAS5B,SAAS,SAAS;IACjB,OAAO,IAAA,gBAAI,EAAC,IAAA,kBAAS,GAAE,EAAE,gBAAgB,CAAC,CAAC;AAC5C,CAAC;AAED,IAAI,WAAW,GAA0B,IAAI,CAAC;AAC9C,MAAM,OAAO,GAAuB,EAAE,CAAC;AAEvC,SAAS,IAAI;IACZ,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IACtB,OAAO,CAAC,CAAC,CACR,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,cAAc;QAChB,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,QAAQ;QACV,CAAC,CAAC,MAAM;QACR,C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FAAkF;QACjF,4EAA4E,CAC7E,CAAC;AACH,CAAC;AAED,gFAAgF;AACzE,KAAK,UAAU,KAAK,CAAC,SAAS,GAAG,eAAe,GAAG,GAAG;IAC5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACjC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,CAAC,IAAI,CAAC;QAClB,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC5B,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;KACxD,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ritualai/cli",
3
- "version": "0.36.37",
3
+ "version": "0.36.39",
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.37",
3
- "builtAt": "2026-06-20T13:23:52.963Z",
4
- "skillsHash": "622a0cff45d0"
2
+ "cliVersion": "0.36.39",
3
+ "builtAt": "2026-06-20T13:46:17.028Z",
4
+ "skillsHash": "283d2c7cc43e"
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: 622a0cff45d0
7
- cli_version: 0.36.37
6
+ stamp: 283d2c7cc43e
7
+ cli_version: 0.36.39
8
8
  ---
9
9
 
10
10
  # /ritual
@@ -101,8 +101,8 @@ Additional runtime references:
101
101
 
102
102
  ## Routing behavior
103
103
 
104
- - If the first token is one of the subcommands (`build`, `lite`, `resume`, `lineage`, `context-pulse`), load the matching runtime file and follow it.
105
- - If there is no subcommand or the token is unknown, default to `build` and treat the full argument as the problem statement.
104
+ - If the first token is one of the subcommands (`build`, `lite`, `resume`, `lineage`, `context-pulse`), load the matching runtime file and **immediately execute its ON ENTRY block — your next tool call is that flow's first tool call, not a clarifying question of your own.**
105
+ - If there is no subcommand or the token is unknown, default to `build` and treat the full argument as the problem statement (still run `build`'s ON ENTRY block — do not pause to ask your own scoping questions first).
106
106
  - If the user asks for retired or unsupported subcommands, answer in plain English and call the relevant MCP tool directly when appropriate; do not expand the `/ritual` command surface.
107
107
 
108
108
  ## Asks that don't map to a subcommand
@@ -4,6 +4,31 @@ Walks the engineer from a free-form problem statement to vetted, accepted Ritual
4
4
 
5
5
  Output: a fully-closed loop — **exploration in COMPLETE state, recommendations accepted (or explicitly handed off to an admin), build brief generated, code implemented, and `sync_implementation` called to register the result in the knowledge graph**. The engineer stays in the driver's seat through concise status updates and explicit pauses only at real decision gates.
6
6
 
7
+ ### ON ENTRY — do this FIRST, then stay on the pipeline (load-bearing)
8
+ <!-- skill-options:no-gate-change: entry-point + planning-phase trigger — names the existing Step 0.7 first action and the existing pre-brief pipeline; adds no pause gate or options -->
9
+
10
+ The instant `/ritual build` is selected (including the no-subcommand default that treats the whole ask as the scope), your **next tool call** is the Step 0.7 **Job gate**: call `classify_work_item` with the user's ask, then render that gate. Everything between here and Step 0.7 — the vocabulary map, the build rail, the runtime contracts — is reference you apply *while* running the flow; it is **not** a reason to delay that first tool call.
11
+
12
+ **The pipeline — you are in the PLANNING phase until the build brief is accepted.** It runs as the six build-rail stages below, **in order**. **Advance through the numbered Steps exactly as written — do not skip ahead or reorder them.** The exact tool sequence lives in the Steps; follow them, don't reconstruct it from memory.
13
+
14
+ ```
15
+ Job (classify) -> Scope -> Discovery -> Recommendations -> Build brief (Step 10) | Implementation (Step 11+)
16
+ [------------------------------- planning phase -------------------------------] [---- implementation ----]
17
+ ```
18
+
19
+ **`create_exploration` is the END of Scope, not the start.** Scope = sub-problems (Step 4) → problem frame (Step 5) → `create_exploration` (Step 6). Creating the exploration before the sub-problems and frame exist forces a confusing backtrack — don't. After `classify_work_item` returns, render the Job gate, pick/create the workspace (Step 1), then do Steps 4 → 5 → 6 → 7 in order.
20
+
21
+ **The most common failures: (a) freelancing your own questions before classify, and (b) jumping ahead — creating the exploration or touching discovery before Scope is built. Do the next numbered Step; nothing else.**
22
+
23
+ **Forbidden for EVERY turn of the planning phase — not just the first (hard violations):**
24
+
25
+ - Inventing your own clarifying / scoping / "which option did you mean" questions, or using your agent's own question or prompt UI to gather scope. Scope is captured ONLY inside the flow, via `generate_problem_statement` (Step 4). The flow's own gates (Job gate, discovery, rec review) are the only pauses.
26
+ - Running ANY **implementation-phase** tooling before the build brief is generated and accepted (Step 10): file writes/edits, package installs, component/scaffold generators, design-asset generators, todo/task lists. (Examples by agent — v0: `GenerateDesignInspiration`, `TodoManager`, `shadcn add`; Cursor/Claude/etc. have equivalents.) Pulling implementation forward is a hard violation. These resume — and are expected — at **Step 11**.
27
+ - Reading repo files, `.ritual/config.json`, or calling `list_workspaces` before the Job gate is confirmed (Step 0.7). (Code-recon *reads* are fine later, at their step inside the planning phase; this only forbids them up front.)
28
+ - Emitting an empty, "let me think…", or narration-only turn with no tool call (e.g. "I'll start the build flow", "Let me gather context first"). Start the next step; don't announce it.
29
+
30
+ "Proceed with your best judgment" / "no clarification needed" does **not** mean skip the flow — it means run the flow with sane defaults and pause only at the real pause gates.
31
+
7
32
  ### Vocabulary mapping (engineer-tone)
8
33
 
9
34
  The Ritual data model uses product-research terminology. This skill translates to engineer-natural terms when speaking to the user. The underlying API still uses original names — keep this table mental when you read tool inputs / outputs:
@@ -288,11 +313,12 @@ Resolution order:
288
313
 
289
314
  <!-- skill-options:no-gate-change: adds explainer prose to the existing workspace-pick gate; options and pause unchanged -->
290
315
 
291
- > This repo isn't connected to a workspace yet.
292
- > A workspace keeps the context and reasoning Ritual needs for future runs.
293
- >
294
- > Where should Ritual save this run?
316
+ > A **workspace** is where Ritual keeps the context, decisions, and reasoning for related work — so future runs build on this one instead of starting cold. You're not in one yet.
295
317
  > {numbered list}
318
+ >
319
+ > Where should this run live? (pick one, or I'll create a new workspace for you)
320
+
321
+ (Repo-agnostic on purpose: don't say "this repo" — agents like v0 have no repo. If there are NO existing workspaces, skip the list and just say *"Ritual will set up a workspace for this — a workspace keeps the context for related work. I'll name it `{name}`; sound good?"* and create it.)
296
322
 
297
323
  **[USER PAUSE]** for selection.
298
324
  3. **Create a new one if none exist or user wants a fresh one.** Call `mcp__ritual__create_workspace` with a name — convention is to name it after the repo (basename of cwd, or origin remote). Confirm the name with the user first. **[USER PAUSE]**
@@ -594,12 +620,12 @@ Steps:
594
620
  <!-- skill-options:no-gate-change: f.1 is an OPTIONAL skippable sub-prompt nested in Step 1.5 step 6 (default skip); adds no tracked pause gate or Step header, so the structural fingerprint is unchanged (check-skill-options-contract green). -->
595
621
  f.1 **Unchosen-candidates gate (2026-06-14, unchosen-options → discovery worktrees).** The candidates the user did NOT pick are paths worth not silently dropping. Render ONE compact, SKIPPABLE prompt — for each unchosen candidate, the user can spin up **discovery now** (a background worktree reasons it to a build brief) or **log it as a future job**. Promote DELIBERATELY: the default is to drop. (This gate is itself skipped in autonomous/worktree mode — never spawn discovery recursively.)
596
622
 
623
+ <!-- skill-options:no-gate-change: prose-only copy tightening of the discover/next-job/skip descriptions; option tokens + gate unchanged -->
597
624
  ```text
598
- You picked #{k}. The other {M} — want to keep any going?
599
- • `discover <nums>` — spin up discovery NOW in a background git worktree: an agent reasons it
600
- end-to-end to a build brief (reasoning only, no code). e.g. `discover 1`
601
- • `next-job <nums>` just log it as a future job (a draft exploration in this workspace; nothing runs)
602
- • `skip` — drop them (default)
625
+ You picked #{k}. For the rest:
626
+ • `discover <nums>` — explore unpicked option(s) in parallel; returns a build brief, no code.
627
+ • `next-job <nums>` — save as future work.
628
+ • `skip` drop them. Default.
603
629
  ```
604
630
 
605
631
  Resolve the reply, then continue to Step 2 for the picked candidate:
@@ -1303,7 +1329,7 @@ Longest phase because generation is async + the user picks per-Area. (Internally
1303
1329
  **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.
1304
1330
  - **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?".
1305
1331
  - **Floor (HARD): at least 6 questions** across any Areas — below this, do NOT commit or proceed (tell them how many more to pick and keep them in the picker). There is NO "skip discovery" path — the agentic run needs a real question set to develop answers against. **Good coverage (SOFT): 15–20 questions** — nudge toward it on the Summary, but never block once ≥6. **No upper cap** — picking many (or all) is a legitimate explicit choice, never a default or fallback. (Uncovered scope is handled downstream when recommendations + requirements are generated and audited, so a thin set is the failure mode to prevent.)
1306
- - **The default is the suggested 12 on screen, never "all."** The landing shows exactly what `proceed` commits. An ambiguous reply (`proceed`, `go`, `ok`) at this gate means **accept the suggested 12 the user is looking at** — never silently accept everything.
1332
+ - **The default is the suggested 12, never "all."** `proceed` commits exactly that suggested set (not every generated question). An ambiguous reply (`proceed`, `go`, `ok`) at this gate means **accept the suggested 12** — never silently accept everything. (The landing summarizes rather than lists them; `expert` is the path to read/adjust the set before committing.)
1307
1333
  - **Taking all IS allowed — but only as an explicit user choice, never the default or a fallback.** If the user genuinely says "take all" / "all of them", honor it and commit them; that's a legitimate choice, not an error. Just never *offer* "I'll take all" as the default, and never auto-fall-back to it. (Worth mentioning once, not as a gate: every accepted question is answered individually in the agentic run, so accepting all of them across every Area means many more questions to answer and a much longer run — but it's the user's call.)
1308
1334
 
1309
1335
  **Forbidden behaviors:**
@@ -1367,31 +1393,19 @@ The user always confirms; nothing is committed without their reply.
1367
1393
 
1368
1394
  ###### 7.3.1 — First render: the suggested-12 landing (the default)
1369
1395
 
1370
- Render ALL 12 suggested questions IN FULL, grouped by Areanever truncate, elide, or "(… N more)" this list; the whole point is that the user reads exactly what one word will commit. Full phase rail on this message (we just entered Discovery).
1396
+ Render the **compact landing**: one summary line (counts + that the 12 most impactful were identified) and the action bar. Do NOT list the questions here the full set is inspected on demand via `expert` (the Area walk). Keeping this terse is deliberate; the earlier "render all 12 in full" landing was too verbose. Full phase rail on this message (we just entered Discovery).
1371
1397
 
1372
1398
  ```text
1373
1399
  Ritual build
1374
1400
  ✓ Job ✓ Scope ● Discovery ○ Recommendations ○ {Deliverable} ○ Implementation (Your agent)
1375
1401
 
1376
- Discovery questions ready — {M} generated across {N} areas.
1377
-
1378
- These 12 questions target the tradeoffs and unknowns most likely to change the plan.
1379
-
1380
- {Area name 1}
1381
- ✓ 1. {question, full text, wrapped readably}
1382
- ✓ 2. {question}
1383
-
1384
- {Area name 2}
1385
- ✓ 3. {question}
1386
- ✓ 4. {question}
1387
-
1388
- {…every suggested question, grouped by Area, all 12 visible…}
1402
+ We've generated {M} discovery questions across {N} areas and identified the 12 most impactful questions.
1389
1403
 
1390
- Reply `proceed` to use these 12, `expert` to adjust, or `pause`.
1404
+ Reply `proceed` to generate answers and recommendations for these questions, `expert` to inspect and adjust the question set, or `pause`.
1391
1405
  ```
1392
1406
 
1393
1407
  Branch on reply:
1394
- - **`proceed`** (or an ambiguous `ok`/`go`): commit exactly the 12 on screen via § 7.4's single batch call (grouped per Area), then continue to § 7.5 → Step 8. The ambiguous-reply rule is now structurally safe: what gets accepted is exactly what the user is looking at.
1408
+ - **`proceed`** (or an ambiguous `ok`/`go`): commit exactly the suggested 12 via § 7.4's single batch call (grouped per Area), then continue to § 7.5 → Step 8. Ambiguous replies (`ok`/`go`) map here. The questions aren't listed at this landing by design — a user who wants to read or change them before committing uses `expert`.
1395
1409
  - **`expert`**: enter the Area walk below with the suggested 12 **pre-selected** (`picked so far: 12`, ✓ on each suggested row). Numbers TOGGLE in expert mode — typing a selected question's number unselects it.
1396
1410
  - **`pause`**: stop here; nothing committed.
1397
1411
 
@@ -1,5 +1,5 @@
1
1
  <!-- GENERATED from references/build-flow.md by apps/cli/scripts/generate-lite-flow.js — DO NOT EDIT. -->
2
- <!-- source-sha: 41c0a8e8e2f22f6c -->
2
+ <!-- source-sha: 294b970c48a237b5 -->
3
3
 
4
4
  # /ritual lite — fast build (generated; do not edit)
5
5
 
@@ -96,6 +96,31 @@ Walks the engineer from a free-form problem statement to vetted, accepted Ritual
96
96
 
97
97
  Output: a fully-closed loop — **exploration in COMPLETE state, recommendations accepted (or explicitly handed off to an admin), build brief generated, code implemented, and `sync_implementation` called to register the result in the knowledge graph**. The engineer stays in the driver's seat through concise status updates and explicit pauses only at real decision gates.
98
98
 
99
+ ### ON ENTRY — do this FIRST, then stay on the pipeline (load-bearing)
100
+ <!-- skill-options:no-gate-change: entry-point + planning-phase trigger — names the existing Step 0.7 first action and the existing pre-brief pipeline; adds no pause gate or options -->
101
+
102
+ The instant `/ritual build` is selected (including the no-subcommand default that treats the whole ask as the scope), your **next tool call** is the Step 0.7 **Job gate**: call `classify_work_item` with the user's ask, then render that gate. Everything between here and Step 0.7 — the vocabulary map, the build rail, the runtime contracts — is reference you apply *while* running the flow; it is **not** a reason to delay that first tool call.
103
+
104
+ **The pipeline — you are in the PLANNING phase until the build brief is accepted.** It runs as the six build-rail stages below, **in order**. **Advance through the numbered Steps exactly as written — do not skip ahead or reorder them.** The exact tool sequence lives in the Steps; follow them, don't reconstruct it from memory.
105
+
106
+ ```
107
+ Job (classify) -> Scope -> Discovery -> Recommendations -> Build brief (Step 10) | Implementation (Step 11+)
108
+ [------------------------------- planning phase -------------------------------] [---- implementation ----]
109
+ ```
110
+
111
+ **`create_exploration` is the END of Scope, not the start.** Scope = sub-problems (Step 4) → problem frame (Step 5) → `create_exploration` (Step 6). Creating the exploration before the sub-problems and frame exist forces a confusing backtrack — don't. After `classify_work_item` returns, render the Job gate, pick/create the workspace (Step 1), then do Steps 4 → 5 → 6 → 7 in order.
112
+
113
+ **The most common failures: (a) freelancing your own questions before classify, and (b) jumping ahead — creating the exploration or touching discovery before Scope is built. Do the next numbered Step; nothing else.**
114
+
115
+ **Forbidden for EVERY turn of the planning phase — not just the first (hard violations):**
116
+
117
+ - Inventing your own clarifying / scoping / "which option did you mean" questions, or using your agent's own question or prompt UI to gather scope. Scope is captured ONLY inside the flow, via `generate_problem_statement` (Step 4). The flow's own gates (Job gate, discovery, rec review) are the only pauses.
118
+ - Running ANY **implementation-phase** tooling before the build brief is generated and accepted (Step 10): file writes/edits, package installs, component/scaffold generators, design-asset generators, todo/task lists. (Examples by agent — v0: `GenerateDesignInspiration`, `TodoManager`, `shadcn add`; Cursor/Claude/etc. have equivalents.) Pulling implementation forward is a hard violation. These resume — and are expected — at **Step 11**.
119
+ - Reading repo files, `.ritual/config.json`, or calling `list_workspaces` before the Job gate is confirmed (Step 0.7). (Code-recon *reads* are fine later, at their step inside the planning phase; this only forbids them up front.)
120
+ - Emitting an empty, "let me think…", or narration-only turn with no tool call (e.g. "I'll start the build flow", "Let me gather context first"). Start the next step; don't announce it.
121
+
122
+ "Proceed with your best judgment" / "no clarification needed" does **not** mean skip the flow — it means run the flow with sane defaults and pause only at the real pause gates.
123
+
99
124
  ### Vocabulary mapping (engineer-tone)
100
125
 
101
126
  The Ritual data model uses product-research terminology. This skill translates to engineer-natural terms when speaking to the user. The underlying API still uses original names — keep this table mental when you read tool inputs / outputs:
@@ -380,11 +405,12 @@ Resolution order:
380
405
 
381
406
  <!-- skill-options:no-gate-change: adds explainer prose to the existing workspace-pick gate; options and pause unchanged -->
382
407
 
383
- > This repo isn't connected to a workspace yet.
384
- > A workspace keeps the context and reasoning Ritual needs for future runs.
385
- >
386
- > Where should Ritual save this run?
408
+ > A **workspace** is where Ritual keeps the context, decisions, and reasoning for related work — so future runs build on this one instead of starting cold. You're not in one yet.
387
409
  > {numbered list}
410
+ >
411
+ > Where should this run live? (pick one, or I'll create a new workspace for you)
412
+
413
+ (Repo-agnostic on purpose: don't say "this repo" — agents like v0 have no repo. If there are NO existing workspaces, skip the list and just say *"Ritual will set up a workspace for this — a workspace keeps the context for related work. I'll name it `{name}`; sound good?"* and create it.)
388
414
 
389
415
  **[LITE AUTO — no pause; auto-pick the recommended default]** for selection.
390
416
  3. **Create a new one if none exist or user wants a fresh one.** Call `mcp__ritual__create_workspace` with a name — convention is to name it after the repo (basename of cwd, or origin remote). Confirm the name with the user first. **[LITE AUTO — no pause; auto-pick the recommended default]**
@@ -686,12 +712,12 @@ Steps:
686
712
  <!-- skill-options:no-gate-change: f.1 is an OPTIONAL skippable sub-prompt nested in Step 1.5 step 6 (default skip); adds no tracked pause gate or Step header, so the structural fingerprint is unchanged (check-skill-options-contract green). -->
687
713
  f.1 **Unchosen-candidates gate (2026-06-14, unchosen-options → discovery worktrees).** The candidates the user did NOT pick are paths worth not silently dropping. Render ONE compact, SKIPPABLE prompt — for each unchosen candidate, the user can spin up **discovery now** (a background worktree reasons it to a build brief) or **log it as a future job**. Promote DELIBERATELY: the default is to drop. (This gate is itself skipped in autonomous/worktree mode — never spawn discovery recursively.)
688
714
 
715
+ <!-- skill-options:no-gate-change: prose-only copy tightening of the discover/next-job/skip descriptions; option tokens + gate unchanged -->
689
716
  ```text
690
- You picked #{k}. The other {M} — want to keep any going?
691
- • `discover <nums>` — spin up discovery NOW in a background git worktree: an agent reasons it
692
- end-to-end to a build brief (reasoning only, no code). e.g. `discover 1`
693
- • `next-job <nums>` just log it as a future job (a draft exploration in this workspace; nothing runs)
694
- • `skip` — drop them (default)
717
+ You picked #{k}. For the rest:
718
+ • `discover <nums>` — explore unpicked option(s) in parallel; returns a build brief, no code.
719
+ • `next-job <nums>` — save as future work.
720
+ • `skip` drop them. Default.
695
721
  ```
696
722
 
697
723
  Resolve the reply, then continue to Step 2 for the picked candidate:
@@ -1367,7 +1393,7 @@ Longest phase because generation is async + the user picks per-Area. (Internally
1367
1393
  **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.
1368
1394
  - **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?".
1369
1395
  - **Floor (HARD): at least 6 questions** across any Areas — below this, do NOT commit or proceed (tell them how many more to pick and keep them in the picker). There is NO "skip discovery" path — the agentic run needs a real question set to develop answers against. **Good coverage (SOFT): 15–20 questions** — nudge toward it on the Summary, but never block once ≥6. **No upper cap** — picking many (or all) is a legitimate explicit choice, never a default or fallback. (Uncovered scope is handled downstream when recommendations + requirements are generated and audited, so a thin set is the failure mode to prevent.)
1370
- - **The default is the suggested 12 on screen, never "all."** The landing shows exactly what `proceed` commits. An ambiguous reply (`proceed`, `go`, `ok`) at this gate means **accept the suggested 12 the user is looking at** — never silently accept everything.
1396
+ - **The default is the suggested 12, never "all."** `proceed` commits exactly that suggested set (not every generated question). An ambiguous reply (`proceed`, `go`, `ok`) at this gate means **accept the suggested 12** — never silently accept everything. (The landing summarizes rather than lists them; `expert` is the path to read/adjust the set before committing.)
1371
1397
  - **Taking all IS allowed — but only as an explicit user choice, never the default or a fallback.** If the user genuinely says "take all" / "all of them", honor it and commit them; that's a legitimate choice, not an error. Just never *offer* "I'll take all" as the default, and never auto-fall-back to it. (Worth mentioning once, not as a gate: every accepted question is answered individually in the agentic run, so accepting all of them across every Area means many more questions to answer and a much longer run — but it's the user's call.)
1372
1398
 
1373
1399
  **Forbidden behaviors:**
@@ -1431,31 +1457,19 @@ The user always confirms; nothing is committed without their reply.
1431
1457
 
1432
1458
  ###### 7.3.1 — First render: the suggested-12 landing (the default)
1433
1459
 
1434
- Render ALL 12 suggested questions IN FULL, grouped by Areanever truncate, elide, or "(… N more)" this list; the whole point is that the user reads exactly what one word will commit. Full phase rail on this message (we just entered Discovery).
1460
+ Render the **compact landing**: one summary line (counts + that the 12 most impactful were identified) and the action bar. Do NOT list the questions here the full set is inspected on demand via `expert` (the Area walk). Keeping this terse is deliberate; the earlier "render all 12 in full" landing was too verbose. Full phase rail on this message (we just entered Discovery).
1435
1461
 
1436
1462
  ```text
1437
1463
  Ritual build
1438
1464
  ✓ Job ✓ Scope ● Discovery ○ Recommendations ○ {Deliverable} ○ Implementation (Your agent)
1439
1465
 
1440
- Discovery questions ready — {M} generated across {N} areas.
1441
-
1442
- These 12 questions target the tradeoffs and unknowns most likely to change the plan.
1443
-
1444
- {Area name 1}
1445
- ✓ 1. {question, full text, wrapped readably}
1446
- ✓ 2. {question}
1447
-
1448
- {Area name 2}
1449
- ✓ 3. {question}
1450
- ✓ 4. {question}
1451
-
1452
- {…every suggested question, grouped by Area, all 12 visible…}
1466
+ We've generated {M} discovery questions across {N} areas and identified the 12 most impactful questions.
1453
1467
 
1454
- Reply `proceed` to use these 12, `expert` to adjust, or `pause`.
1468
+ Reply `proceed` to generate answers and recommendations for these questions, `expert` to inspect and adjust the question set, or `pause`.
1455
1469
  ```
1456
1470
 
1457
1471
  Branch on reply:
1458
- - **`proceed`** (or an ambiguous `ok`/`go`): commit exactly the 12 on screen via § 7.4's single batch call (grouped per Area), then continue to § 7.5 → Step 8. The ambiguous-reply rule is now structurally safe: what gets accepted is exactly what the user is looking at.
1472
+ - **`proceed`** (or an ambiguous `ok`/`go`): commit exactly the suggested 12 via § 7.4's single batch call (grouped per Area), then continue to § 7.5 → Step 8. Ambiguous replies (`ok`/`go`) map here. The questions aren't listed at this landing by design — a user who wants to read or change them before committing uses `expert`.
1459
1473
  - **`expert`**: enter the Area walk below with the suggested 12 **pre-selected** (`picked so far: 12`, ✓ on each suggested row). Numbers TOGGLE in expert mode — typing a selected question's number unselects it.
1460
1474
  - **`pause`**: stop here; nothing committed.
1461
1475
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "cliVersion": "0.36.37",
3
- "builtAt": "2026-06-20T13:23:52.963Z",
4
- "skillsHash": "622a0cff45d0"
2
+ "cliVersion": "0.36.39",
3
+ "builtAt": "2026-06-20T13:46:17.028Z",
4
+ "skillsHash": "283d2c7cc43e"
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: 622a0cff45d0
7
- cli_version: 0.36.37
6
+ stamp: 283d2c7cc43e
7
+ cli_version: 0.36.39
8
8
  ---
9
9
 
10
10
  # /ritual
@@ -101,8 +101,8 @@ Additional runtime references:
101
101
 
102
102
  ## Routing behavior
103
103
 
104
- - If the first token is one of the subcommands (`build`, `lite`, `resume`, `lineage`, `context-pulse`), load the matching runtime file and follow it.
105
- - If there is no subcommand or the token is unknown, default to `build` and treat the full argument as the problem statement.
104
+ - If the first token is one of the subcommands (`build`, `lite`, `resume`, `lineage`, `context-pulse`), load the matching runtime file and **immediately execute its ON ENTRY block — your next tool call is that flow's first tool call, not a clarifying question of your own.**
105
+ - If there is no subcommand or the token is unknown, default to `build` and treat the full argument as the problem statement (still run `build`'s ON ENTRY block — do not pause to ask your own scoping questions first).
106
106
  - If the user asks for retired or unsupported subcommands, answer in plain English and call the relevant MCP tool directly when appropriate; do not expand the `/ritual` command surface.
107
107
 
108
108
  ## Asks that don't map to a subcommand