@oxgeneral/orch 1.0.7 → 1.0.9

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 (79) hide show
  1. package/dist/App-Q6LOPAZT.js +22 -0
  2. package/dist/{agent-Q34L27AY.js → agent-SI4JF5MV.js} +1 -1
  3. package/dist/{agent-shop-D2RS4BZK.js → agent-shop-JHDTCWCD.js} +1 -1
  4. package/dist/chunk-3AXNSYCM.js +2 -0
  5. package/dist/{chunk-4TDXD3LA.js → chunk-5YSW77VI.js} +104 -21
  6. package/dist/chunk-5YSW77VI.js.map +1 -0
  7. package/dist/{chunk-BCPUTULS.js → chunk-HWEMBO36.js} +83 -54
  8. package/dist/chunk-J7ITYXE6.js +116 -0
  9. package/dist/chunk-J7ITYXE6.js.map +1 -0
  10. package/dist/chunk-U2JVMD2G.js +66 -0
  11. package/dist/chunk-U2JVMD2G.js.map +1 -0
  12. package/dist/{chunk-EH3HRQP4.js → chunk-W3J7CURM.js} +8 -116
  13. package/dist/chunk-W3J7CURM.js.map +1 -0
  14. package/dist/{chunk-UMZEA3JT.js → chunk-XLBV2PFL.js} +1 -1
  15. package/dist/chunk-ZMLF5HI5.js +11 -0
  16. package/dist/cli.js +1 -1
  17. package/dist/container-LV3WOPMS.js +4 -0
  18. package/dist/doctor-Q3GHJNZL.js +2 -0
  19. package/dist/index.d.ts +44 -1
  20. package/dist/index.js +12 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/init-D4356W7G.js +73 -0
  23. package/dist/orchestrator-PSXVHP2L.js +17 -0
  24. package/dist/orchestrator-WLWIAFXH.js +6 -0
  25. package/dist/{orchestrator-XPEMMBOO.js.map → orchestrator-WLWIAFXH.js.map} +1 -1
  26. package/dist/{org-WAK3CDPG.js → org-KLYK6MMJ.js} +1 -1
  27. package/dist/serve-4RT4HERL.js +3 -0
  28. package/dist/skill-loader-IGRIELEM.js +9 -0
  29. package/dist/skill-loader-RHCFIK74.js +4 -0
  30. package/dist/skill-loader-RHCFIK74.js.map +1 -0
  31. package/dist/{task-QFLIIRKZ.js → task-6Z5P7ODZ.js} +1 -1
  32. package/dist/tui-GH3Z5CO4.js +2 -0
  33. package/dist/{update-FFKCOV63.js → update-XGJZFV4H.js} +1 -1
  34. package/dist/{update-check-HGMBDYHL.js → update-check-CZJC7VW6.js} +1 -1
  35. package/dist/{workspace-manager-5EYCMAEO.js → workspace-manager-RH24FSNT.js} +4 -3
  36. package/dist/workspace-manager-RH24FSNT.js.map +1 -0
  37. package/dist/workspace-manager-VJ4FN5PJ.js +3 -0
  38. package/package.json +1 -1
  39. package/readme.md +2 -2
  40. package/skills/library/autoplan.md +315 -0
  41. package/skills/library/benchmark.md +242 -0
  42. package/skills/library/browse.md +266 -0
  43. package/skills/library/canary.md +248 -0
  44. package/skills/library/careful.md +42 -0
  45. package/skills/library/codex.md +431 -0
  46. package/skills/library/design-consultation.md +367 -0
  47. package/skills/library/design-review.md +744 -0
  48. package/skills/library/document-release.md +365 -0
  49. package/skills/library/freeze.md +60 -0
  50. package/skills/library/guard.md +55 -0
  51. package/skills/library/investigate.md +171 -0
  52. package/skills/library/land-and-deploy.md +636 -0
  53. package/skills/library/office-hours.md +746 -0
  54. package/skills/library/plan-ceo-review.md +1029 -0
  55. package/skills/library/plan-design-review.md +428 -0
  56. package/skills/library/plan-eng-review.md +420 -0
  57. package/skills/library/qa-only.md +388 -0
  58. package/skills/library/qa.md +766 -0
  59. package/skills/library/retro.md +532 -0
  60. package/skills/library/review.md +421 -0
  61. package/skills/library/setup-browser-cookies.md +86 -0
  62. package/skills/library/setup-deploy.md +211 -0
  63. package/skills/library/ship.md +1018 -0
  64. package/skills/library/unfreeze.md +31 -0
  65. package/skills/library/upgrade.md +220 -0
  66. package/skills/orch/SKILL.md +138 -0
  67. package/dist/App-LEVUTWQN.js +0 -22
  68. package/dist/chunk-4TDXD3LA.js.map +0 -1
  69. package/dist/chunk-EH3HRQP4.js.map +0 -1
  70. package/dist/chunk-WVJTXBPL.js +0 -11
  71. package/dist/container-FXUUV6PP.js +0 -4
  72. package/dist/doctor-P2J6VAUX.js +0 -2
  73. package/dist/init-PTAYCSMO.js +0 -53
  74. package/dist/orchestrator-JOTMB5XT.js +0 -13
  75. package/dist/orchestrator-XPEMMBOO.js +0 -6
  76. package/dist/serve-5OAANN6J.js +0 -3
  77. package/dist/tui-BJHZBCIR.js +0 -2
  78. package/dist/workspace-manager-5EYCMAEO.js.map +0 -1
  79. package/dist/workspace-manager-XKOZ5WM6.js +0 -3
@@ -0,0 +1,420 @@
1
+ ---
2
+ name: plan-eng-review
3
+ version: 1.0.0
4
+ description: |
5
+ Eng manager-mode plan review. Lock in the execution plan — architecture,
6
+ data flow, diagrams, edge cases, test coverage, performance. Walks through
7
+ issues interactively with opinionated recommendations. Use when asked to
8
+ "review the architecture", "engineering review", or "lock in the plan".
9
+ Proactively suggest when the user has a plan or design doc and is about to
10
+ start coding — to catch architecture issues before implementation.
11
+ benefits-from: [office-hours]
12
+ ---
13
+
14
+ ## Priority hierarchy
15
+ If you are running low on context or the user asks you to compress: Step 0 > Test diagram > Opinionated recommendations > Everything else. Never skip Step 0 or the test diagram.
16
+
17
+ ## My engineering preferences (use these to guide your recommendations):
18
+ * DRY is important—flag repetition aggressively.
19
+ * Well-tested code is non-negotiable; I'd rather have too many tests than too few.
20
+ * I want code that's "engineered enough" — not under-engineered (fragile, hacky) and not over-engineered (premature abstraction, unnecessary complexity).
21
+ * I err on the side of handling more edge cases, not fewer; thoughtfulness > speed.
22
+ * Bias toward explicit over clever.
23
+ * Minimal diff: achieve the goal with the fewest new abstractions and files touched.
24
+
25
+ ## Cognitive Patterns — How Great Eng Managers Think
26
+
27
+ These are not additional checklist items. They are the instincts that experienced engineering leaders develop over years — the pattern recognition that separates "reviewed the code" from "caught the landmine." Apply them throughout your review.
28
+
29
+ 1. **State diagnosis** — Teams exist in four states: falling behind, treading water, repaying debt, innovating. Each demands a different intervention (Larson, An Elegant Puzzle).
30
+ 2. **Blast radius instinct** — Every decision evaluated through "what's the worst case and how many systems/people does it affect?"
31
+ 3. **Boring by default** — "Every company gets about three innovation tokens." Everything else should be proven technology (McKinley, Choose Boring Technology).
32
+ 4. **Incremental over revolutionary** — Strangler fig, not big bang. Canary, not global rollout. Refactor, not rewrite (Fowler).
33
+ 5. **Systems over heroes** — Design for tired humans at 3am, not your best engineer on their best day.
34
+ 6. **Reversibility preference** — Feature flags, A/B tests, incremental rollouts. Make the cost of being wrong low.
35
+ 7. **Failure is information** — Blameless postmortems, error budgets, chaos engineering. Incidents are learning opportunities, not blame events (Allspaw, Google SRE).
36
+ 8. **Org structure IS architecture** — Conway's Law in practice. Design both intentionally (Skelton/Pais, Team Topologies).
37
+ 9. **DX is product quality** — Slow CI, bad local dev, painful deploys → worse software, higher attrition. Developer experience is a leading indicator.
38
+ 10. **Essential vs accidental complexity** — Before adding anything: "Is this solving a real problem or one we created?" (Brooks, No Silver Bullet).
39
+ 11. **Two-week smell test** — If a competent engineer can't ship a small feature in two weeks, you have an onboarding problem disguised as architecture.
40
+ 12. **Glue work awareness** — Recognize invisible coordination work. Value it, but don't let people get stuck doing only glue (Reilly, The Staff Engineer's Path).
41
+ 13. **Make the change easy, then make the easy change** — Refactor first, implement second. Never structural + behavioral changes simultaneously (Beck).
42
+ 14. **Own your code in production** — No wall between dev and ops. "The DevOps movement is ending because there are only engineers who write code and own it in production" (Majors).
43
+ 15. **Error budgets over uptime targets** — SLO of 99.9% = 0.1% downtime *budget to spend on shipping*. Reliability is resource allocation (Google SRE).
44
+
45
+ When evaluating architecture, think "boring by default." When reviewing tests, think "systems over heroes." When assessing complexity, ask Brooks's question. When a plan introduces new infrastructure, check whether it's spending an innovation token wisely.
46
+
47
+ ## Documentation and diagrams:
48
+ * I value ASCII art diagrams highly — for data flow, state machines, dependency graphs, processing pipelines, and decision trees. Use them liberally in plans and design docs.
49
+ * For particularly complex designs or behaviors, embed ASCII diagrams directly in code comments in the appropriate places: Models (data relationships, state transitions), Controllers (request flow), Concerns (mixin behavior), Services (processing pipelines), and Tests (what's being set up and why) when the test structure is non-obvious.
50
+ * **Diagram maintenance is part of the change.** When modifying code that has ASCII diagrams in comments nearby, review whether those diagrams are still accurate. Update them as part of the same commit. Stale diagrams are worse than no diagrams — they actively mislead. Flag any stale diagrams you encounter during review even if they're outside the immediate scope of the change.
51
+
52
+ ## BEFORE YOU START:
53
+
54
+ ### Design Doc Check
55
+ ```bash
56
+ SLUG=$(~/.claude/skills/orch/browse/bin/remote-slug 2>/dev/null || basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
57
+ BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-' || echo 'no-branch')
58
+ DESIGN=$(ls -t ~/.orch/projects/$SLUG/*-$BRANCH-design-*.md 2>/dev/null | head -1)
59
+ [ -z "$DESIGN" ] && DESIGN=$(ls -t ~/.orch/projects/$SLUG/*-design-*.md 2>/dev/null | head -1)
60
+ [ -n "$DESIGN" ] && echo "Design doc found: $DESIGN" || echo "No design doc found"
61
+ ```
62
+ If a design doc exists, read it. Use it as the source of truth for the problem statement, constraints, and chosen approach. If it has a `Supersedes:` field, note that this is a revised design — check the prior version for context on what changed and why.
63
+
64
+ ## Prerequisite Skill Offer
65
+
66
+ When the design doc check above prints "No design doc found," offer the prerequisite
67
+ skill before proceeding.
68
+
69
+ Say to the user via AskUserQuestion:
70
+
71
+ > "No design doc found for this branch. `/office-hours` produces a structured problem
72
+ > statement, premise challenge, and explored alternatives — it gives this review much
73
+ > sharper input to work with. Takes about 10 minutes. The design doc is per-feature,
74
+ > not per-product — it captures the thinking behind this specific change."
75
+
76
+ Options:
77
+ - A) Run /office-hours first (in another window, then come back)
78
+ - B) Skip — proceed with standard review
79
+
80
+ If they skip: "No worries — standard review. If you ever want sharper input, try
81
+ /office-hours first next time." Then proceed normally. Do not re-offer later in the session.
82
+
83
+ ### Step 0: Scope Challenge
84
+ Before reviewing anything, answer these questions:
85
+ 1. **What existing code already partially or fully solves each sub-problem?** Can we capture outputs from existing flows rather than building parallel ones?
86
+ 2. **What is the minimum set of changes that achieves the stated goal?** Flag any work that could be deferred without blocking the core objective. Be ruthless about scope creep.
87
+ 3. **Complexity check:** If the plan touches more than 8 files or introduces more than 2 new classes/services, treat that as a smell and challenge whether the same goal can be achieved with fewer moving parts.
88
+ 4. **Search check:** For each architectural pattern, infrastructure component, or concurrency approach the plan introduces:
89
+ - Does the runtime/framework have a built-in? Search: "{framework} {pattern} built-in"
90
+ - Is the chosen approach current best practice? Search: "{pattern} best practice {current year}"
91
+ - Are there known footguns? Search: "{framework} {pattern} pitfalls"
92
+
93
+ If WebSearch is unavailable, skip this check and note: "Search unavailable — proceeding with in-distribution knowledge only."
94
+
95
+ If the plan rolls a custom solution where a built-in exists, flag it as a scope reduction opportunity. Annotate recommendations with **[Layer 1]**, **[Layer 2]**, **[Layer 3]**, or **[EUREKA]** (see preamble's Search Before Building section). If you find a eureka moment — a reason the standard approach is wrong for this case — present it as an architectural insight.
96
+ 5. **TODOS cross-reference:** Read `TODOS.md` if it exists. Are any deferred items blocking this plan? Can any deferred items be bundled into this PR without expanding scope? Does this plan create new work that should be captured as a TODO?
97
+
98
+ 5. **Completeness check:** Is the plan doing the complete version or a shortcut? With AI-assisted coding, the cost of completeness (100% test coverage, full edge case handling, complete error paths) is 10-100x cheaper than with a human team. If the plan proposes a shortcut that saves human-hours but only saves minutes with CC+orch, recommend the complete version. Boil the lake.
99
+
100
+ If the complexity check triggers (8+ files or 2+ new classes/services), proactively recommend scope reduction via AskUserQuestion — explain what's overbuilt, propose a minimal version that achieves the core goal, and ask whether to reduce or proceed as-is. If the complexity check does not trigger, present your Step 0 findings and proceed directly to Section 1.
101
+
102
+ ### Step 0.5: Codex plan review (optional)
103
+
104
+ Check if the Codex CLI is available: `which codex 2>/dev/null`
105
+
106
+ If available, after presenting Step 0 findings, use AskUserQuestion:
107
+ ```
108
+ Want an independent Codex (OpenAI) review of this plan before the detailed review?
109
+ A) Yes — let Codex critique the plan independently
110
+ B) No — proceed with the Claude review only
111
+ ```
112
+
113
+ If the user chooses A: tell Codex to read the plan file itself (avoids ARG_MAX limits for large plans):
114
+ ```bash
115
+ codex exec "You are a brutally honest technical reviewer. Read the plan file at <plan-file-path> and review it for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems." -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached
116
+ ```
117
+
118
+ Replace `<plan-file-path>` with the actual path to the plan file detected earlier. Codex has filesystem access in read-only mode and will read the file itself.
119
+
120
+ Present the full output under a `CODEX SAYS (plan review):` header. Note any concerns
121
+ that should inform the subsequent engineering review sections.
122
+
123
+ If Codex is not available, skip silently.
124
+
125
+ Always work through the full interactive review: one section at a time (Architecture → Code Quality → Tests → Performance) with at most 8 top issues per section.
126
+
127
+ **Critical: Once the user accepts or rejects a scope reduction recommendation, commit fully.** Do not re-argue for smaller scope during later review sections. Do not silently reduce scope or skip planned components.
128
+
129
+ ## Review Sections (after scope is agreed)
130
+
131
+ ### 1. Architecture review
132
+ Evaluate:
133
+ * Overall system design and component boundaries.
134
+ * Dependency graph and coupling concerns.
135
+ * Data flow patterns and potential bottlenecks.
136
+ * Scaling characteristics and single points of failure.
137
+ * Security architecture (auth, data access, API boundaries).
138
+ * Whether key flows deserve ASCII diagrams in the plan or in code comments.
139
+ * For each new codepath or integration point, describe one realistic production failure scenario and whether the plan accounts for it.
140
+
141
+ **STOP.** For each issue found in this section, call AskUserQuestion individually. One issue per call. Present options, state your recommendation, explain WHY. Do NOT batch multiple issues into one AskUserQuestion. Only proceed to the next section after ALL issues in this section are resolved.
142
+
143
+ ### 2. Code quality review
144
+ Evaluate:
145
+ * Code organization and module structure.
146
+ * DRY violations—be aggressive here.
147
+ * Error handling patterns and missing edge cases (call these out explicitly).
148
+ * Technical debt hotspots.
149
+ * Areas that are over-engineered or under-engineered relative to my preferences.
150
+ * Existing ASCII diagrams in touched files — are they still accurate after this change?
151
+
152
+ **STOP.** For each issue found in this section, call AskUserQuestion individually. One issue per call. Present options, state your recommendation, explain WHY. Do NOT batch multiple issues into one AskUserQuestion. Only proceed to the next section after ALL issues in this section are resolved.
153
+
154
+ ### 3. Test review
155
+ Make a diagram of all new UX, new data flow, new codepaths, and new branching if statements or outcomes. For each, note what is new about the features discussed in this branch and plan. Then, for each new item in the diagram, make sure there is a corresponding test.
156
+
157
+ For LLM/prompt changes: check the "Prompt/LLM changes" file patterns listed in CLAUDE.md. If this plan touches ANY of those patterns, state which eval suites must be run, which cases should be added, and what baselines to compare against. Then use AskUserQuestion to confirm the eval scope with the user.
158
+
159
+ **STOP.** For each issue found in this section, call AskUserQuestion individually. One issue per call. Present options, state your recommendation, explain WHY. Do NOT batch multiple issues into one AskUserQuestion. Only proceed to the next section after ALL issues in this section are resolved.
160
+
161
+ ### Test Plan Artifact
162
+
163
+ After producing the test diagram, write a test plan artifact to the project directory so `/qa` and `/qa-only` can consume it as primary test input (replacing the lossy git-diff heuristic):
164
+
165
+ ```bash
166
+ source <(~/.claude/skills/orch/bin/orch-slug 2>/dev/null) && mkdir -p ~/.orch/projects/$SLUG
167
+ USER=$(whoami)
168
+ DATETIME=$(date +%Y%m%d-%H%M%S)
169
+ ```
170
+
171
+ Write to `~/.orch/projects/{slug}/{user}-{branch}-test-plan-{datetime}.md`:
172
+
173
+ ```markdown
174
+ # Test Plan
175
+ Generated by /plan-eng-review on {date}
176
+ Branch: {branch}
177
+ Repo: {owner/repo}
178
+
179
+ ## Affected Pages/Routes
180
+ - {URL path} — {what to test and why}
181
+
182
+ ## Key Interactions to Verify
183
+ - {interaction description} on {page}
184
+
185
+ ## Edge Cases
186
+ - {edge case} on {page}
187
+
188
+ ## Critical Paths
189
+ - {end-to-end flow that must work}
190
+ ```
191
+
192
+ This file is consumed by `/qa` and `/qa-only` as primary test input. Include only the information that helps a QA tester know **what to test and where** — not implementation details.
193
+
194
+ ### 4. Performance review
195
+ Evaluate:
196
+ * N+1 queries and database access patterns.
197
+ * Memory-usage concerns.
198
+ * Caching opportunities.
199
+ * Slow or high-complexity code paths.
200
+
201
+ **STOP.** For each issue found in this section, call AskUserQuestion individually. One issue per call. Present options, state your recommendation, explain WHY. Do NOT batch multiple issues into one AskUserQuestion. Only proceed to the next section after ALL issues in this section are resolved.
202
+
203
+ ## CRITICAL RULE — How to ask questions
204
+ Follow the AskUserQuestion format from the Preamble above. Additional rules for plan reviews:
205
+ * **One issue = one AskUserQuestion call.** Never combine multiple issues into one question.
206
+ * Describe the problem concretely, with file and line references.
207
+ * Present 2-3 options, including "do nothing" where that's reasonable.
208
+ * For each option, specify in one line: effort (human: ~X / CC: ~Y), risk, and maintenance burden. If the complete option is only marginally more effort than the shortcut with CC, recommend the complete option.
209
+ * **Map the reasoning to my engineering preferences above.** One sentence connecting your recommendation to a specific preference (DRY, explicit > clever, minimal diff, etc.).
210
+ * Label with issue NUMBER + option LETTER (e.g., "3A", "3B").
211
+ * **Escape hatch:** If a section has no issues, say so and move on. If an issue has an obvious fix with no real alternatives, state what you'll do and move on — don't waste a question on it. Only use AskUserQuestion when there is a genuine decision with meaningful tradeoffs.
212
+
213
+ ## Required outputs
214
+
215
+ ### "NOT in scope" section
216
+ Every plan review MUST produce a "NOT in scope" section listing work that was considered and explicitly deferred, with a one-line rationale for each item.
217
+
218
+ ### "What already exists" section
219
+ List existing code/flows that already partially solve sub-problems in this plan, and whether the plan reuses them or unnecessarily rebuilds them.
220
+
221
+ ### TODOS.md updates
222
+ After all review sections are complete, present each potential TODO as its own individual AskUserQuestion. Never batch TODOs — one per question. Never silently skip this step. Follow the format in `.claude/skills/review/TODOS-format.md`.
223
+
224
+ For each TODO, describe:
225
+ * **What:** One-line description of the work.
226
+ * **Why:** The concrete problem it solves or value it unlocks.
227
+ * **Pros:** What you gain by doing this work.
228
+ * **Cons:** Cost, complexity, or risks of doing it.
229
+ * **Context:** Enough detail that someone picking this up in 3 months understands the motivation, the current state, and where to start.
230
+ * **Depends on / blocked by:** Any prerequisites or ordering constraints.
231
+
232
+ Then present options: **A)** Add to TODOS.md **B)** Skip — not valuable enough **C)** Build it now in this PR instead of deferring.
233
+
234
+ Do NOT just append vague bullet points. A TODO without context is worse than no TODO — it creates false confidence that the idea was captured while actually losing the reasoning.
235
+
236
+ ### Diagrams
237
+ The plan itself should use ASCII diagrams for any non-trivial data flow, state machine, or processing pipeline. Additionally, identify which files in the implementation should get inline ASCII diagram comments — particularly Models with complex state transitions, Services with multi-step pipelines, and Concerns with non-obvious mixin behavior.
238
+
239
+ ### Failure modes
240
+ For each new codepath identified in the test review diagram, list one realistic way it could fail in production (timeout, nil reference, race condition, stale data, etc.) and whether:
241
+ 1. A test covers that failure
242
+ 2. Error handling exists for it
243
+ 3. The user would see a clear error or a silent failure
244
+
245
+ If any failure mode has no test AND no error handling AND would be silent, flag it as a **critical gap**.
246
+
247
+ ### Completion summary
248
+ At the end of the review, fill in and display this summary so the user can see all findings at a glance:
249
+ - Step 0: Scope Challenge — ___ (scope accepted as-is / scope reduced per recommendation)
250
+ - Architecture Review: ___ issues found
251
+ - Code Quality Review: ___ issues found
252
+ - Test Review: diagram produced, ___ gaps identified
253
+ - Performance Review: ___ issues found
254
+ - NOT in scope: written
255
+ - What already exists: written
256
+ - TODOS.md updates: ___ items proposed to user
257
+ - Failure modes: ___ critical gaps flagged
258
+ - Lake Score: X/Y recommendations chose complete option
259
+
260
+ ## Retrospective learning
261
+ Check the git log for this branch. If there are prior commits suggesting a previous review cycle (e.g., review-driven refactors, reverted changes), note what was changed and whether the current plan touches the same areas. Be more aggressive reviewing areas that were previously problematic.
262
+
263
+ ## Formatting rules
264
+ * NUMBER issues (1, 2, 3...) and LETTERS for options (A, B, C...).
265
+ * Label with NUMBER + LETTER (e.g., "3A", "3B").
266
+ * One sentence max per option. Pick in under 5 seconds.
267
+ * After each review section, pause and ask for feedback before moving on.
268
+
269
+ ## Review Log
270
+
271
+ After producing the Completion Summary above, persist the review result.
272
+
273
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This command writes review metadata to
274
+ `~/.orch/` (user config directory, not project files). The skill preamble
275
+ already writes to `~/.orch/sessions/` and `~/.orch/analytics/` — this is
276
+ the same pattern. The review dashboard depends on this data. Skipping this
277
+ command breaks the review readiness dashboard in /ship.
278
+
279
+ ```bash
280
+ ~/.claude/skills/orch/bin/orch-review-log '{"skill":"plan-eng-review","timestamp":"TIMESTAMP","status":"STATUS","unresolved":N,"critical_gaps":N,"issues_found":N,"mode":"MODE","commit":"COMMIT"}'
281
+ ```
282
+
283
+ Substitute values from the Completion Summary:
284
+ - **TIMESTAMP**: current ISO 8601 datetime
285
+ - **STATUS**: "clean" if 0 unresolved decisions AND 0 critical gaps; otherwise "issues_open"
286
+ - **unresolved**: number from "Unresolved decisions" count
287
+ - **critical_gaps**: number from "Failure modes: ___ critical gaps flagged"
288
+ - **issues_found**: total issues found across all review sections (Architecture + Code Quality + Performance + Test gaps)
289
+ - **MODE**: FULL_REVIEW / SCOPE_REDUCED
290
+ - **COMMIT**: output of `git rev-parse --short HEAD`
291
+
292
+ ## Review Readiness Dashboard
293
+
294
+ After completing the review, read the review log and config to display the dashboard.
295
+
296
+ ```bash
297
+ ~/.claude/skills/orch/bin/orch-review-read
298
+ ```
299
+
300
+ Parse the output. Find the most recent entry for each skill (plan-ceo-review, plan-eng-review, plan-design-review, design-review-lite, adversarial-review, codex-review). Ignore entries with timestamps older than 7 days. For the Adversarial row, show whichever is more recent between `adversarial-review` (new auto-scaled) and `codex-review` (legacy). For Design Review, show whichever is more recent between `plan-design-review` (full visual audit) and `design-review-lite` (code-level check). Append "(FULL)" or "(LITE)" to the status to distinguish. Display:
301
+
302
+ ```
303
+ +====================================================================+
304
+ | REVIEW READINESS DASHBOARD |
305
+ +====================================================================+
306
+ | Review | Runs | Last Run | Status | Required |
307
+ |-----------------|------|---------------------|-----------|----------|
308
+ | Eng Review | 1 | 2026-03-16 15:00 | CLEAR | YES |
309
+ | CEO Review | 0 | — | — | no |
310
+ | Design Review | 0 | — | — | no |
311
+ | Adversarial | 0 | — | — | no |
312
+ +--------------------------------------------------------------------+
313
+ | VERDICT: CLEARED — Eng Review passed |
314
+ +====================================================================+
315
+ ```
316
+
317
+ **Review tiers:**
318
+ - **Eng Review (required by default):** The only review that gates shipping. Covers architecture, code quality, tests, performance. Can be disabled globally with \`orch-config set skip_eng_review true\` (the "don't bother me" setting).
319
+ - **CEO Review (optional):** Use your judgment. Recommend it for big product/business changes, new user-facing features, or scope decisions. Skip for bug fixes, refactors, infra, and cleanup.
320
+ - **Design Review (optional):** Use your judgment. Recommend it for UI/UX changes. Skip for backend-only, infra, or prompt-only changes.
321
+ - **Adversarial Review (automatic):** Auto-scales by diff size. Small diffs (<50 lines) skip adversarial. Medium diffs (50–199) get cross-model adversarial. Large diffs (200+) get all 4 passes: Claude structured, Codex structured, Claude adversarial subagent, Codex adversarial. No configuration needed.
322
+
323
+ **Verdict logic:**
324
+ - **CLEARED**: Eng Review has >= 1 entry within 7 days with status "clean" (or \`skip_eng_review\` is \`true\`)
325
+ - **NOT CLEARED**: Eng Review missing, stale (>7 days), or has open issues
326
+ - CEO, Design, and Codex reviews are shown for context but never block shipping
327
+ - If \`skip_eng_review\` config is \`true\`, Eng Review shows "SKIPPED (global)" and verdict is CLEARED
328
+
329
+ **Staleness detection:** After displaying the dashboard, check if any existing reviews may be stale:
330
+ - Parse the \`---HEAD---\` section from the bash output to get the current HEAD commit hash
331
+ - For each review entry that has a \`commit\` field: compare it against the current HEAD. If different, count elapsed commits: \`git rev-list --count STORED_COMMIT..HEAD\`. Display: "Note: {skill} review from {date} may be stale — {N} commits since review"
332
+ - For entries without a \`commit\` field (legacy entries): display "Note: {skill} review from {date} has no commit tracking — consider re-running for accurate staleness detection"
333
+ - If all reviews match the current HEAD, do not display any staleness notes
334
+
335
+ ## Plan File Review Report
336
+
337
+ After displaying the Review Readiness Dashboard in conversation output, also update the
338
+ **plan file** itself so review status is visible to anyone reading the plan.
339
+
340
+ ### Detect the plan file
341
+
342
+ 1. Check if there is an active plan file in this conversation (the host provides plan file
343
+ paths in system messages — look for plan file references in the conversation context).
344
+ 2. If not found, skip this section silently — not every review runs in plan mode.
345
+
346
+ ### Generate the report
347
+
348
+ Read the review log output you already have from the Review Readiness Dashboard step above.
349
+ Parse each JSONL entry. Each skill logs different fields:
350
+
351
+ - **plan-ceo-review**: \`status\`, \`unresolved\`, \`critical_gaps\`, \`mode\`, \`scope_proposed\`, \`scope_accepted\`, \`scope_deferred\`, \`commit\`
352
+ → Findings: "{scope_proposed} proposals, {scope_accepted} accepted, {scope_deferred} deferred"
353
+ → If scope fields are 0 or missing (HOLD/REDUCTION mode): "mode: {mode}, {critical_gaps} critical gaps"
354
+ - **plan-eng-review**: \`status\`, \`unresolved\`, \`critical_gaps\`, \`issues_found\`, \`mode\`, \`commit\`
355
+ → Findings: "{issues_found} issues, {critical_gaps} critical gaps"
356
+ - **plan-design-review**: \`status\`, \`initial_score\`, \`overall_score\`, \`unresolved\`, \`decisions_made\`, \`commit\`
357
+ → Findings: "score: {initial_score}/10 → {overall_score}/10, {decisions_made} decisions"
358
+ - **codex-review**: \`status\`, \`gate\`, \`findings\`, \`findings_fixed\`
359
+ → Findings: "{findings} findings, {findings_fixed}/{findings} fixed"
360
+
361
+ All fields needed for the Findings column are now present in the JSONL entries.
362
+ For the review you just completed, you may use richer details from your own Completion
363
+ Summary. For prior reviews, use the JSONL fields directly — they contain all required data.
364
+
365
+ Produce this markdown table:
366
+
367
+ \`\`\`markdown
368
+ ## ORCH REVIEW REPORT
369
+
370
+ | Review | Trigger | Why | Runs | Status | Findings |
371
+ |--------|---------|-----|------|--------|----------|
372
+ | CEO Review | \`/plan-ceo-review\` | Scope & strategy | {runs} | {status} | {findings} |
373
+ | Codex Review | \`/codex review\` | Independent 2nd opinion | {runs} | {status} | {findings} |
374
+ | Eng Review | \`/plan-eng-review\` | Architecture & tests (required) | {runs} | {status} | {findings} |
375
+ | Design Review | \`/plan-design-review\` | UI/UX gaps | {runs} | {status} | {findings} |
376
+ \`\`\`
377
+
378
+ Below the table, add these lines (omit any that are empty/not applicable):
379
+
380
+ - **CODEX:** (only if codex-review ran) — one-line summary of codex fixes
381
+ - **CROSS-MODEL:** (only if both Claude and Codex reviews exist) — overlap analysis
382
+ - **UNRESOLVED:** total unresolved decisions across all reviews
383
+ - **VERDICT:** list reviews that are CLEAR (e.g., "CEO + ENG CLEARED — ready to implement").
384
+ If Eng Review is not CLEAR and not skipped globally, append "eng review required".
385
+
386
+ ### Write to the plan file
387
+
388
+ **PLAN MODE EXCEPTION — ALWAYS RUN:** This writes to the plan file, which is the one
389
+ file you are allowed to edit in plan mode. The plan file review report is part of the
390
+ plan's living status.
391
+
392
+ - Search the plan file for a \`## ORCH REVIEW REPORT\` section **anywhere** in the file
393
+ (not just at the end — content may have been added after it).
394
+ - If found, **replace it** entirely using the Edit tool. Match from \`## ORCH REVIEW REPORT\`
395
+ through either the next \`## \` heading or end of file, whichever comes first. This ensures
396
+ content added after the report section is preserved, not eaten. If the Edit fails
397
+ (e.g., concurrent edit changed the content), re-read the plan file and retry once.
398
+ - If no such section exists, **append it** to the end of the plan file.
399
+ - Always place it as the very last section in the plan file. If it was found mid-file,
400
+ move it: delete the old location and append at the end.
401
+
402
+ ## Next Steps — Review Chaining
403
+
404
+ After displaying the Review Readiness Dashboard, check if additional reviews would be valuable. Read the dashboard output to see which reviews have already been run and whether they are stale.
405
+
406
+ **Suggest /plan-design-review if UI changes exist and no design review has been run** — detect from the test diagram, architecture review, or any section that touched frontend components, CSS, views, or user-facing interaction flows. If an existing design review's commit hash shows it predates significant changes found in this eng review, note that it may be stale.
407
+
408
+ **Mention /plan-ceo-review if this is a significant product change and no CEO review exists** — this is a soft suggestion, not a push. CEO review is optional. Only mention it if the plan introduces new user-facing features, changes product direction, or expands scope substantially.
409
+
410
+ **Note staleness** of existing CEO or design reviews if this eng review found assumptions that contradict them, or if the commit hash shows significant drift.
411
+
412
+ **If no additional reviews are needed** (or `skip_eng_review` is `true` in the dashboard config, meaning this eng review was optional): state "All relevant reviews complete. Run /ship when ready."
413
+
414
+ Use AskUserQuestion with only the applicable options:
415
+ - **A)** Run /plan-design-review (only if UI scope detected and no design review exists)
416
+ - **B)** Run /plan-ceo-review (only if significant product change and no CEO review exists)
417
+ - **C)** Ready to implement — run /ship when done
418
+
419
+ ## Unresolved decisions
420
+ If the user does not respond to an AskUserQuestion or interrupts to move on, note which decisions were left unresolved. At the end of the review, list these as "Unresolved decisions that may bite you later" — never silently default to an option.