@oxgeneral/orch 1.0.7 → 1.0.8

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 (70) hide show
  1. package/dist/{App-LEVUTWQN.js → App-5OVBVRCD.js} +1 -1
  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-BCPUTULS.js → chunk-HWEMBO36.js} +83 -54
  6. package/dist/chunk-J7ITYXE6.js +116 -0
  7. package/dist/chunk-J7ITYXE6.js.map +1 -0
  8. package/dist/{chunk-4TDXD3LA.js → chunk-SWNSNPBO.js} +12 -2
  9. package/dist/chunk-SWNSNPBO.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-ZMLF5HI5.js +11 -0
  15. package/dist/cli.js +1 -1
  16. package/dist/container-SEIWOLHY.js +4 -0
  17. package/dist/doctor-Q3GHJNZL.js +2 -0
  18. package/dist/index.d.ts +32 -1
  19. package/dist/index.js +12 -5
  20. package/dist/index.js.map +1 -1
  21. package/dist/init-D4356W7G.js +73 -0
  22. package/dist/orchestrator-G3Y7THMG.js +6 -0
  23. package/dist/{orchestrator-XPEMMBOO.js.map → orchestrator-G3Y7THMG.js.map} +1 -1
  24. package/dist/{orchestrator-JOTMB5XT.js → orchestrator-GQLNLOXB.js} +8 -4
  25. package/dist/{org-WAK3CDPG.js → org-KLYK6MMJ.js} +1 -1
  26. package/dist/skill-loader-IGRIELEM.js +9 -0
  27. package/dist/skill-loader-RHCFIK74.js +4 -0
  28. package/dist/skill-loader-RHCFIK74.js.map +1 -0
  29. package/dist/{task-QFLIIRKZ.js → task-3R2IX4HM.js} +1 -1
  30. package/dist/{tui-BJHZBCIR.js → tui-47O2OCKC.js} +1 -1
  31. package/dist/{workspace-manager-5EYCMAEO.js → workspace-manager-RH24FSNT.js} +4 -3
  32. package/dist/workspace-manager-RH24FSNT.js.map +1 -0
  33. package/dist/workspace-manager-VJ4FN5PJ.js +3 -0
  34. package/package.json +1 -1
  35. package/skills/library/autoplan.md +315 -0
  36. package/skills/library/benchmark.md +242 -0
  37. package/skills/library/browse.md +266 -0
  38. package/skills/library/canary.md +248 -0
  39. package/skills/library/careful.md +42 -0
  40. package/skills/library/codex.md +431 -0
  41. package/skills/library/design-consultation.md +367 -0
  42. package/skills/library/design-review.md +744 -0
  43. package/skills/library/document-release.md +365 -0
  44. package/skills/library/freeze.md +60 -0
  45. package/skills/library/guard.md +55 -0
  46. package/skills/library/investigate.md +171 -0
  47. package/skills/library/land-and-deploy.md +636 -0
  48. package/skills/library/office-hours.md +746 -0
  49. package/skills/library/plan-ceo-review.md +1029 -0
  50. package/skills/library/plan-design-review.md +428 -0
  51. package/skills/library/plan-eng-review.md +420 -0
  52. package/skills/library/qa-only.md +388 -0
  53. package/skills/library/qa.md +766 -0
  54. package/skills/library/retro.md +532 -0
  55. package/skills/library/review.md +421 -0
  56. package/skills/library/setup-browser-cookies.md +86 -0
  57. package/skills/library/setup-deploy.md +211 -0
  58. package/skills/library/ship.md +1018 -0
  59. package/skills/library/unfreeze.md +31 -0
  60. package/skills/library/upgrade.md +220 -0
  61. package/skills/orch/SKILL.md +138 -0
  62. package/dist/chunk-4TDXD3LA.js.map +0 -1
  63. package/dist/chunk-EH3HRQP4.js.map +0 -1
  64. package/dist/chunk-WVJTXBPL.js +0 -11
  65. package/dist/container-FXUUV6PP.js +0 -4
  66. package/dist/doctor-P2J6VAUX.js +0 -2
  67. package/dist/init-PTAYCSMO.js +0 -53
  68. package/dist/orchestrator-XPEMMBOO.js +0 -6
  69. package/dist/workspace-manager-5EYCMAEO.js.map +0 -1
  70. package/dist/workspace-manager-XKOZ5WM6.js +0 -3
@@ -0,0 +1,421 @@
1
+ ---
2
+ name: review
3
+ version: 1.0.0
4
+ description: |
5
+ Pre-landing PR review. Analyzes diff against the base branch for SQL safety, LLM trust
6
+ boundary violations, conditional side effects, and other structural issues. Use when
7
+ asked to "review this PR", "code review", "pre-landing review", or "check my diff".
8
+ Proactively suggest when the user is about to merge or land code changes.
9
+ ---
10
+
11
+ ## Step 0: Detect base branch
12
+
13
+ Determine which branch this PR targets. Use the result as "the base branch" in all subsequent steps.
14
+
15
+ 1. Check if a PR already exists for this branch:
16
+ `gh pr view --json baseRefName -q .baseRefName`
17
+ If this succeeds, use the printed branch name as the base branch.
18
+
19
+ 2. If no PR exists (command fails), detect the repo's default branch:
20
+ `gh repo view --json defaultBranchRef -q .defaultBranchRef.name`
21
+
22
+ 3. If both commands fail, fall back to `main`.
23
+
24
+ Print the detected base branch name. In every subsequent `git diff`, `git log`,
25
+ `git fetch`, `git merge`, and `gh pr create` command, substitute the detected
26
+ branch name wherever the instructions say "the base branch."
27
+
28
+ ---
29
+
30
+ # Pre-Landing PR Review
31
+
32
+ You are running the `/review` workflow. Analyze the current branch's diff against the base branch for structural issues that tests don't catch.
33
+
34
+ ---
35
+
36
+ ## Step 1: Check branch
37
+
38
+ 1. Run `git branch --show-current` to get the current branch.
39
+ 2. If on the base branch, output: **"Nothing to review — you're on the base branch or have no changes against it."** and stop.
40
+ 3. Run `git fetch origin <base> --quiet && git diff origin/<base> --stat` to check if there's a diff. If no diff, output the same message and stop.
41
+
42
+ ---
43
+
44
+ ## Step 1.5: Scope Drift Detection
45
+
46
+ Before reviewing code quality, check: **did they build what was requested — nothing more, nothing less?**
47
+
48
+ 1. Read `TODOS.md` (if it exists). Read PR description (`gh pr view --json body --jq .body 2>/dev/null || true`).
49
+ Read commit messages (`git log origin/<base>..HEAD --oneline`).
50
+ **If no PR exists:** rely on commit messages and TODOS.md for stated intent — this is the common case since /review runs before /ship creates the PR.
51
+ 2. Identify the **stated intent** — what was this branch supposed to accomplish?
52
+ 3. Run `git diff origin/<base> --stat` and compare the files changed against the stated intent.
53
+ 4. Evaluate with skepticism:
54
+
55
+ **SCOPE CREEP detection:**
56
+ - Files changed that are unrelated to the stated intent
57
+ - New features or refactors not mentioned in the plan
58
+ - "While I was in there..." changes that expand blast radius
59
+
60
+ **MISSING REQUIREMENTS detection:**
61
+ - Requirements from TODOS.md/PR description not addressed in the diff
62
+ - Test coverage gaps for stated requirements
63
+ - Partial implementations (started but not finished)
64
+
65
+ 5. Output (before the main review begins):
66
+ ```
67
+ Scope Check: [CLEAN / DRIFT DETECTED / REQUIREMENTS MISSING]
68
+ Intent: <1-line summary of what was requested>
69
+ Delivered: <1-line summary of what the diff actually does>
70
+ [If drift: list each out-of-scope change]
71
+ [If missing: list each unaddressed requirement]
72
+ ```
73
+
74
+ 6. This is **INFORMATIONAL** — does not block the review. Proceed to Step 2.
75
+
76
+ ---
77
+
78
+ ## Step 2: Read the checklist
79
+
80
+ Read `.claude/skills/review/checklist.md`.
81
+
82
+ **If the file cannot be read, STOP and report the error.** Do not proceed without the checklist.
83
+
84
+ ---
85
+
86
+ ## Step 2.5: Check for Greptile review comments
87
+
88
+ Read `.claude/skills/review/greptile-triage.md` and follow the fetch, filter, classify, and **escalation detection** steps.
89
+
90
+ **If no PR exists, `gh` fails, API returns an error, or there are zero Greptile comments:** Skip this step silently. Greptile integration is additive — the review works without it.
91
+
92
+ **If Greptile comments are found:** Store the classifications (VALID & ACTIONABLE, VALID BUT ALREADY FIXED, FALSE POSITIVE, SUPPRESSED) — you will need them in Step 5.
93
+
94
+ ---
95
+
96
+ ## Step 3: Get the diff
97
+
98
+ Fetch the latest base branch to avoid false positives from stale local state:
99
+
100
+ ```bash
101
+ git fetch origin <base> --quiet
102
+ ```
103
+
104
+ Run `git diff origin/<base>` to get the full diff. This includes both committed and uncommitted changes against the latest base branch.
105
+
106
+ ---
107
+
108
+ ## Step 4: Two-pass review
109
+
110
+ Apply the checklist against the diff in two passes:
111
+
112
+ 1. **Pass 1 (CRITICAL):** SQL & Data Safety, Race Conditions & Concurrency, LLM Output Trust Boundary, Enum & Value Completeness
113
+ 2. **Pass 2 (INFORMATIONAL):** Conditional Side Effects, Magic Numbers & String Coupling, Dead Code & Consistency, LLM Prompt Issues, Test Gaps, View/Frontend, Performance & Bundle Impact
114
+
115
+ **Enum & Value Completeness requires reading code OUTSIDE the diff.** When the diff introduces a new enum value, status, tier, or type constant, use Grep to find all files that reference sibling values, then Read those files to check if the new value is handled. This is the one category where within-diff review is insufficient.
116
+
117
+ **Search-before-recommending:** When recommending a fix pattern (especially for concurrency, caching, auth, or framework-specific behavior):
118
+ - Verify the pattern is current best practice for the framework version in use
119
+ - Check if a built-in solution exists in newer versions before recommending a workaround
120
+ - Verify API signatures against current docs (APIs change between versions)
121
+
122
+ Takes seconds, prevents recommending outdated patterns. If WebSearch is unavailable, note it and proceed with in-distribution knowledge.
123
+
124
+ Follow the output format specified in the checklist. Respect the suppressions — do NOT flag items listed in the "DO NOT flag" section.
125
+
126
+ ---
127
+
128
+ ## Step 4.5: Design Review (conditional)
129
+
130
+ ## Design Review (conditional, diff-scoped)
131
+
132
+ Check if the diff touches frontend files using `orch-diff-scope`:
133
+
134
+ ```bash
135
+ source <(~/.claude/skills/orch/bin/orch-diff-scope <base> 2>/dev/null)
136
+ ```
137
+
138
+ **If `SCOPE_FRONTEND=false`:** Skip design review silently. No output.
139
+
140
+ **If `SCOPE_FRONTEND=true`:**
141
+
142
+ 1. **Check for DESIGN.md.** If `DESIGN.md` or `design-system.md` exists in the repo root, read it. All design findings are calibrated against it — patterns blessed in DESIGN.md are not flagged. If not found, use universal design principles.
143
+
144
+ 2. **Read `.claude/skills/review/design-checklist.md`.** If the file cannot be read, skip design review with a note: "Design checklist not found — skipping design review."
145
+
146
+ 3. **Read each changed frontend file** (full file, not just diff hunks). Frontend files are identified by the patterns listed in the checklist.
147
+
148
+ 4. **Apply the design checklist** against the changed files. For each item:
149
+ - **[HIGH] mechanical CSS fix** (`outline: none`, `!important`, `font-size < 16px`): classify as AUTO-FIX
150
+ - **[HIGH/MEDIUM] design judgment needed**: classify as ASK
151
+ - **[LOW] intent-based detection**: present as "Possible — verify visually or run /design-review"
152
+
153
+ 5. **Include findings** in the review output under a "Design Review" header, following the output format in the checklist. Design findings merge with code review findings into the same Fix-First flow.
154
+
155
+ 6. **Log the result** for the Review Readiness Dashboard:
156
+
157
+ ```bash
158
+ ~/.claude/skills/orch/bin/orch-review-log '{"skill":"design-review-lite","timestamp":"TIMESTAMP","status":"STATUS","findings":N,"auto_fixed":M,"commit":"COMMIT"}'
159
+ ```
160
+
161
+ Substitute: TIMESTAMP = ISO 8601 datetime, STATUS = "clean" if 0 findings or "issues_found", N = total findings, M = auto-fixed count, COMMIT = output of `git rev-parse --short HEAD`.
162
+
163
+ Include any design findings alongside the findings from Step 4. They follow the same Fix-First flow in Step 5 — AUTO-FIX for mechanical CSS fixes, ASK for everything else.
164
+
165
+ ---
166
+
167
+ ## Step 5: Fix-First Review
168
+
169
+ **Every finding gets action — not just critical ones.**
170
+
171
+ Output a summary header: `Pre-Landing Review: N issues (X critical, Y informational)`
172
+
173
+ ### Step 5a: Classify each finding
174
+
175
+ For each finding, classify as AUTO-FIX or ASK per the Fix-First Heuristic in
176
+ checklist.md. Critical findings lean toward ASK; informational findings lean
177
+ toward AUTO-FIX.
178
+
179
+ ### Step 5b: Auto-fix all AUTO-FIX items
180
+
181
+ Apply each fix directly. For each one, output a one-line summary:
182
+ `[AUTO-FIXED] [file:line] Problem → what you did`
183
+
184
+ ### Step 5c: Batch-ask about ASK items
185
+
186
+ If there are ASK items remaining, present them in ONE AskUserQuestion:
187
+
188
+ - List each item with a number, the severity label, the problem, and a recommended fix
189
+ - For each item, provide options: A) Fix as recommended, B) Skip
190
+ - Include an overall RECOMMENDATION
191
+
192
+ Example format:
193
+ ```
194
+ I auto-fixed 5 issues. 2 need your input:
195
+
196
+ 1. [CRITICAL] app/models/post.rb:42 — Race condition in status transition
197
+ Fix: Add `WHERE status = 'draft'` to the UPDATE
198
+ → A) Fix B) Skip
199
+
200
+ 2. [INFORMATIONAL] app/services/generator.rb:88 — LLM output not type-checked before DB write
201
+ Fix: Add JSON schema validation
202
+ → A) Fix B) Skip
203
+
204
+ RECOMMENDATION: Fix both — #1 is a real race condition, #2 prevents silent data corruption.
205
+ ```
206
+
207
+ If 3 or fewer ASK items, you may use individual AskUserQuestion calls instead of batching.
208
+
209
+ ### Step 5d: Apply user-approved fixes
210
+
211
+ Apply fixes for items where the user chose "Fix." Output what was fixed.
212
+
213
+ If no ASK items exist (everything was AUTO-FIX), skip the question entirely.
214
+
215
+ ### Verification of claims
216
+
217
+ Before producing the final review output:
218
+ - If you claim "this pattern is safe" → cite the specific line proving safety
219
+ - If you claim "this is handled elsewhere" → read and cite the handling code
220
+ - If you claim "tests cover this" → name the test file and method
221
+ - Never say "likely handled" or "probably tested" — verify or flag as unknown
222
+
223
+ **Rationalization prevention:** "This looks fine" is not a finding. Either cite evidence it IS fine, or flag it as unverified.
224
+
225
+ ### Greptile comment resolution
226
+
227
+ After outputting your own findings, if Greptile comments were classified in Step 2.5:
228
+
229
+ **Include a Greptile summary in your output header:** `+ N Greptile comments (X valid, Y fixed, Z FP)`
230
+
231
+ Before replying to any comment, run the **Escalation Detection** algorithm from greptile-triage.md to determine whether to use Tier 1 (friendly) or Tier 2 (firm) reply templates.
232
+
233
+ 1. **VALID & ACTIONABLE comments:** These are included in your findings — they follow the Fix-First flow (auto-fixed if mechanical, batched into ASK if not) (A: Fix it now, B: Acknowledge, C: False positive). If the user chooses A (fix), reply using the **Fix reply template** from greptile-triage.md (include inline diff + explanation). If the user chooses C (false positive), reply using the **False Positive reply template** (include evidence + suggested re-rank), save to both per-project and global greptile-history.
234
+
235
+ 2. **FALSE POSITIVE comments:** Present each one via AskUserQuestion:
236
+ - Show the Greptile comment: file:line (or [top-level]) + body summary + permalink URL
237
+ - Explain concisely why it's a false positive
238
+ - Options:
239
+ - A) Reply to Greptile explaining why this is incorrect (recommended if clearly wrong)
240
+ - B) Fix it anyway (if low-effort and harmless)
241
+ - C) Ignore — don't reply, don't fix
242
+
243
+ If the user chooses A, reply using the **False Positive reply template** from greptile-triage.md (include evidence + suggested re-rank), save to both per-project and global greptile-history.
244
+
245
+ 3. **VALID BUT ALREADY FIXED comments:** Reply using the **Already Fixed reply template** from greptile-triage.md — no AskUserQuestion needed:
246
+ - Include what was done and the fixing commit SHA
247
+ - Save to both per-project and global greptile-history
248
+
249
+ 4. **SUPPRESSED comments:** Skip silently — these are known false positives from previous triage.
250
+
251
+ ---
252
+
253
+ ## Step 5.5: TODOS cross-reference
254
+
255
+ Read `TODOS.md` in the repository root (if it exists). Cross-reference the PR against open TODOs:
256
+
257
+ - **Does this PR close any open TODOs?** If yes, note which items in your output: "This PR addresses TODO: <title>"
258
+ - **Does this PR create work that should become a TODO?** If yes, flag it as an informational finding.
259
+ - **Are there related TODOs that provide context for this review?** If yes, reference them when discussing related findings.
260
+
261
+ If TODOS.md doesn't exist, skip this step silently.
262
+
263
+ ---
264
+
265
+ ## Step 5.6: Documentation staleness check
266
+
267
+ Cross-reference the diff against documentation files. For each `.md` file in the repo root (README.md, ARCHITECTURE.md, CONTRIBUTING.md, CLAUDE.md, etc.):
268
+
269
+ 1. Check if code changes in the diff affect features, components, or workflows described in that doc file.
270
+ 2. If the doc file was NOT updated in this branch but the code it describes WAS changed, flag it as an INFORMATIONAL finding:
271
+ "Documentation may be stale: [file] describes [feature/component] but code changed in this branch. Consider running `/document-release`."
272
+
273
+ This is informational only — never critical. The fix action is `/document-release`.
274
+
275
+ If no documentation files exist, skip this step silently.
276
+
277
+ ---
278
+
279
+ ## Step 5.7: Adversarial review (auto-scaled)
280
+
281
+ Adversarial review thoroughness scales automatically based on diff size. No configuration needed.
282
+
283
+ **Detect diff size and tool availability:**
284
+
285
+ ```bash
286
+ DIFF_INS=$(git diff origin/<base> --stat | tail -1 | grep -oE '[0-9]+ insertion' | grep -oE '[0-9]+' || echo "0")
287
+ DIFF_DEL=$(git diff origin/<base> --stat | tail -1 | grep -oE '[0-9]+ deletion' | grep -oE '[0-9]+' || echo "0")
288
+ DIFF_TOTAL=$((DIFF_INS + DIFF_DEL))
289
+ which codex 2>/dev/null && echo "CODEX_AVAILABLE" || echo "CODEX_NOT_AVAILABLE"
290
+ # Respect old opt-out
291
+ OLD_CFG=$(~/.claude/skills/orch/bin/orch-config get codex_reviews 2>/dev/null || true)
292
+ echo "DIFF_SIZE: $DIFF_TOTAL"
293
+ echo "OLD_CFG: ${OLD_CFG:-not_set}"
294
+ ```
295
+
296
+ If `OLD_CFG` is `disabled`: skip this step silently. Continue to the next step.
297
+
298
+ **User override:** If the user explicitly requested a specific tier (e.g., "run all passes", "paranoid review", "full adversarial", "do all 4 passes", "thorough review"), honor that request regardless of diff size. Jump to the matching tier section.
299
+
300
+ **Auto-select tier based on diff size:**
301
+ - **Small (< 50 lines changed):** Skip adversarial review entirely. Print: "Small diff ($DIFF_TOTAL lines) — adversarial review skipped." Continue to the next step.
302
+ - **Medium (50–199 lines changed):** Run Codex adversarial challenge (or Claude adversarial subagent if Codex unavailable). Jump to the "Medium tier" section.
303
+ - **Large (200+ lines changed):** Run all remaining passes — Codex structured review + Claude adversarial subagent + Codex adversarial. Jump to the "Large tier" section.
304
+
305
+ ---
306
+
307
+ ### Medium tier (50–199 lines)
308
+
309
+ Claude's structured review already ran. Now add a **cross-model adversarial challenge**.
310
+
311
+ **If Codex is available:** run the Codex adversarial challenge. **If Codex is NOT available:** fall back to the Claude adversarial subagent instead.
312
+
313
+ **Codex adversarial:**
314
+
315
+ ```bash
316
+ TMPERR_ADV=$(mktemp /tmp/codex-adv-XXXXXXXX)
317
+ codex exec "Review the changes on this branch against the base branch. Run git diff origin/<base> to see the diff. Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems." -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR_ADV"
318
+ ```
319
+
320
+ Use a 5-minute timeout (`timeout: 300000`). After the command completes, read stderr:
321
+ ```bash
322
+ cat "$TMPERR_ADV"
323
+ ```
324
+
325
+ Present the full output verbatim. This is informational — it never blocks shipping.
326
+
327
+ **Error handling:** All errors are non-blocking — adversarial review is a quality enhancement, not a prerequisite.
328
+ - **Auth failure:** If stderr contains "auth", "login", "unauthorized", or "API key": "Codex authentication failed. Run \`codex login\` to authenticate."
329
+ - **Timeout:** "Codex timed out after 5 minutes."
330
+ - **Empty response:** "Codex returned no response. Stderr: <paste relevant error>."
331
+
332
+ On any Codex error, fall back to the Claude adversarial subagent automatically.
333
+
334
+ **Claude adversarial subagent** (fallback when Codex unavailable or errored):
335
+
336
+ Dispatch via the Agent tool. The subagent has fresh context — no checklist bias from the structured review. This genuine independence catches things the primary reviewer is blind to.
337
+
338
+ Subagent prompt:
339
+ "Read the diff for this branch with `git diff origin/<base>`. Think like an attacker and a chaos engineer. Your job is to find ways this code will fail in production. Look for: edge cases, race conditions, security holes, resource leaks, failure modes, silent data corruption, logic errors that produce wrong results silently, error handling that swallows failures, and trust boundary violations. Be adversarial. Be thorough. No compliments — just the problems. For each finding, classify as FIXABLE (you know how to fix it) or INVESTIGATE (needs human judgment)."
340
+
341
+ Present findings under an `ADVERSARIAL REVIEW (Claude subagent):` header. **FIXABLE findings** flow into the same Fix-First pipeline as the structured review. **INVESTIGATE findings** are presented as informational.
342
+
343
+ If the subagent fails or times out: "Claude adversarial subagent unavailable. Continuing without adversarial review."
344
+
345
+ **Persist the review result:**
346
+ ```bash
347
+ ~/.claude/skills/orch/bin/orch-review-log '{"skill":"adversarial-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","source":"SOURCE","tier":"medium","commit":"'"$(git rev-parse --short HEAD)"'"}'
348
+ ```
349
+ Substitute STATUS: "clean" if no findings, "issues_found" if findings exist. SOURCE: "codex" if Codex ran, "claude" if subagent ran. If both failed, do NOT persist.
350
+
351
+ **Cleanup:** Run `rm -f "$TMPERR_ADV"` after processing (if Codex was used).
352
+
353
+ ---
354
+
355
+ ### Large tier (200+ lines)
356
+
357
+ Claude's structured review already ran. Now run **all three remaining passes** for maximum coverage:
358
+
359
+ **1. Codex structured review (if available):**
360
+ ```bash
361
+ TMPERR=$(mktemp /tmp/codex-review-XXXXXXXX)
362
+ codex review --base <base> -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR"
363
+ ```
364
+
365
+ Use a 5-minute timeout. Present output under `CODEX SAYS (code review):` header.
366
+ Check for `[P1]` markers: found → `GATE: FAIL`, not found → `GATE: PASS`.
367
+
368
+ If GATE is FAIL, use AskUserQuestion:
369
+ ```
370
+ Codex found N critical issues in the diff.
371
+
372
+ A) Investigate and fix now (recommended)
373
+ B) Continue — review will still complete
374
+ ```
375
+
376
+ If A: address the findings. Re-run `codex review` to verify.
377
+
378
+ Read stderr for errors (same error handling as medium tier).
379
+
380
+ After stderr: `rm -f "$TMPERR"`
381
+
382
+ **2. Claude adversarial subagent:** Dispatch a subagent with the adversarial prompt (same prompt as medium tier). This always runs regardless of Codex availability.
383
+
384
+ **3. Codex adversarial challenge (if available):** Run `codex exec` with the adversarial prompt (same as medium tier).
385
+
386
+ If Codex is not available for steps 1 and 3, note to the user: "Codex CLI not found — large-diff review ran Claude structured + Claude adversarial (2 of 4 passes). Install Codex for full 4-pass coverage: `npm install -g @openai/codex`"
387
+
388
+ **Persist the review result AFTER all passes complete** (not after each sub-step):
389
+ ```bash
390
+ ~/.claude/skills/orch/bin/orch-review-log '{"skill":"adversarial-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","source":"SOURCE","tier":"large","gate":"GATE","commit":"'"$(git rev-parse --short HEAD)"'"}'
391
+ ```
392
+ Substitute: STATUS = "clean" if no findings across ALL passes, "issues_found" if any pass found issues. SOURCE = "both" if Codex ran, "claude" if only Claude subagent ran. GATE = the Codex structured review gate result ("pass"/"fail"), or "informational" if Codex was unavailable. If all passes failed, do NOT persist.
393
+
394
+ ---
395
+
396
+ ### Cross-model synthesis (medium and large tiers)
397
+
398
+ After all passes complete, synthesize findings across all sources:
399
+
400
+ ```
401
+ ADVERSARIAL REVIEW SYNTHESIS (auto: TIER, N lines):
402
+ ════════════════════════════════════════════════════════════
403
+ High confidence (found by multiple sources): [findings agreed on by >1 pass]
404
+ Unique to Claude structured review: [from earlier step]
405
+ Unique to Claude adversarial: [from subagent, if ran]
406
+ Unique to Codex: [from codex adversarial or code review, if ran]
407
+ Models used: Claude structured ✓ Claude adversarial ✓/✗ Codex ✓/✗
408
+ ════════════════════════════════════════════════════════════
409
+ ```
410
+
411
+ High-confidence findings (agreed on by multiple sources) should be prioritized for fixes.
412
+
413
+ ---
414
+
415
+ ## Important Rules
416
+
417
+ - **Read the FULL diff before commenting.** Do not flag issues already addressed in the diff.
418
+ - **Fix-first, not read-only.** AUTO-FIX items are applied directly. ASK items are only applied after user approval. Never commit, push, or create PRs — that's /ship's job.
419
+ - **Be terse.** One line problem, one line fix. No preamble.
420
+ - **Only flag real problems.** Skip anything that's fine.
421
+ - **Use Greptile reply templates from greptile-triage.md.** Every reply includes evidence. Never post vague replies.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: setup-browser-cookies
3
+ version: 1.0.0
4
+ description: |
5
+ Import cookies from your real browser (Comet, Chrome, Arc, Brave, Edge) into the
6
+ headless browse session. Opens an interactive picker UI where you select which
7
+ cookie domains to import. Use before QA testing authenticated pages. Use when asked
8
+ to "import cookies", "login to the site", or "authenticate the browser".
9
+ ---
10
+
11
+ # Setup Browser Cookies
12
+
13
+ Import logged-in sessions from your real Chromium browser into the headless browse session.
14
+
15
+ ## How it works
16
+
17
+ 1. Find the browse binary
18
+ 2. Run `cookie-import-browser` to detect installed browsers and open the picker UI
19
+ 3. User selects which cookie domains to import in their browser
20
+ 4. Cookies are decrypted and loaded into the Playwright session
21
+
22
+ ## Steps
23
+
24
+ ### 1. Find the browse binary
25
+
26
+ ## SETUP (run this check BEFORE any browse command)
27
+
28
+ ```bash
29
+ _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
30
+ B=""
31
+ [ -n "$_ROOT" ] && [ -x "# browse binary (project-local)" ] && B="# browse binary (project-local)"
32
+ [ -z "$B" ] && B=# browse binary path (adapt to your browse tool setup)
33
+ if [ -x "$B" ]; then
34
+ echo "READY: $B"
35
+ else
36
+ echo "NEEDS_SETUP"
37
+ fi
38
+ ```
39
+
40
+ If `NEEDS_SETUP`:
41
+ 1. Tell the user: "the browse tool needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
42
+ 2. Run: `cd <SKILL_DIR> && ./setup`
43
+ 3. If `bun` is not installed: `curl -fsSL https://bun.sh/install | bash`
44
+
45
+ ### 2. Open the cookie picker
46
+
47
+ ```bash
48
+ $B cookie-import-browser
49
+ ```
50
+
51
+ This auto-detects installed Chromium browsers (Comet, Chrome, Arc, Brave, Edge) and opens
52
+ an interactive picker UI in your default browser where you can:
53
+ - Switch between installed browsers
54
+ - Search domains
55
+ - Click "+" to import a domain's cookies
56
+ - Click trash to remove imported cookies
57
+
58
+ Tell the user: **"Cookie picker opened — select the domains you want to import in your browser, then tell me when you're done."**
59
+
60
+ ### 3. Direct import (alternative)
61
+
62
+ If the user specifies a domain directly (e.g., `/setup-browser-cookies github.com`), skip the UI:
63
+
64
+ ```bash
65
+ $B cookie-import-browser comet --domain github.com
66
+ ```
67
+
68
+ Replace `comet` with the appropriate browser if specified.
69
+
70
+ ### 4. Verify
71
+
72
+ After the user confirms they're done:
73
+
74
+ ```bash
75
+ $B cookies
76
+ ```
77
+
78
+ Show the user a summary of imported cookies (domain counts).
79
+
80
+ ## Notes
81
+
82
+ - First import per browser may trigger a macOS Keychain dialog — click "Allow" / "Always Allow"
83
+ - Cookie picker is served on the same port as the browse server (no extra process)
84
+ - Only domain names and cookie counts are shown in the UI — no cookie values are exposed
85
+ - The browse session persists cookies between commands, so imported cookies work immediately
86
+