@zigrivers/scaffold 3.23.0 → 3.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -202,9 +202,9 @@ When the user asks "what tools are available?", "what can I build?", or "show me
202
202
  | `scaffold run update` | Update scaffold to the latest version |
203
203
  | `scaffold run dashboard` | Open a visual progress dashboard in your browser |
204
204
  | `scaffold run prompt-pipeline` | Print the full pipeline reference table |
205
- | `scaffold run review-code` | Run all 3 code review channels on local code before commit or push |
206
- | `scaffold run review-pr` | Run all 3 code review channels (Codex CLI, Gemini CLI, Superpowers) on a PR |
207
- | `scaffold run post-implementation-review` | Full 3-channel codebase review after an AI agent completes all tasks |
205
+ | `scaffold run review-code` | Run all 3 CLI review channels (Codex CLI, Gemini CLI, Claude CLI) on tracked local code (committed branch diff + staged + unstaged — no untracked files) before commit or push, plus Superpowers code-reviewer as a complementary 4th channel |
206
+ | `scaffold run review-pr` | Run all 3 code review channels (Codex CLI, Gemini CLI, Claude CLI) on a PR, plus Superpowers code-reviewer as a complementary 4th channel |
207
+ | `scaffold run post-implementation-review` | Full codebase review (Codex CLI, Gemini CLI, Superpowers code-reviewer) after an AI agent completes all tasks |
208
208
  | `scaffold run session-analyzer` | Analyze Claude Code session logs for patterns and insights |
209
209
 
210
210
  **Display rules:**
@@ -240,7 +240,8 @@ Respond to these natural language requests:
240
240
  | "Is X applicable?" / "Do I need X?" | Run `scaffold check <step>` to detect platform and brownfield status |
241
241
  | "Set up memory" / "Configure AI memory" / "Add memory" | Run `scaffold run ai-memory-setup` — sets up modular rules, optional MCP memory server, and external context |
242
242
  | "Set up testing" / "Add Playwright" / "Add Maestro" | Run `scaffold run add-e2e-testing` — auto-detects web/mobile and configures the right framework(s) |
243
- | "Run multi-model review" / "Review stories with other models" | Run `scaffold run review-user-stories` at depth 5 (multi-model capabilities are now built into review-user-stories) |
243
+ | "Run multi-model review" / "Review X with all three models" | Route by target see [Multi-Model Review Routing](#multi-model-review-routing) |
244
+ | "Review stories with other models" | Run `scaffold run review-user-stories` at depth 5 (multi-model capabilities are built into review-user-stories) |
244
245
  | "Skip X" | Run `scaffold skip <step> --reason "<user's reason>"` |
245
246
  | "Skip X, Y, and Z" | Run `scaffold skip <step1> <step2> <step3> --reason "<reason>"` |
246
247
  | "What's left?" / "Show remaining" | Run `scaffold status --compact`, show only pending/in-progress steps |
@@ -338,28 +339,73 @@ scaffold check add-e2e-testing
338
339
 
339
340
  This is useful when the user asks "Do I need this step?" or when previewing which optional steps apply before running them.
340
341
 
342
+ ### Multi-Model Review Routing
343
+
344
+ When the user asks for a "multi-model review", "review this with all three models",
345
+ "run MMR on X", or similar — **do not assume the target is a PR**. Route based on
346
+ what the user is pointing at:
347
+
348
+ | Target | Command |
349
+ |---|---|
350
+ | GitHub PR (explicit number or current branch's PR) | `scaffold run review-pr [<PR#>]` |
351
+ | Local uncommitted / staged code, before commit or push | `scaffold run review-code` |
352
+ | Pending edits to a tracked file (changes since HEAD) | `git diff HEAD -- <path> \| mmr review --diff - --sync --format json` |
353
+ | Current contents of any file (tracked-with-no-changes, untracked, or brand-new) | `(diff -u /dev/null <path> \|\| true) \| mmr review --diff - --sync --format json` |
354
+ | A branch diff against main (or another ref) | `mmr review --base <ref> --head <ref> --sync --format json` |
355
+ | An existing patch or diff file | `mmr review --diff <path.patch> --sync --format json` |
356
+ | A diff piped from another command | `<cmd> \| mmr review --diff - --sync --format json` (stdin) |
357
+ | A user-story review specifically at depth 5 | `scaffold run review-user-stories` |
358
+
359
+ If the user's target is ambiguous ("review this with MMR"), ask once which of
360
+ the above applies — don't default to `review-pr` just because it's the most
361
+ common entry point. Doc reviews and uncommitted-work reviews are equally
362
+ first-class.
363
+
364
+ Pass `--focus "..."` to MMR when the user describes what to evaluate (clarity,
365
+ completeness, security, performance, etc.). See the `mmr` skill for all input
366
+ modes and flags.
367
+
368
+ **Note on `--diff`:** the flag requires diff-format content (path to a
369
+ `.patch`/`.diff` file, or `-` for stdin). To review a regular document or
370
+ source file, wrap it in a diff first using `git diff HEAD -- <path>`
371
+ (tracked) or `(diff -u /dev/null <path> || true)` (untracked — the
372
+ `|| true` guard is required because `diff` exits 1 whenever files
373
+ differ, which breaks pipelines under `set -o pipefail`) and pipe the
374
+ result into `mmr review --diff -`.
375
+
341
376
  ### Multi-Model Review at Depth 4-5
342
377
 
343
- All review and validation steps now support independent multi-model validation at depth 4-5 using Codex and/or Gemini CLIs. The `multi-model-dispatch` skill documents the correct invocation patterns:
378
+ All review and validation steps support independent multi-model validation at depth 4-5. Two distinct paths exist **never mix them** pick based on what step is running:
344
379
 
345
- - **Codex**: `codex exec --skip-git-repo-check -s read-only --ephemeral "prompt" 2>/dev/null` (NOT bare `codex`)
346
- - **Gemini**: `NO_BROWSER=true gemini -p "prompt" --output-format json --approval-mode yolo 2>/dev/null`
380
+ #### Path A: MMR-backed review (PREFERRED always use for these steps)
347
381
 
348
- **`NO_BROWSER=true` is required for all Gemini invocations** from Claude Code's Bash tool. Without it, Gemini's child process relaunch shows a consent prompt that hangs in non-TTY shells.
382
+ Applies to: `scaffold run review-pr`, `scaffold run review-code`, and any pipeline review step that invokes `mmr review` directly.
349
383
 
350
- **Auth verification is mandatory before dispatch.** CLI tokens expire mid-session. Before running any review at depth 4-5:
351
- 1. Check Codex auth: `codex login status`
352
- 2. Check Gemini auth: `NO_BROWSER=true gemini -p "respond with ok" -o json` (exit 41 = auth failure)
353
- 3. If auth fails, tell the user to re-authenticate: `! gemini -p "hello"` or `! codex login` (the `!` prefix runs it interactively with TTY access)
354
- 4. **Never silently skip a CLI due to auth failure** surface it to the user
384
+ - **Channel model:** three CLIs (Codex + Gemini + Claude) dispatched and reconciled by the MMR CLI; scaffold wrappers add the Superpowers code-reviewer agent as a complementary 4th channel reconciled into the same MMR job via `mmr reconcile`.
385
+ - **Note:** `scaffold run post-implementation-review` follows a different channel layout (raw-CLI dispatch of Codex + Gemini + Superpowers, with optional `mmr reconcile` injection if a prior `mmr review` job exists). Treat it as its own path — consult `content/tools/post-implementation-review.md` for specifics.
386
+ - **Invocation:** go through the wrapper (`scaffold run …`) or call `mmr review …` directly. Do NOT shell out to `codex`/`gemini`/`claude` yourself for these steps — MMR handles dispatch, parsing, compensating passes, and verdict.
387
+ - **Auth pre-flight:** run `mmr config test` once per session it probes all three CLIs and reports status in one call.
388
+ - **If auth fails** for any channel, surface recovery commands to the user: `! codex login`, `! gemini -p "hello"`, or `! claude login`. MMR will emit a compensating pass (via `claude -p`) for each missing external channel, labelled `[compensating: Codex-equivalent]` / `[compensating: Gemini-equivalent]`. Maximum achievable verdict in that case is `degraded-pass`.
389
+ - **Never silently skip a CLI due to auth failure** — surface it to the user.
390
+
391
+ #### Path B: Legacy / non-MMR direct dispatch
392
+
393
+ Applies to: some older depth-5 validation steps and any ad-hoc manual dispatch not routed through MMR. The `multi-model-dispatch` skill documents the raw invocation patterns:
394
+
395
+ - **Codex:** `codex exec --skip-git-repo-check -s read-only --ephemeral "prompt" 2>/dev/null` (NOT bare `codex`)
396
+ - **Gemini:** `NO_BROWSER=true gemini -p "prompt" --output-format json --approval-mode yolo 2>/dev/null`
397
+ - **Claude CLI:** `claude -p "prompt" --output-format json 2>/dev/null`
398
+
399
+ **`NO_BROWSER=true` is required for all Gemini invocations** from Claude Code's Bash tool. Without it, Gemini's child process relaunch shows a consent prompt that hangs in non-TTY shells.
355
400
 
356
- When running a review step at depth 4-5:
357
- 1. Check CLI availability before dispatching
358
- 2. If both available, run dual-model review for highest quality
359
- 3. If one available, run single-model external review
360
- 4. If neither available, fall back to Claude-only adversarial self-review
401
+ Auth pre-flight for Path B dispatch:
402
+ 1. Codex: `codex login status`
403
+ 2. Gemini: `NO_BROWSER=true gemini -p "respond with ok" -o json` (exit 41 = auth failure)
404
+ 3. Claude CLI: `claude -p "respond with ok"` (typically uses the active Claude Code session)
405
+ 4. If any fail: `! codex login`, `! gemini -p "hello"`, or `! claude login` (the `!` prefix runs it interactively with TTY access).
406
+ 5. **Never silently skip a CLI due to auth failure** — surface it to the user.
361
407
 
362
- The runner should surface the depth choice as a decision point for review steps, noting that depth 4-5 enables multi-model validation if CLIs are available.
408
+ The runner should surface the depth choice as a decision point for review steps, noting that depth 4-5 enables three-CLI multi-model validation when the CLIs are available.
363
409
 
364
410
  ## Batch Execution
365
411