@ritualai/cli 0.36.35 → 0.36.37

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 (37) hide show
  1. package/package.json +1 -1
  2. package/skills/claude-code/ritual/.ritual-bundle.json +3 -3
  3. package/skills/claude-code/ritual/SKILL.md +22 -14
  4. package/skills/claude-code/ritual/references/build-flow.md +41 -33
  5. package/skills/claude-code/ritual/references/cli-output-contract.md +9 -9
  6. package/skills/claude-code/ritual/references/lite-flow.md +42 -34
  7. package/skills/claude-code/ritual/references/resume-flow.md +3 -0
  8. package/skills/codex/ritual/.ritual-bundle.json +3 -3
  9. package/skills/codex/ritual/SKILL.md +22 -14
  10. package/skills/codex/ritual/references/build-flow.md +41 -33
  11. package/skills/codex/ritual/references/cli-output-contract.md +9 -9
  12. package/skills/codex/ritual/references/lite-flow.md +42 -34
  13. package/skills/codex/ritual/references/resume-flow.md +3 -0
  14. package/skills/cursor/ritual/.ritual-bundle.json +3 -3
  15. package/skills/cursor/ritual/SKILL.md +22 -14
  16. package/skills/cursor/ritual/references/build-flow.md +41 -33
  17. package/skills/cursor/ritual/references/cli-output-contract.md +9 -9
  18. package/skills/cursor/ritual/references/lite-flow.md +42 -34
  19. package/skills/cursor/ritual/references/resume-flow.md +3 -0
  20. package/skills/gemini/ritual/.ritual-bundle.json +3 -3
  21. package/skills/gemini/ritual/SKILL.md +22 -14
  22. package/skills/gemini/ritual/references/build-flow.md +41 -33
  23. package/skills/gemini/ritual/references/cli-output-contract.md +9 -9
  24. package/skills/gemini/ritual/references/lite-flow.md +42 -34
  25. package/skills/gemini/ritual/references/resume-flow.md +3 -0
  26. package/skills/kiro/ritual/.ritual-bundle.json +3 -3
  27. package/skills/kiro/ritual/SKILL.md +22 -14
  28. package/skills/kiro/ritual/references/build-flow.md +41 -33
  29. package/skills/kiro/ritual/references/cli-output-contract.md +9 -9
  30. package/skills/kiro/ritual/references/lite-flow.md +42 -34
  31. package/skills/kiro/ritual/references/resume-flow.md +3 -0
  32. package/skills/vscode/ritual/.ritual-bundle.json +3 -3
  33. package/skills/vscode/ritual/SKILL.md +22 -14
  34. package/skills/vscode/ritual/references/build-flow.md +41 -33
  35. package/skills/vscode/ritual/references/cli-output-contract.md +9 -9
  36. package/skills/vscode/ritual/references/lite-flow.md +42 -34
  37. package/skills/vscode/ritual/references/resume-flow.md +3 -0
@@ -141,7 +141,7 @@ If the user types `always audit for this build` mid-flow at the Step 9.6 prompt,
141
141
  Persist `auditMode` to `Exploration.metadata.auditMode` at `create_exploration` time (additive JSONB key — no schema migration) so `/ritual resume <exploration-id>` picks up the same mode the original build started with, and `/ritual lineage <exploration-id>` can render which gates ran + their outcomes.
142
142
 
143
143
  <!-- lite:keep-start -->
144
- <!-- skill-options:no-gate-change: 2b (clarifying question) + 2c (generic terminal) are loud-fallback COPY variants of the same gate; options are unchanged (proceed | name-the-job) -->
144
+ <!-- skill-options:no-gate-change: 2b (low-confidence clarifying question — server sets clarifyingQuestion only when confidence <20% or it defaulted) + 2c (confident generic — accept and proceed) are COPY variants of the same gate; options are unchanged (proceed | name-the-job; 2b adds answer-the-question, which is a name-the-job correction) -->
145
145
  #### Step 0.7 — The Job gate: classify the job to be done
146
146
 
147
147
  **The FIRST tool call of a fresh build.** The server — not you — classifies the user's raw ask into
@@ -161,14 +161,18 @@ When this gate runs:
161
161
 
162
162
  1. **Call `mcp__ritual__classify_work_item`** with `raw_input` = the user's ask, verbatim. Do NOT
163
163
  classify yourself, do NOT pre-filter to development jobs. It returns
164
- `{ jtbd, workItemLabel, deliverableTemplate, why, confidence, isGenericFallback, personaCoverage }`.
164
+ `{ jtbd, workItemLabel, deliverableTemplate, why, confidence, isGenericFallback, clarifyingQuestion?, personaCoverage }`.
165
165
  `isGenericFallback` (and `confidence`) are the typed-uncertainty signal: when it's `true`, the
166
166
  result is the catch-all (`build-feature` / `produce-deliverable`) or the classifier wasn't sure —
167
- it is NOT a confident match, and which render variant you use in step 2 depends on it.
167
+ it is NOT a confident match, and which render variant you use in step 2 depends on it. On that
168
+ generic path the response also carries `clarifyingQuestion` — a plain-language question generated
169
+ from the user's ask, which step 2b renders verbatim to disambiguate toward a specific job.
168
170
 
169
171
  2. **Render the validation prompt** (rail stage `Job`). This gate is a plain-language VALIDATION of
170
172
  what you're about to build: restate the ask + the matched job in the user's words, then let them
171
- confirm or correct. Which variant you render depends on `isGenericFallback`.
173
+ confirm or correct. Route to a variant by the response: a **`clarifyingQuestion`** present → **2b**
174
+ (we're genuinely unsure — ask, but let them proceed); else `isGenericFallback` true → **2c** (a
175
+ confident generic build — accept and proceed); else → **2a** (a confident specific match).
172
176
 
173
177
  **2a — Confident match** (`isGenericFallback` is `false`): the classifier matched a specific job.
174
178
 
@@ -181,14 +185,17 @@ When this gate runs:
181
185
  Reply `proceed` if that's right, or tell me what to adjust.
182
186
  ```
183
187
 
184
- **2b — No specific job matched, FIRST time** (`isGenericFallback` is `true` the result is the
185
- catch-all `build-feature` / `produce-deliverable`, or `confidence` is `low` AND you have not yet
186
- asked the clarifying question this gate): do NOT present the catch-all as a verdict. This case
187
- should be RARE. Instead ask ONE clarifying question that elicits the missing signal what KIND of
188
- work this is grounded in their ask, with concrete examples that lead the reply. The examples
189
- span the catalog's functions so the user can self-identify; tailor the wording to their ask. This
190
- is the fallback step that lets us classify properly instead of defaulting blind (see
191
- `loud-fallback-escalation.md`).
188
+ **2b — Genuinely unsure: ask, but let them proceed** (the response carries a **`clarifyingQuestion`**
189
+ the server sets it ONLY when it was essentially guessing: numeric confidence below 20, or it
190
+ failed to classify and defaulted). A generic result alone does NOT land here only a *low-confidence*
191
+ one does; a confident generic build goes to **2c**. The clarifying question is a single plain-language
192
+ question the server generated FROM the user's specific ask. **Render it verbatim** it is grounded in
193
+ their words and leak-free. Do not rephrase it, do not append a menu, do not mention classification /
194
+ jobs / categories / confidence. The user has TWO ways out: answer to focus it, OR reply `proceed` to
195
+ continue with the deliverable. **Leak rule (load-bearing):** the rendered copy must NEVER say
196
+ "generic", "I couldn't classify", "fallback", "catch-all", or otherwise reveal that classification was
197
+ uncertain — that is internal state. Present it as a normal question about their ask. (See
198
+ `loud-fallback-escalation.md`.)
192
199
 
193
200
  ```text
194
201
  Ritual build
@@ -196,34 +203,35 @@ When this gate runs:
196
203
 
197
204
  You're looking to: {restate the ask in one short clause}
198
205
 
199
- I couldn't pin this to a specific job your ask reads as an outcome, and the flow scopes much
200
- better when I know what KIND of work it is. Which is closest (or say it in your own words)?
201
- • A coding-agent / MCP / skill capability — tooling the agent itself uses
202
- • A backend service or API
203
- • A frontend / UI feature
204
- • A refactor, migration, or infra / platform change
205
- • Something else — tell me in a sentence
206
+ {clarifyingQuestionverbatim}
206
207
 
207
- Reply with the closest fit (or your own words) and I'll lock the job.
208
+ Answer in a sentence or reply `proceed` and I'll continue with a {Deliverable}.
208
209
  ```
209
210
 
210
- When the user answers, call `mcp__ritual__classify_work_item` AGAIN with the same `raw_input` plus
211
- `correction` = their reply (and `previous_jtbd`), then re-render: **2a** if it now matched a
212
- specific job, otherwise **2c**.
211
+ (Rare degraded case you reached 2b but `clarifyingQuestion` is missing: ask which KIND of work it
212
+ is, with the same `proceed` option — • a coding-agent / MCP / skill capability a backend service
213
+ or API • a frontend / UI feature • a refactor, migration, or infra change • something else, in your
214
+ own words.)
213
215
 
214
- **2c Still generic after the clarifying question** (`isGenericFallback` is STILL `true` after the
215
- user answered 2b): do NOT ask again. Proceed as a generic build with the function-agnostic
216
- `Feature Brief` deliverable, and note the job can be renamed later. The job name stays generic
217
- never show a function-specific deliverable (e.g. "Frontend Web") for an unclassified build.
216
+ If the user ANSWERS, call `mcp__ritual__classify_work_item` AGAIN with the same `raw_input` plus
217
+ `correction` = their reply (and `previous_jtbd`), then re-render: **2a** if it now matched a specific
218
+ job, otherwise **2c**. If the user replies `proceed`, go straight to **2c** (accept the generic).
219
+
220
+ **2c — Accept and proceed** (`isGenericFallback` is `true` with NO `clarifyingQuestion` — a
221
+ confident-enough generic build — OR the user chose to proceed from 2b, OR a re-classification is still
222
+ generic): do NOT interrogate. Present the deliverable as a normal accept-and-proceed — **same clean
223
+ shape as 2a**. Internally the job stays generic and is renamable later, but **the rendered copy must
224
+ NEVER say "generic", "couldn't classify", "fallback", or otherwise reveal that** — that is internal
225
+ state. Just name what Ritual will produce for their ask. (Never show a function-specific deliverable
226
+ like "Frontend Web" for an unclassified build — only the function-agnostic `Feature Brief`.)
218
227
 
219
228
  ```text
220
229
  Ritual build
221
230
  ● Job ○ Scope ○ Discovery ○ Recommendations ○ Feature Brief
222
231
 
223
- You're looking to: {restate the ask in one short clause}
224
- I'll treat this as a generic build — deliverable: Feature Brief. You can rename the job later.
232
+ Ritual will produce a {Deliverable} for {restate the ask in one short clause}.
225
233
 
226
- Reply `proceed` to frame the problem.
234
+ Reply `proceed` if that's right, or tell me what to focus on.
227
235
  ```
228
236
 
229
237
  Do not render `personaCoverage` — persona representation is handled server-side now; only surface
@@ -449,7 +457,7 @@ Steps:
449
457
  - For `ready` or `in_flight` states, jump directly to Step 10 (build brief generation).
450
458
  - For `awaiting_admin`, jump to Step 9 (review + `proceed`). Only an admin can move it forward; collaborators see the recs and proceed only if they're explicitly authorized to implement ahead.
451
459
  - For `implemented_ahead`, surface the situation to the user and ask what to do — typically the admin reconciles by either approving the recs post-hoc (no code change needed) or updating the recs to match shipped reality.
452
- - **For `done` or `in_flight` — branch-existence sanity check FIRST.** *(CLI Tenet #9 — sanity-check the world before trusting the database.)* The state badge is computed from `ImplementationRecord` rows in the KG. If the KG was seeded from synthetic/bootstrap data (a common state in early pilot deployments), the record can assert a PR/branch that doesn't exist in this repo. Before treating the exploration as ✓ shipped, verify:
460
+ - **For `done` or `in_flight` — branch-existence sanity check FIRST (when your agent can run shell + git).** *(CLI Tenet #9 — sanity-check the world before trusting the database.)* **If your agent can't run shell/git** (v0, Lovable, browser-only agents), skip this probe and the footprint probe below, treat the KG state badge as truth, and tell the user you couldn't cross-check it against local git. The state badge is computed from `ImplementationRecord` rows in the KG. If the KG was seeded from synthetic/bootstrap data (a common state in early pilot deployments), the record can assert a PR/branch that doesn't exist in this repo. Before treating the exploration as ✓ shipped, verify:
453
461
 
454
462
  ```bash
455
463
  # If implementationRecord.branch is set:
@@ -468,7 +476,7 @@ Steps:
468
476
 
469
477
  Don't paint 3-4 options ("treat as done / treat as fresh / inspect the KG row / something else") — one decisive proposal with a yes/no/correct-me escape hatch. If yes: jump to Step 10 (build brief). If no/correct-me: take the user's input as ground truth and update the next move accordingly.
470
478
 
471
- - **For `ready` or `in_flight` — implementation footprint check FIRST.** *(Same shape as `/ritual resume` Step R3.5.)* The KG can't distinguish "brief generated, no code yet" from "mid-implementation, unsynced" from "implementation was started and then dropped" — all three look like `ready` because no `ImplementationRecord` exists until `sync_implementation` is called. Run the footprint probes using the `Ritual-Exploration: <id>` commit trailer mandated by Tenet #14:
479
+ - **For `ready` or `in_flight` — implementation footprint check FIRST (when your agent can run shell + git; otherwise skip — see the guard above).** *(Same shape as `/ritual resume` Step R3.5.)* The KG can't distinguish "brief generated, no code yet" from "mid-implementation, unsynced" from "implementation was started and then dropped" — all three look like `ready` because no `ImplementationRecord` exists until `sync_implementation` is called. Run the footprint probes using the `Ritual-Exploration: <id>` commit trailer mandated by Tenet #14:
472
480
 
473
481
  ```bash
474
482
  git log --all --grep="Ritual-Exploration: ${exploration_id}" --oneline 2>/dev/null
@@ -2198,7 +2206,7 @@ The Build Brief is the markdown document the engineer reads RIGHT BEFORE writing
2198
2206
  Call `mcp__ritual__generate_build_brief` with:
2199
2207
 
2200
2208
  - `exploration_id`
2201
- - `icp` (optional defaults to the exploration template's primary ICP, then PM; pass `TECH_PM` for engineering-flavored explorations)
2209
+ - `icp` — **omit this.** The brief sources from the requirement set the flow already generated (on accept), whose ICP the server resolves from the exploration's persona/template. Passing a different ICP here forces a redundant requirement regeneration and a slow cold start. The engineering flavor is already baked into the server-resolved template — you do not need to (and should not) pass `TECH_PM` or any other ICP.
2202
2210
  - `recon_context` — the Step 3 `codebase_context_packet` plus any explicit phase/later candidates from discovery. Do not pass raw recon notes. This grounds "Codebase Anchors" in real file paths while keeping agent hypotheses auditable and non-authoritative.
2203
2211
  - `sources` — the **same** file-path array passed to `generate_considerations` and `generate_problem_statement` in Steps 4–5. Critical for KG consistency: the brief's "Previously Deferred" section only populates when overlapping prior implementations exist on these files.
2204
2212
 
@@ -1,8 +1,8 @@
1
- # CLI output contract
1
+ # Agent output contract
2
2
 
3
3
  ### Developer-facing output contract
4
4
 
5
- This skill drives a CLI surface where the user reads every line. Optimize for a busy engineer who wants enough signal to trust the workflow without reading the agent's scratchpad.
5
+ This skill drives an agent surface where the user reads every line of the agent's output. Optimize for a busy engineer who wants enough signal to trust the workflow without reading the agent's scratchpad.
6
6
 
7
7
  Maintain two layers throughout the flow:
8
8
 
@@ -18,7 +18,7 @@ Do **not** pass raw notes as the primary context to MCP generation tools. Raw no
18
18
 
19
19
  Default user-visible messages should be:
20
20
  - 3–7 bullets max, unless the user explicitly asks for detail
21
- - no more than one terminal screen
21
+ - no more than one screen
22
22
  - focused on findings, constraints, next action, and specific signals
23
23
  - free of “I inferred…” / “that means I'll bias…” narration unless the inference changes a user-facing choice
24
24
  - free of raw file-by-file recon dumps unless requested
@@ -138,14 +138,14 @@ When in doubt, prefer one blank line over none. The cost of a tiny gap is unnoti
138
138
 
139
139
  | Surface | Rendering | When to use |
140
140
  |---|---|---|
141
- | **CLI / terminal** (current default) | Full two-line rail. `Ritual build` on line 1, `● Job ○ Scope ○ Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)` on line 2. | Terminal scrollback has no persistent UI — the rail IS the anchor. |
141
+ | **CLI / terminal** (terminal agents — Claude Code, Cursor, Codex in a built-in terminal) | Full two-line rail. `Ritual build` on line 1, `● Job ○ Scope ○ Discovery ○ Recommendations ○ Build brief ○ Implementation (Your agent)` on line 2. | Terminal scrollback has no persistent UI — the rail IS the anchor. |
142
142
  | **Mobile chat / narrow chat** | Compact one-line chip. `Ritual build · 2/6 Scope`. Optionally add a second line: `Done: Job, Scope · Next: Recommendations`. | Six-stage rail wraps and looks noisy inside chat bubbles. |
143
143
  | **Rich app with persistent stepper** | Single-line stage label. `Scope` (or `Phase: Scope`). The app's pinned stepper above the conversation is the primary anchor; messages just need the current label. At phase transitions, resume points, and major decision gates, include the compact mobile-style chip even in rich-app surface for transcript portability. | The persistent UI carries the anchor; redundant chrome in every bubble is noise. |
144
144
 
145
145
  **How the agent picks the surface:**
146
146
 
147
- - Default to **CLI / terminal** rendering. This SKILL exists primarily to drive CLI surfaces (Claude Code, Cursor, Codex, etc. in their built-in terminals).
148
- - If the host signals a non-terminal surface via context (mobile-app chat embedding, web-app chat UI, etc.), drop to the compact chip.
147
+ - When your agent runs in a terminal (Claude Code, Cursor, Codex, etc. in their built-in terminals), default to **CLI / terminal** rendering.
148
+ - When the surface is a chat UI rather than a terminal (web-app agents like v0/Lovable, mobile-app chat embedding, etc.), drop to the compact chip.
149
149
  - The rule is: **progress anchor is mandatory; exact visual rendering is surface-specific.** Do NOT force the full six-stage rail when it will wrap.
150
150
 
151
151
  **Applies to:**
@@ -282,15 +282,15 @@ The host app pins a stepper above the conversation; the message only carries the
282
282
  All `/ritual build` and `/ritual resume` top-level messages in `references/build-flow.md` anchor to this spec — when a stage transitions, the existing examples advance the marker per the canonical ordering. If you need to rename a stage in the future, update this table first; everything else follows.
283
283
 
284
284
 
285
- ### CLI experience cheat-sheet
285
+ ### Agent experience cheat-sheet
286
286
 
287
- This skill drives a CLI surface where the user reads every line you print. Keep these tenets in mind — full doc at `documents/design/cli-experience-tenets.md`:
287
+ This skill drives an agent surface where the user reads every line you print. Keep these tenets in mind — full doc at `documents/design/cli-experience-tenets.md`:
288
288
 
289
289
  - **Long artifacts (briefs, recon notes) → files, not terminal dumps.** The CLI summarizes; the file holds the detail. End every output with what the user can do next.
290
290
  - **Single recommended action + escape hatch > 3-option menu.** Lead with the best next step, give them a cheap "no, do this instead" out. Reserve 3-way branches for genuinely distinct intents (implement / refine / drill — yes; "generate brief / look at deferrals / something else" — no).
291
291
  - **Cite the specific signal**, not the abstract gesture. *"Recommended because RB-001 is blocking…"* beats *"based on prior workspace context."*
292
292
  - **Silence on no-data.** Don't print "Checked X — nothing." Just don't render the section.
293
- - **Sanity-check the world before trusting the DB.** When an `ImplementationRecord` asserts a branch/PR, verify it exists locally before treating the exploration as done (Step 1.5 step 5).
293
+ - **Sanity-check the world before trusting the DB (when you can).** If your agent has shell + git, verify an `ImplementationRecord`'s asserted branch/PR exists locally before treating the exploration as done (Step 1.5 step 5). If it can't run git, treat the KG record as truth and say you couldn't verify it locally.
294
294
  - **Never commit to `main` / `master` from this workflow.** Step 11 creates a feature branch FIRST — no exceptions, no user-prompt offering "commit to trunk" as an option (Tenet #13).
295
295
  - **Attribute back to Ritual on outbound artifacts.** Commit-message trailers + PR body + generated-file headers carry the exploration link so future readers can trace the lineage without re-asking the agent (Tenet #14).
296
296
  - **Format dense CLI lists for scanning.** When an item has a title, explanation, rationale, and references, split those into labeled blocks with blank lines between items. Do not rely on terminal auto-wrap to make long prose readable.
@@ -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: 3cfb8c30115f21ac -->
2
+ <!-- source-sha: 41c0a8e8e2f22f6c -->
3
3
 
4
4
  # /ritual lite — fast build (generated; do not edit)
5
5
 
@@ -233,7 +233,7 @@ If the user types `always audit for this build` mid-flow at the Step 9.6 prompt,
233
233
  Persist `auditMode` to `Exploration.metadata.auditMode` at `create_exploration` time (additive JSONB key — no schema migration) so `/ritual resume <exploration-id>` picks up the same mode the original build started with, and `/ritual lineage <exploration-id>` can render which gates ran + their outcomes.
234
234
 
235
235
 
236
- <!-- skill-options:no-gate-change: 2b (clarifying question) + 2c (generic terminal) are loud-fallback COPY variants of the same gate; options are unchanged (proceed | name-the-job) -->
236
+ <!-- skill-options:no-gate-change: 2b (low-confidence clarifying question — server sets clarifyingQuestion only when confidence <20% or it defaulted) + 2c (confident generic — accept and proceed) are COPY variants of the same gate; options are unchanged (proceed | name-the-job; 2b adds answer-the-question, which is a name-the-job correction) -->
237
237
  #### Step 0.7 — The Job gate: classify the job to be done
238
238
 
239
239
  **The FIRST tool call of a fresh build.** The server — not you — classifies the user's raw ask into
@@ -253,14 +253,18 @@ When this gate runs:
253
253
 
254
254
  1. **Call `mcp__ritual__classify_work_item`** with `raw_input` = the user's ask, verbatim. Do NOT
255
255
  classify yourself, do NOT pre-filter to development jobs. It returns
256
- `{ jtbd, workItemLabel, deliverableTemplate, why, confidence, isGenericFallback, personaCoverage }`.
256
+ `{ jtbd, workItemLabel, deliverableTemplate, why, confidence, isGenericFallback, clarifyingQuestion?, personaCoverage }`.
257
257
  `isGenericFallback` (and `confidence`) are the typed-uncertainty signal: when it's `true`, the
258
258
  result is the catch-all (`build-feature` / `produce-deliverable`) or the classifier wasn't sure —
259
- it is NOT a confident match, and which render variant you use in step 2 depends on it.
259
+ it is NOT a confident match, and which render variant you use in step 2 depends on it. On that
260
+ generic path the response also carries `clarifyingQuestion` — a plain-language question generated
261
+ from the user's ask, which step 2b renders verbatim to disambiguate toward a specific job.
260
262
 
261
263
  2. **Render the validation prompt** (rail stage `Job`). This gate is a plain-language VALIDATION of
262
264
  what you're about to build: restate the ask + the matched job in the user's words, then let them
263
- confirm or correct. Which variant you render depends on `isGenericFallback`.
265
+ confirm or correct. Route to a variant by the response: a **`clarifyingQuestion`** present → **2b**
266
+ (we're genuinely unsure — ask, but let them proceed); else `isGenericFallback` true → **2c** (a
267
+ confident generic build — accept and proceed); else → **2a** (a confident specific match).
264
268
 
265
269
  **2a — Confident match** (`isGenericFallback` is `false`): the classifier matched a specific job.
266
270
 
@@ -273,14 +277,17 @@ When this gate runs:
273
277
  Reply `proceed` if that's right, or tell me what to adjust.
274
278
  ```
275
279
 
276
- **2b — No specific job matched, FIRST time** (`isGenericFallback` is `true` the result is the
277
- catch-all `build-feature` / `produce-deliverable`, or `confidence` is `low` AND you have not yet
278
- asked the clarifying question this gate): do NOT present the catch-all as a verdict. This case
279
- should be RARE. Instead ask ONE clarifying question that elicits the missing signal what KIND of
280
- work this is grounded in their ask, with concrete examples that lead the reply. The examples
281
- span the catalog's functions so the user can self-identify; tailor the wording to their ask. This
282
- is the fallback step that lets us classify properly instead of defaulting blind (see
283
- `loud-fallback-escalation.md`).
280
+ **2b — Genuinely unsure: ask, but let them proceed** (the response carries a **`clarifyingQuestion`**
281
+ the server sets it ONLY when it was essentially guessing: numeric confidence below 20, or it
282
+ failed to classify and defaulted). A generic result alone does NOT land here only a *low-confidence*
283
+ one does; a confident generic build goes to **2c**. The clarifying question is a single plain-language
284
+ question the server generated FROM the user's specific ask. **Render it verbatim** it is grounded in
285
+ their words and leak-free. Do not rephrase it, do not append a menu, do not mention classification /
286
+ jobs / categories / confidence. The user has TWO ways out: answer to focus it, OR reply `proceed` to
287
+ continue with the deliverable. **Leak rule (load-bearing):** the rendered copy must NEVER say
288
+ "generic", "I couldn't classify", "fallback", "catch-all", or otherwise reveal that classification was
289
+ uncertain — that is internal state. Present it as a normal question about their ask. (See
290
+ `loud-fallback-escalation.md`.)
284
291
 
285
292
  ```text
286
293
  Ritual build
@@ -288,34 +295,35 @@ When this gate runs:
288
295
 
289
296
  You're looking to: {restate the ask in one short clause}
290
297
 
291
- I couldn't pin this to a specific job your ask reads as an outcome, and the flow scopes much
292
- better when I know what KIND of work it is. Which is closest (or say it in your own words)?
293
- • A coding-agent / MCP / skill capability — tooling the agent itself uses
294
- • A backend service or API
295
- • A frontend / UI feature
296
- • A refactor, migration, or infra / platform change
297
- • Something else — tell me in a sentence
298
+ {clarifyingQuestionverbatim}
298
299
 
299
- Reply with the closest fit (or your own words) and I'll lock the job.
300
+ Answer in a sentence or reply `proceed` and I'll continue with a {Deliverable}.
300
301
  ```
301
302
 
302
- When the user answers, call `mcp__ritual__classify_work_item` AGAIN with the same `raw_input` plus
303
- `correction` = their reply (and `previous_jtbd`), then re-render: **2a** if it now matched a
304
- specific job, otherwise **2c**.
303
+ (Rare degraded case you reached 2b but `clarifyingQuestion` is missing: ask which KIND of work it
304
+ is, with the same `proceed` option — • a coding-agent / MCP / skill capability a backend service
305
+ or API • a frontend / UI feature • a refactor, migration, or infra change • something else, in your
306
+ own words.)
305
307
 
306
- **2c Still generic after the clarifying question** (`isGenericFallback` is STILL `true` after the
307
- user answered 2b): do NOT ask again. Proceed as a generic build with the function-agnostic
308
- `Feature Brief` deliverable, and note the job can be renamed later. The job name stays generic
309
- never show a function-specific deliverable (e.g. "Frontend Web") for an unclassified build.
308
+ If the user ANSWERS, call `mcp__ritual__classify_work_item` AGAIN with the same `raw_input` plus
309
+ `correction` = their reply (and `previous_jtbd`), then re-render: **2a** if it now matched a specific
310
+ job, otherwise **2c**. If the user replies `proceed`, go straight to **2c** (accept the generic).
311
+
312
+ **2c — Accept and proceed** (`isGenericFallback` is `true` with NO `clarifyingQuestion` — a
313
+ confident-enough generic build — OR the user chose to proceed from 2b, OR a re-classification is still
314
+ generic): do NOT interrogate. Present the deliverable as a normal accept-and-proceed — **same clean
315
+ shape as 2a**. Internally the job stays generic and is renamable later, but **the rendered copy must
316
+ NEVER say "generic", "couldn't classify", "fallback", or otherwise reveal that** — that is internal
317
+ state. Just name what Ritual will produce for their ask. (Never show a function-specific deliverable
318
+ like "Frontend Web" for an unclassified build — only the function-agnostic `Feature Brief`.)
310
319
 
311
320
  ```text
312
321
  Ritual build
313
322
  ● Job ○ Scope ○ Discovery ○ Recommendations ○ Feature Brief
314
323
 
315
- You're looking to: {restate the ask in one short clause}
316
- I'll treat this as a generic build — deliverable: Feature Brief. You can rename the job later.
324
+ Ritual will produce a {Deliverable} for {restate the ask in one short clause}.
317
325
 
318
- Reply `proceed` to frame the problem.
326
+ Reply `proceed` if that's right, or tell me what to focus on.
319
327
  ```
320
328
 
321
329
  Do not render `personaCoverage` — persona representation is handled server-side now; only surface
@@ -541,7 +549,7 @@ Steps:
541
549
  - For `ready` or `in_flight` states, jump directly to Step 10 (build brief generation).
542
550
  - For `awaiting_admin`, jump to Step 9 (review + `proceed`). Only an admin can move it forward; collaborators see the recs and proceed only if they're explicitly authorized to implement ahead.
543
551
  - For `implemented_ahead`, surface the situation to the user and ask what to do — typically the admin reconciles by either approving the recs post-hoc (no code change needed) or updating the recs to match shipped reality.
544
- - **For `done` or `in_flight` — branch-existence sanity check FIRST.** *(CLI Tenet #9 — sanity-check the world before trusting the database.)* The state badge is computed from `ImplementationRecord` rows in the KG. If the KG was seeded from synthetic/bootstrap data (a common state in early pilot deployments), the record can assert a PR/branch that doesn't exist in this repo. Before treating the exploration as ✓ shipped, verify:
552
+ - **For `done` or `in_flight` — branch-existence sanity check FIRST (when your agent can run shell + git).** *(CLI Tenet #9 — sanity-check the world before trusting the database.)* **If your agent can't run shell/git** (v0, Lovable, browser-only agents), skip this probe and the footprint probe below, treat the KG state badge as truth, and tell the user you couldn't cross-check it against local git. The state badge is computed from `ImplementationRecord` rows in the KG. If the KG was seeded from synthetic/bootstrap data (a common state in early pilot deployments), the record can assert a PR/branch that doesn't exist in this repo. Before treating the exploration as ✓ shipped, verify:
545
553
 
546
554
  ```bash
547
555
  # If implementationRecord.branch is set:
@@ -560,7 +568,7 @@ Steps:
560
568
 
561
569
  Don't paint 3-4 options ("treat as done / treat as fresh / inspect the KG row / something else") — one decisive proposal with a yes/no/correct-me escape hatch. If yes: jump to Step 10 (build brief). If no/correct-me: take the user's input as ground truth and update the next move accordingly.
562
570
 
563
- - **For `ready` or `in_flight` — implementation footprint check FIRST.** *(Same shape as `/ritual resume` Step R3.5.)* The KG can't distinguish "brief generated, no code yet" from "mid-implementation, unsynced" from "implementation was started and then dropped" — all three look like `ready` because no `ImplementationRecord` exists until `sync_implementation` is called. Run the footprint probes using the `Ritual-Exploration: <id>` commit trailer mandated by Tenet #14:
571
+ - **For `ready` or `in_flight` — implementation footprint check FIRST (when your agent can run shell + git; otherwise skip — see the guard above).** *(Same shape as `/ritual resume` Step R3.5.)* The KG can't distinguish "brief generated, no code yet" from "mid-implementation, unsynced" from "implementation was started and then dropped" — all three look like `ready` because no `ImplementationRecord` exists until `sync_implementation` is called. Run the footprint probes using the `Ritual-Exploration: <id>` commit trailer mandated by Tenet #14:
564
572
 
565
573
  ```bash
566
574
  git log --all --grep="Ritual-Exploration: ${exploration_id}" --oneline 2>/dev/null
@@ -2262,7 +2270,7 @@ The Build Brief is the markdown document the engineer reads RIGHT BEFORE writing
2262
2270
  Call `mcp__ritual__generate_build_brief` with:
2263
2271
 
2264
2272
  - `exploration_id`
2265
- - `icp` (optional defaults to the exploration template's primary ICP, then PM; pass `TECH_PM` for engineering-flavored explorations)
2273
+ - `icp` — **omit this.** The brief sources from the requirement set the flow already generated (on accept), whose ICP the server resolves from the exploration's persona/template. Passing a different ICP here forces a redundant requirement regeneration and a slow cold start. The engineering flavor is already baked into the server-resolved template — you do not need to (and should not) pass `TECH_PM` or any other ICP.
2266
2274
  - `recon_context` — the Step 3 `codebase_context_packet` plus any explicit phase/later candidates from discovery. Do not pass raw recon notes. This grounds "Codebase Anchors" in real file paths while keeping agent hypotheses auditable and non-authoritative.
2267
2275
  - `sources` — the **same** file-path array passed to `generate_considerations` and `generate_problem_statement` in Steps 4–5. Critical for KG consistency: the brief's "Previously Deferred" section only populates when overlapping prior implementations exist on these files.
2268
2276
 
@@ -142,6 +142,8 @@ Silence on no-data (CLI Tenet #6): if a state bucket is empty, don't render it.
142
142
 
143
143
  #### Step R3 — Branch-existence sanity check (`done` / `in_flight` only)
144
144
 
145
+ > **Requires shell + git.** Steps R3 and R3.5 verify KG state against local git, so they only run on agents that can execute shell + `git`/`gh` (Claude Code, Codex, Cursor agent mode, …). **If your agent can't run shell/git** (v0, Lovable, browser-only agents), skip both probes entirely, treat the KG state badge as truth, and tell the user you couldn't cross-check it against local git history.
146
+
145
147
  Same as `/ritual build` Step 1.5 step 5's CLI Tenet #9 check. Before treating an exploration as ✓ done, verify the implementation record's branch / PR actually exists locally or remotely:
146
148
 
147
149
  ```bash
@@ -192,6 +194,7 @@ Cross-reference findings against the KG state:
192
194
 
193
195
  **Skip the probes when:**
194
196
 
197
+ - **Your agent can't run shell + git** (see the R3 guard above) — skip entirely and treat the KG state as truth.
195
198
  - The exploration was just created in this same session — no time to have orphan commits.
196
199
  - The user just synced (the `done` / `in_flight` state badge was set within the last few minutes).
197
200
  - The exploration is in a state where the footprint check doesn't apply (`in_progress`, `awaiting_admin`, `implemented_ahead`).