opengstack 0.13.10 → 0.14.2

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 (189) hide show
  1. package/AGENTS.md +4 -4
  2. package/CLAUDE.md +127 -110
  3. package/README.md +10 -5
  4. package/SKILL.md +500 -70
  5. package/bin/opengstack.js +69 -69
  6. package/{skills/land-and-deploy/SKILL.md → commands/autoplan.md} +7 -25
  7. package/{skills/benchmark/SKILL.md → commands/benchmark.md} +84 -108
  8. package/{skills/browse/SKILL.md → commands/browse.md} +60 -81
  9. package/{skills/ship/SKILL.md → commands/canary.md} +7 -27
  10. package/{skills/careful/SKILL.md → commands/careful.md} +2 -22
  11. package/{skills/canary/SKILL.md → commands/codex.md} +7 -26
  12. package/{skills/connect-chrome/SKILL.md → commands/connect-chrome.md} +7 -24
  13. package/commands/cso.md +70 -0
  14. package/commands/design-consultation.md +70 -0
  15. package/commands/design-review.md +70 -0
  16. package/commands/design-shotgun.md +70 -0
  17. package/commands/document-release.md +70 -0
  18. package/{skills/freeze/SKILL.md → commands/freeze.md} +3 -29
  19. package/{skills/guard/SKILL.md → commands/guard.md} +4 -35
  20. package/commands/investigate.md +70 -0
  21. package/commands/land-and-deploy.md +70 -0
  22. package/commands/office-hours.md +70 -0
  23. package/{skills/gstack-upgrade/SKILL.md → commands/opengstack-upgrade.md} +64 -79
  24. package/commands/plan-ceo-review.md +70 -0
  25. package/commands/plan-design-review.md +70 -0
  26. package/commands/plan-eng-review.md +70 -0
  27. package/commands/qa-only.md +70 -0
  28. package/commands/qa.md +70 -0
  29. package/commands/retro.md +70 -0
  30. package/commands/review.md +70 -0
  31. package/{skills/setup-browser-cookies/SKILL.md → commands/setup-browser-cookies.md} +22 -40
  32. package/commands/setup-deploy.md +70 -0
  33. package/commands/ship.md +70 -0
  34. package/commands/unfreeze.md +25 -0
  35. package/docs/designs/CHROME_VS_CHROMIUM_EXPLORATION.md +9 -9
  36. package/docs/designs/CONDUCTOR_CHROME_SIDEBAR_INTEGRATION.md +2 -2
  37. package/docs/designs/CONDUCTOR_SESSION_API.md +16 -16
  38. package/docs/designs/DESIGN_SHOTGUN.md +74 -74
  39. package/docs/designs/DESIGN_TOOLS_V1.md +111 -111
  40. package/docs/skills.md +483 -202
  41. package/package.json +42 -43
  42. package/scripts/analytics.ts +188 -0
  43. package/scripts/dev-skill.ts +83 -0
  44. package/scripts/discover-skills.ts +39 -0
  45. package/scripts/eval-compare.ts +97 -0
  46. package/scripts/eval-list.ts +117 -0
  47. package/scripts/eval-select.ts +86 -0
  48. package/scripts/eval-summary.ts +188 -0
  49. package/scripts/eval-watch.ts +172 -0
  50. package/scripts/gen-skill-docs.ts +473 -0
  51. package/scripts/resolvers/browse.ts +129 -0
  52. package/scripts/resolvers/codex-helpers.ts +133 -0
  53. package/scripts/resolvers/composition.ts +48 -0
  54. package/scripts/resolvers/confidence.ts +37 -0
  55. package/scripts/resolvers/constants.ts +50 -0
  56. package/scripts/resolvers/design.ts +950 -0
  57. package/scripts/resolvers/index.ts +59 -0
  58. package/scripts/resolvers/learnings.ts +96 -0
  59. package/scripts/resolvers/preamble.ts +505 -0
  60. package/scripts/resolvers/review.ts +884 -0
  61. package/scripts/resolvers/testing.ts +573 -0
  62. package/scripts/resolvers/types.ts +45 -0
  63. package/scripts/resolvers/utility.ts +421 -0
  64. package/scripts/skill-check.ts +190 -0
  65. package/scripts/cleanup.py +0 -100
  66. package/scripts/filter-skills.sh +0 -114
  67. package/scripts/filter_skills.py +0 -164
  68. package/scripts/install-skills.js +0 -60
  69. package/skills/autoplan/SKILL.md +0 -96
  70. package/skills/autoplan/SKILL.md.tmpl +0 -694
  71. package/skills/benchmark/SKILL.md.tmpl +0 -222
  72. package/skills/browse/SKILL.md.tmpl +0 -131
  73. package/skills/browse/bin/find-browse +0 -21
  74. package/skills/browse/bin/remote-slug +0 -14
  75. package/skills/browse/scripts/build-node-server.sh +0 -48
  76. package/skills/browse/src/activity.ts +0 -208
  77. package/skills/browse/src/browser-manager.ts +0 -959
  78. package/skills/browse/src/buffers.ts +0 -137
  79. package/skills/browse/src/bun-polyfill.cjs +0 -109
  80. package/skills/browse/src/cli.ts +0 -678
  81. package/skills/browse/src/commands.ts +0 -128
  82. package/skills/browse/src/config.ts +0 -150
  83. package/skills/browse/src/cookie-import-browser.ts +0 -625
  84. package/skills/browse/src/cookie-picker-routes.ts +0 -230
  85. package/skills/browse/src/cookie-picker-ui.ts +0 -688
  86. package/skills/browse/src/find-browse.ts +0 -61
  87. package/skills/browse/src/meta-commands.ts +0 -550
  88. package/skills/browse/src/platform.ts +0 -17
  89. package/skills/browse/src/read-commands.ts +0 -358
  90. package/skills/browse/src/server.ts +0 -1192
  91. package/skills/browse/src/sidebar-agent.ts +0 -280
  92. package/skills/browse/src/sidebar-utils.ts +0 -21
  93. package/skills/browse/src/snapshot.ts +0 -407
  94. package/skills/browse/src/url-validation.ts +0 -95
  95. package/skills/browse/src/write-commands.ts +0 -364
  96. package/skills/browse/test/activity.test.ts +0 -120
  97. package/skills/browse/test/adversarial-security.test.ts +0 -32
  98. package/skills/browse/test/browser-manager-unit.test.ts +0 -17
  99. package/skills/browse/test/bun-polyfill.test.ts +0 -72
  100. package/skills/browse/test/commands.test.ts +0 -2075
  101. package/skills/browse/test/compare-board.test.ts +0 -342
  102. package/skills/browse/test/config.test.ts +0 -316
  103. package/skills/browse/test/cookie-import-browser.test.ts +0 -519
  104. package/skills/browse/test/cookie-picker-routes.test.ts +0 -260
  105. package/skills/browse/test/file-drop.test.ts +0 -271
  106. package/skills/browse/test/find-browse.test.ts +0 -50
  107. package/skills/browse/test/findport.test.ts +0 -191
  108. package/skills/browse/test/fixtures/basic.html +0 -33
  109. package/skills/browse/test/fixtures/cursor-interactive.html +0 -22
  110. package/skills/browse/test/fixtures/dialog.html +0 -15
  111. package/skills/browse/test/fixtures/empty.html +0 -2
  112. package/skills/browse/test/fixtures/forms.html +0 -55
  113. package/skills/browse/test/fixtures/iframe.html +0 -30
  114. package/skills/browse/test/fixtures/network-idle.html +0 -30
  115. package/skills/browse/test/fixtures/qa-eval-checkout.html +0 -108
  116. package/skills/browse/test/fixtures/qa-eval-spa.html +0 -98
  117. package/skills/browse/test/fixtures/qa-eval.html +0 -51
  118. package/skills/browse/test/fixtures/responsive.html +0 -49
  119. package/skills/browse/test/fixtures/snapshot.html +0 -55
  120. package/skills/browse/test/fixtures/spa.html +0 -24
  121. package/skills/browse/test/fixtures/states.html +0 -17
  122. package/skills/browse/test/fixtures/upload.html +0 -25
  123. package/skills/browse/test/gstack-config.test.ts +0 -138
  124. package/skills/browse/test/gstack-update-check.test.ts +0 -514
  125. package/skills/browse/test/handoff.test.ts +0 -235
  126. package/skills/browse/test/path-validation.test.ts +0 -91
  127. package/skills/browse/test/platform.test.ts +0 -37
  128. package/skills/browse/test/server-auth.test.ts +0 -65
  129. package/skills/browse/test/sidebar-agent-roundtrip.test.ts +0 -226
  130. package/skills/browse/test/sidebar-agent.test.ts +0 -199
  131. package/skills/browse/test/sidebar-integration.test.ts +0 -320
  132. package/skills/browse/test/sidebar-unit.test.ts +0 -96
  133. package/skills/browse/test/snapshot.test.ts +0 -467
  134. package/skills/browse/test/state-ttl.test.ts +0 -35
  135. package/skills/browse/test/test-server.ts +0 -57
  136. package/skills/browse/test/url-validation.test.ts +0 -72
  137. package/skills/browse/test/watch.test.ts +0 -129
  138. package/skills/canary/SKILL.md.tmpl +0 -212
  139. package/skills/careful/SKILL.md.tmpl +0 -56
  140. package/skills/careful/bin/check-careful.sh +0 -112
  141. package/skills/codex/SKILL.md +0 -90
  142. package/skills/codex/SKILL.md.tmpl +0 -417
  143. package/skills/connect-chrome/SKILL.md.tmpl +0 -195
  144. package/skills/cso/ACKNOWLEDGEMENTS.md +0 -14
  145. package/skills/cso/SKILL.md +0 -93
  146. package/skills/cso/SKILL.md.tmpl +0 -606
  147. package/skills/design-consultation/SKILL.md +0 -94
  148. package/skills/design-consultation/SKILL.md.tmpl +0 -415
  149. package/skills/design-review/SKILL.md +0 -94
  150. package/skills/design-review/SKILL.md.tmpl +0 -290
  151. package/skills/design-shotgun/SKILL.md +0 -91
  152. package/skills/design-shotgun/SKILL.md.tmpl +0 -285
  153. package/skills/document-release/SKILL.md +0 -91
  154. package/skills/document-release/SKILL.md.tmpl +0 -359
  155. package/skills/freeze/SKILL.md.tmpl +0 -77
  156. package/skills/freeze/bin/check-freeze.sh +0 -79
  157. package/skills/gstack-upgrade/SKILL.md.tmpl +0 -222
  158. package/skills/guard/SKILL.md.tmpl +0 -77
  159. package/skills/investigate/SKILL.md +0 -105
  160. package/skills/investigate/SKILL.md.tmpl +0 -194
  161. package/skills/land-and-deploy/SKILL.md.tmpl +0 -881
  162. package/skills/office-hours/SKILL.md +0 -96
  163. package/skills/office-hours/SKILL.md.tmpl +0 -645
  164. package/skills/plan-ceo-review/SKILL.md +0 -94
  165. package/skills/plan-ceo-review/SKILL.md.tmpl +0 -811
  166. package/skills/plan-design-review/SKILL.md +0 -92
  167. package/skills/plan-design-review/SKILL.md.tmpl +0 -446
  168. package/skills/plan-eng-review/SKILL.md +0 -93
  169. package/skills/plan-eng-review/SKILL.md.tmpl +0 -303
  170. package/skills/qa/SKILL.md +0 -95
  171. package/skills/qa/SKILL.md.tmpl +0 -316
  172. package/skills/qa/references/issue-taxonomy.md +0 -85
  173. package/skills/qa/templates/qa-report-template.md +0 -126
  174. package/skills/qa-only/SKILL.md +0 -89
  175. package/skills/qa-only/SKILL.md.tmpl +0 -101
  176. package/skills/retro/SKILL.md +0 -89
  177. package/skills/retro/SKILL.md.tmpl +0 -820
  178. package/skills/review/SKILL.md +0 -92
  179. package/skills/review/SKILL.md.tmpl +0 -281
  180. package/skills/review/TODOS-format.md +0 -62
  181. package/skills/review/checklist.md +0 -220
  182. package/skills/review/design-checklist.md +0 -132
  183. package/skills/review/greptile-triage.md +0 -220
  184. package/skills/setup-browser-cookies/SKILL.md.tmpl +0 -81
  185. package/skills/setup-deploy/SKILL.md +0 -92
  186. package/skills/setup-deploy/SKILL.md.tmpl +0 -215
  187. package/skills/ship/SKILL.md.tmpl +0 -636
  188. package/skills/unfreeze/SKILL.md +0 -37
  189. package/skills/unfreeze/SKILL.md.tmpl +0 -36
@@ -1,417 +0,0 @@
1
- ---
2
- name: codex
3
- preamble-tier: 3
4
- version: 1.0.0
5
- description: |
6
- OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via
7
- codex review with pass/fail gate. Challenge: adversarial mode that tries to break
8
- your code. Consult: ask codex anything with session continuity for follow-ups.
9
- The "200 IQ autistic developer" second opinion. Use when asked to "codex review",
10
- "codex challenge", "ask codex", "second opinion", or "consult codex".
11
- allowed-tools:
12
- - Bash
13
- - Read
14
- - Write
15
- - Glob
16
- - Grep
17
- - AskUserQuestion
18
- ---
19
-
20
- {{PREAMBLE}}
21
-
22
- {{BASE_BRANCH_DETECT}}
23
-
24
- # /codex — Multi-AI Second Opinion
25
-
26
- You are running the `/codex` skill. This wraps the OpenAI Codex CLI to get an independent,
27
- brutally honest second opinion from a different AI system.
28
-
29
- Codex is the "200 IQ autistic developer" — direct, terse, technically precise, challenges
30
- assumptions, catches things you might miss. Present its output faithfully, not summarized.
31
-
32
- ---
33
-
34
- ## Step 0: Check codex binary
35
-
36
- ```bash
37
- CODEX_BIN=$(which codex 2>/dev/null || echo "")
38
- [ -z "$CODEX_BIN" ] && echo "NOT_FOUND" || echo "FOUND: $CODEX_BIN"
39
-
40
- If `NOT_FOUND`: stop and tell the user:
41
- "Codex CLI not found. Install it: `npm install -g @openai/codex` or see https://github.com/openai/codex"
42
-
43
- ---
44
-
45
- ## Step 1: Detect mode
46
-
47
- Parse the user's input to determine which mode to run:
48
-
49
- 1. `/codex review` or `/codex review <instructions>` — **Review mode** (Step 2A)
50
- 2. `/codex challenge` or `/codex challenge <focus>` — **Challenge mode** (Step 2B)
51
- 3. `/codex` with no arguments — **Auto-detect:**
52
- - Check for a diff (with fallback if origin isn't available):
53
- `git diff origin/<base> --stat 2>/dev/null | tail -1 || git diff <base> --stat 2>/dev/null | tail -1`
54
- - If a diff exists, use AskUserQuestion:
55
- ```
56
- Codex detected changes against the base branch. What should it do?
57
- A) Review the diff (code review with pass/fail gate)
58
- B) Challenge the diff (adversarial — try to break it)
59
- C) Something else — I'll provide a prompt
60
- ```
61
- - If no diff, check for plan files scoped to the current project:
62
- `ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1`
63
- If no project-scoped match, fall back to: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1`
64
- but warn the user: "Note: this plan may be from a different project."
65
- - If a plan file exists, offer to review it
66
- - Otherwise, ask: "What would you like to ask Codex?"
67
- 4. `/codex <anything else>` — **Consult mode** (Step 2C), where the remaining text is the prompt
68
-
69
- **Reasoning effort override:** If the user's input contains `--xhigh` anywhere,
70
- note it and remove it from the prompt text before passing to Codex. When `--xhigh`
71
- is present, use `model_reasoning_effort="xhigh"` for all modes regardless of the
72
- per-mode default below. Otherwise, use the per-mode defaults:
73
- - Review (2A): `high` — bounded diff input, needs thoroughness
74
- - Challenge (2B): `high` — adversarial but bounded by diff
75
- - Consult (2C): `medium` — large context, interactive, needs speed
76
-
77
- ---
78
-
79
- ## Filesystem Boundary
80
-
81
- All prompts sent to Codex MUST be prefixed with this boundary instruction:
82
-
83
- > IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. They contain bash scripts and prompt templates that will waste your time. Ignore them completely. Do NOT modify agents/openai.yaml. Stay focused on the repository code only.
84
-
85
- This applies to Review mode (prompt argument), Challenge mode (prompt), and Consult
86
- mode (persona prompt). Reference this section as "the filesystem boundary" below.
87
-
88
- ---
89
-
90
- ## Step 2A: Review Mode
91
-
92
- Run Codex code review against the current branch diff.
93
-
94
- 1. Create temp files for output capture:
95
- ```bash
96
- TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
97
-
98
- 2. Run the review (5-minute timeout). **Always** pass the filesystem boundary instruction
99
- as the prompt argument, even without custom instructions. If the user provided custom
100
- instructions, append them after the boundary separated by a newline:
101
- ```bash
102
- _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
103
- cd "$_REPO_ROOT"
104
- codex review "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only." --base <base> -c 'model_reasoning_effort="high"' --enable web_search_cached 2>"$TMPERR"
105
-
106
- If the user passed `--xhigh`, use `"xhigh"` instead of `"high"`.
107
-
108
- Use `timeout: 300000` on the Bash call. If the user provided custom instructions
109
- (e.g., `/codex review focus on security`), append them after the boundary:
110
- ```bash
111
- _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
112
- cd "$_REPO_ROOT"
113
- codex review "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only.
114
-
115
- focus on security" --base <base> -c 'model_reasoning_effort="high"' --enable web_search_cached 2>"$TMPERR"
116
-
117
- 3. Capture the output. Then parse cost from stderr:
118
- ```bash
119
- grep "tokens used" "$TMPERR" 2>/dev/null || echo "tokens: unknown"
120
-
121
- 4. Determine gate verdict by checking the review output for critical findings.
122
- If the output contains `[P1]` — the gate is **FAIL**.
123
- If no `[P1]` markers are found (only `[P2]` or no findings) — the gate is **PASS**.
124
-
125
- 5. Present the output:
126
-
127
-
128
- CODEX SAYS (code review):
129
- ════════════════════════════════════════════════════════════
130
- <full codex output, verbatim — do not truncate or summarize>
131
- ════════════════════════════════════════════════════════════
132
- GATE: PASS Tokens: 14,331 | Est. cost: ~$0.12
133
-
134
- or
135
-
136
-
137
- GATE: FAIL (N critical findings)
138
-
139
- 6. **Cross-model comparison:** If `/review` (Claude's own review) was already run
140
- earlier in this conversation, compare the two sets of findings:
141
-
142
-
143
- CROSS-MODEL ANALYSIS:
144
- Both found: [findings that overlap between Claude and Codex]
145
- Only Codex found: [findings unique to Codex]
146
- Only Claude found: [findings unique to Claude's /review]
147
- Agreement rate: X% (N/M total unique findings overlap)
148
-
149
- 7. Persist the review result:
150
- ```bash
151
- ~/.claude/skills/opengstack/bin/gstack-review-log '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N,"findings_fixed":N,"commit":"'"$(git rev-parse --short HEAD)"'"}'
152
-
153
- Substitute: TIMESTAMP (ISO 8601), STATUS ("clean" if PASS, "issues_found" if FAIL),
154
- GATE ("pass" or "fail"), findings (count of [P1] + [P2] markers),
155
- findings_fixed (count of findings that were addressed/fixed before shipping).
156
-
157
- 8. Clean up temp files:
158
- ```bash
159
- rm -f "$TMPERR"
160
-
161
- {{PLAN_FILE_REVIEW_REPORT}}
162
-
163
- ---
164
-
165
- ## Step 2B: Challenge (Adversarial) Mode
166
-
167
- Codex tries to break your code — finding edge cases, race conditions, security holes,
168
- and failure modes that a normal review would miss.
169
-
170
- 1. Construct the adversarial prompt. **Always prepend the filesystem boundary instruction**
171
- from the Filesystem Boundary section above. If the user provided a focus area
172
- (e.g., `/codex challenge security`), include it after the boundary:
173
-
174
- Default prompt (no focus):
175
- "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only.
176
-
177
- 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."
178
-
179
- With focus (e.g., "security"):
180
- "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only.
181
-
182
- Review the changes on this branch against the base branch. Run `git diff origin/<base>` to see the diff. Focus specifically on SECURITY. Your job is to find every way an attacker could exploit this code. Think about injection vectors, auth bypasses, privilege escalation, data exposure, and timing attacks. Be adversarial."
183
-
184
- 2. Run codex exec with **JSONL output** to capture reasoning traces and tool calls (5-minute timeout):
185
-
186
- If the user passed `--xhigh`, use `"xhigh"` instead of `"high"`.
187
-
188
- ```bash
189
- _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
190
- codex exec "<prompt>" -C "$_REPO_ROOT" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>/dev/null | PYTHONUNBUFFERED=1 python3 -u -c "
191
- import sys, json
192
- for line in sys.stdin:
193
- line = line.strip()
194
- if not line: continue
195
- try:
196
- obj = json.loads(line)
197
- t = obj.get('type','')
198
- if t == 'item.completed' and 'item' in obj:
199
- item = obj['item']
200
- itype = item.get('type','')
201
- text = item.get('text','')
202
- if itype == 'reasoning' and text:
203
- print(f'[codex thinking] {text}', flush=True)
204
- print(flush=True)
205
- elif itype == 'agent_message' and text:
206
- print(text, flush=True)
207
- elif itype == 'command_execution':
208
- cmd = item.get('command','')
209
- if cmd: print(f'[codex ran] {cmd}', flush=True)
210
- elif t == 'turn.completed':
211
- usage = obj.get('usage',{})
212
- tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
213
- if tokens: print(f'\ntokens used: {tokens}', flush=True)
214
- except: pass
215
- "
216
-
217
- This parses codex's JSONL events to extract reasoning traces, tool calls, and the final
218
- response. The `[codex thinking]` lines show what codex reasoned through before its answer.
219
-
220
- 3. Present the full streamed output:
221
-
222
-
223
- CODEX SAYS (adversarial challenge):
224
- ════════════════════════════════════════════════════════════
225
- <full output from above, verbatim>
226
- ════════════════════════════════════════════════════════════
227
- Tokens: N | Est. cost: ~$X.XX
228
-
229
- ---
230
-
231
- ## Step 2C: Consult Mode
232
-
233
- Ask Codex anything about the codebase. Supports session continuity for follow-ups.
234
-
235
- 1. **Check for existing session:**
236
- ```bash
237
- cat .context/codex-session-id 2>/dev/null || echo "NO_SESSION"
238
-
239
- If a session file exists (not `NO_SESSION`), use AskUserQuestion:
240
-
241
- You have an active Codex conversation from earlier. Continue it or start fresh?
242
- A) Continue the conversation (Codex remembers the prior context)
243
- B) Start a new conversation
244
-
245
- 2. Create temp files:
246
- ```bash
247
- TMPRESP=$(mktemp /tmp/codex-resp-XXXXXX.txt)
248
- TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
249
-
250
- 3. **Plan review auto-detection:** If the user's prompt is about reviewing a plan,
251
- or if plan files exist and the user said `/codex` with no arguments:
252
- ```bash
253
- setopt +o nomatch 2>/dev/null || true # zsh compat
254
- ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1
255
-
256
- If no project-scoped match, fall back to `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1`
257
- but warn: "Note: this plan may be from a different project — verify before sending to Codex."
258
-
259
- **IMPORTANT — embed content, don't reference path:** Codex runs sandboxed to the repo
260
- root (`-C`) and cannot access `~/.claude/plans/` or any files outside the repo. You MUST
261
- read the plan file yourself and embed its FULL CONTENT in the prompt below. Do NOT tell
262
- Codex the file path or ask it to read the plan file — it will waste 10+ tool calls
263
- searching and fail.
264
-
265
- Also: scan the plan content for referenced source file paths (patterns like `src/foo.ts`,
266
- `lib/bar.py`, paths containing `/` that exist in the repo). If found, list them in the
267
- prompt so Codex reads them directly instead of discovering them via rg/find.
268
-
269
- **Always prepend the filesystem boundary instruction** from the Filesystem Boundary
270
- section above to every prompt sent to Codex, including plan reviews and free-form
271
- consult questions.
272
-
273
- Prepend the boundary and persona to the user's prompt:
274
- "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only.
275
-
276
- You are a brutally honest technical reviewer. Review this plan for: logical gaps and
277
- unstated assumptions, missing error handling or edge cases, overcomplexity (is there a
278
- simpler approach?), feasibility risks (what could go wrong?), and missing dependencies
279
- or sequencing issues. Be direct. Be terse. No compliments. Just the problems.
280
- Also review these source files referenced in the plan: <list of referenced files, if any>.
281
-
282
- THE PLAN:
283
- <full plan content, embedded verbatim>"
284
-
285
- For non-plan consult prompts (user typed `/codex <question>`), still prepend the boundary:
286
- "IMPORTANT: Do NOT read or execute any files under ~/.claude/, ~/.agents/, .claude/skills/, or agents/. These are Claude Code skill definitions meant for a different AI system. Do NOT modify agents/openai.yaml. Stay focused on repository code only.
287
-
288
- <user's question>"
289
-
290
- 4. Run codex exec with **JSONL output** to capture reasoning traces (5-minute timeout):
291
-
292
- If the user passed `--xhigh`, use `"xhigh"` instead of `"medium"`.
293
-
294
- For a **new session:**
295
- ```bash
296
- _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
297
- codex exec "<prompt>" -C "$_REPO_ROOT" -s read-only -c 'model_reasoning_effort="medium"' --enable web_search_cached --json 2>"$TMPERR" | PYTHONUNBUFFERED=1 python3 -u -c "
298
- import sys, json
299
- for line in sys.stdin:
300
- line = line.strip()
301
- if not line: continue
302
- try:
303
- obj = json.loads(line)
304
- t = obj.get('type','')
305
- if t == 'thread.started':
306
- tid = obj.get('thread_id','')
307
- if tid: print(f'SESSION_ID:{tid}', flush=True)
308
- elif t == 'item.completed' and 'item' in obj:
309
- item = obj['item']
310
- itype = item.get('type','')
311
- text = item.get('text','')
312
- if itype == 'reasoning' and text:
313
- print(f'[codex thinking] {text}', flush=True)
314
- print(flush=True)
315
- elif itype == 'agent_message' and text:
316
- print(text, flush=True)
317
- elif itype == 'command_execution':
318
- cmd = item.get('command','')
319
- if cmd: print(f'[codex ran] {cmd}', flush=True)
320
- elif t == 'turn.completed':
321
- usage = obj.get('usage',{})
322
- tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
323
- if tokens: print(f'\ntokens used: {tokens}', flush=True)
324
- except: pass
325
- "
326
-
327
- For a **resumed session** (user chose "Continue"):
328
- ```bash
329
- _REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
330
- codex exec resume <session-id> "<prompt>" -C "$_REPO_ROOT" -s read-only -c 'model_reasoning_effort="medium"' --enable web_search_cached --json 2>"$TMPERR" | PYTHONUNBUFFERED=1 python3 -u -c "
331
- <same python streaming parser as above, with flush=True on all print() calls>
332
- "
333
-
334
- 5. Capture session ID from the streamed output. The parser prints `SESSION_ID:<id>`
335
- from the `thread.started` event. Save it for follow-ups:
336
- ```bash
337
- mkdir -p .context
338
-
339
- Save the session ID printed by the parser (the line starting with `SESSION_ID:`)
340
- to `.context/codex-session-id`.
341
-
342
- 6. Present the full streamed output:
343
-
344
-
345
- CODEX SAYS (consult):
346
- ════════════════════════════════════════════════════════════
347
- <full output, verbatim — includes [codex thinking] traces>
348
- ════════════════════════════════════════════════════════════
349
- Tokens: N | Est. cost: ~$X.XX
350
- Session saved — run /codex again to continue this conversation.
351
-
352
- 7. After presenting, note any points where Codex's analysis differs from your own
353
- understanding. If there is a disagreement, flag it:
354
- "Note: Claude Code disagrees on X because Y."
355
-
356
- ---
357
-
358
- ## Model & Reasoning
359
-
360
- **Model:** No model is hardcoded — codex uses whatever its current default is (the frontier
361
- agentic coding model). This means as OpenAI ships newer models, /codex automatically
362
- uses them. If the user wants a specific model, pass `-m` through to codex.
363
-
364
- **Reasoning effort (per-mode defaults):**
365
- - **Review (2A):** `high` — bounded diff input, needs thoroughness but not max tokens
366
- - **Challenge (2B):** `high` — adversarial but bounded by diff size
367
- - **Consult (2C):** `medium` — large context (plans, codebase), interactive, needs speed
368
-
369
- `xhigh` uses ~23x more tokens than `high` and causes 50+ minute hangs on large context
370
- tasks (OpenAI issues #8545, #8402, #6931). Users can override with `--xhigh` flag
371
- (e.g., `/codex review --xhigh`) when they want maximum reasoning and are willing to wait.
372
-
373
- **Web search:** All codex commands use `--enable web_search_cached` so Codex can look up
374
- docs and APIs during review. This is OpenAI's cached index — fast, no extra cost.
375
-
376
- If the user specifies a model (e.g., `/codex review -m gpt-5.1-codex-max`
377
- or `/codex challenge -m gpt-5.2`), pass the `-m` flag through to codex.
378
-
379
- ---
380
-
381
- ## Cost Estimation
382
-
383
- Parse token count from stderr. Codex prints `tokens used\nN` to stderr.
384
-
385
- Display as: `Tokens: N`
386
-
387
- If token count is not available, display: `Tokens: unknown`
388
-
389
- ---
390
-
391
- ## Error Handling
392
-
393
- - **Binary not found:** Detected in Step 0. Stop with install instructions.
394
- - **Auth error:** Codex prints an auth error to stderr. Surface the error:
395
- "Codex authentication failed. Run `codex login` in your terminal to authenticate via ChatGPT."
396
- - **Timeout:** If the Bash call times out (5 min), tell the user:
397
- "Codex timed out after 5 minutes. The diff may be too large or the API may be slow. Try again or use a smaller scope."
398
- - **Empty response:** If `$TMPRESP` is empty or doesn't exist, tell the user:
399
- "Codex returned no response. Check stderr for errors."
400
- - **Session resume failure:** If resume fails, delete the session file and start fresh.
401
-
402
- ---
403
-
404
- ## Important Rules
405
-
406
- - **Never modify files.** This skill is read-only. Codex runs in read-only sandbox mode.
407
- - **Present output verbatim.** Do not truncate, summarize, or editorialize Codex's output
408
- before showing it. Show it in full inside the CODEX SAYS block.
409
- - **Add synthesis after, not instead of.** Any Claude commentary comes after the full output.
410
- - **5-minute timeout** on all Bash calls to codex (`timeout: 300000`).
411
- - **No double-reviewing.** If the user already ran `/review`, Codex provides a second
412
- independent opinion. Do not re-run Claude Code's own review.
413
- - **Detect skill-file rabbit holes.** After receiving Codex output, scan for signs
414
- that Codex got distracted by skill files: `gstack-config`, `echo`,
415
- `SKILL.md`, or `skills/gstack`. If any of these appear in the output, append a
416
- warning: "Codex appears to have read gstack skill files instead of reviewing your
417
- code. Consider retrying."
@@ -1,195 +0,0 @@
1
- ---
2
- name: connect-chrome
3
- version: 0.1.0
4
- description: |
5
- Launch real Chrome controlled by gstack with the Side Panel extension auto-loaded.
6
- One command: connects Claude to a visible Chrome window where you can watch every
7
- action in real time. The extension shows a live activity feed in the Side Panel.
8
- Use when asked to "connect chrome", "open chrome", "real browser", "launch chrome",
9
- "side panel", or "control my browser".
10
- allowed-tools:
11
- - Bash
12
- - Read
13
- - AskUserQuestion
14
-
15
- ---
16
-
17
- {{PREAMBLE}}
18
-
19
- # /connect-chrome — Launch Real Chrome with Side Panel
20
-
21
- Connect Claude to a visible Chrome window with the gstack extension auto-loaded.
22
- You see every click, every navigation, every action in real time.
23
-
24
- {{BROWSE_SETUP}}
25
-
26
- ## Step 0: Pre-flight cleanup
27
-
28
- Before connecting, kill any stale browse servers and clean up lock files that
29
- may have persisted from a crash. This prevents "already connected" false
30
- positives and Chromium profile lock conflicts.
31
-
32
- ```bash
33
- # Kill any existing browse server
34
- if [ -f "$(git rev-parse --show-toplevel 2>/dev/null)/.gstack/browse.json" ]; then
35
- _OLD_PID=$(cat "$(git rev-parse --show-toplevel)/.gstack/browse.json" 2>/dev/null | grep -o '"pid":[0-9]*' | grep -o '[0-9]*')
36
- [ -n "$_OLD_PID" ] && kill "$_OLD_PID" 2>/dev/null || true
37
- sleep 1
38
- [ -n "$_OLD_PID" ] && kill -9 "$_OLD_PID" 2>/dev/null || true
39
- rm -f "$(git rev-parse --show-toplevel)/.gstack/browse.json"
40
- fi
41
- # Clean Chromium profile locks (can persist after crashes)
42
- _PROFILE_DIR="$HOME/.gstack/chromium-profile"
43
- for _LF in SingletonLock SingletonSocket SingletonCookie; do
44
- rm -f "$_PROFILE_DIR/$_LF" 2>/dev/null || true
45
- done
46
- echo "Pre-flight cleanup done"
47
-
48
- ## Step 1: Connect
49
-
50
- ```bash
51
- $B connect
52
-
53
- This launches Playwright's bundled Chromium in headed mode with:
54
- - A visible window you can watch (not your regular Chrome — it stays untouched)
55
- - The gstack Chrome extension auto-loaded via `launchPersistentContext`
56
- - A golden shimmer line at the top of every page so you know which window is controlled
57
- - A sidebar agent process for chat commands
58
-
59
- The `connect` command auto-discovers the extension from the gstack install
60
- directory. It always uses port **34567** so the extension can auto-connect.
61
-
62
- After connecting, print the full output to the user. Confirm you see
63
- `Mode: headed` in the output.
64
-
65
- If the output shows an error or the mode is not `headed`, run `$B status` and
66
- share the output with the user before proceeding.
67
-
68
- ## Step 2: Verify
69
-
70
- ```bash
71
- $B status
72
-
73
- Confirm the output shows `Mode: headed`. Read the port from the state file:
74
-
75
- ```bash
76
- cat "$(git rev-parse --show-toplevel 2>/dev/null)/.gstack/browse.json" 2>/dev/null | grep -o '"port":[0-9]*' | grep -o '[0-9]*'
77
-
78
- The port should be **34567**. If it's different, note it — the user may need it
79
- for the Side Panel.
80
-
81
- Also find the extension path so you can help the user if they need to load it manually:
82
-
83
- ```bash
84
- _EXT_PATH=""
85
- _ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
86
- [ -n "$_ROOT" ] && [ -f "$_ROOT/.claude/skills/gstack/extension/manifest.json" ] && _EXT_PATH="$_ROOT/.claude/skills/gstack/extension"
87
- [ -z "$_EXT_PATH" ] && [ -f "$HOME/.claude/skills/gstack/extension/manifest.json" ] && _EXT_PATH="$HOME/.claude/skills/gstack/extension"
88
- echo "EXTENSION_PATH: ${_EXT_PATH:-NOT FOUND}"
89
-
90
- ## Step 3: Guide the user to the Side Panel
91
-
92
- Use AskUserQuestion:
93
-
94
- > Chrome is launched with gstack control. You should see Playwright's Chromium
95
- > (not your regular Chrome) with a golden shimmer line at the top of the page.
96
- >
97
- > The Side Panel extension should be auto-loaded. To open it:
98
- > 1. Look for the **puzzle piece icon** (Extensions) in the toolbar — it may
99
- > already show the gstack icon if the extension loaded successfully
100
- > 2. Click the **puzzle piece** → find **gstack browse** → click the **pin icon**
101
- > 3. Click the pinned **gstack icon** in the toolbar
102
- > 4. The Side Panel should open on the right showing a live activity feed
103
- >
104
- > **Port:** 34567 (auto-detected — the extension connects automatically in the
105
- > Playwright-controlled Chrome).
106
-
107
- Options:
108
- - A) I can see the Side Panel — let's go!
109
- - B) I can see Chrome but can't find the extension
110
- - C) Something went wrong
111
-
112
- If B: Tell the user:
113
-
114
- > The extension is loaded into Playwright's Chromium at launch time, but
115
- > sometimes it doesn't appear immediately. Try these steps:
116
- >
117
- > 1. Type `chrome://extensions` in the address bar
118
- > 2. Look for **"gstack browse"** — it should be listed and enabled
119
- > 3. If it's there but not pinned, go back to any page, click the puzzle piece
120
- > icon, and pin it
121
- > 4. If it's NOT listed at all, click **"Load unpacked"** and navigate to:
122
- > - Press **Cmd+Shift+G** in the file picker dialog
123
- > - Paste this path: `{EXTENSION_PATH}` (use the path from Step 2)
124
- > - Click **Select**
125
- >
126
- > After loading, pin it and click the icon to open the Side Panel.
127
- >
128
- > If the Side Panel badge stays gray (disconnected), click the gstack icon
129
- > and enter port **34567** manually.
130
-
131
- If C:
132
-
133
- 1. Run `$B status` and show the output
134
- 2. If the server is not healthy, re-run Step 0 cleanup + Step 1 connect
135
- 3. If the server IS healthy but the browser isn't visible, try `$B focus`
136
- 4. If that fails, ask the user what they see (error message, blank screen, etc.)
137
-
138
- ## Step 4: Demo
139
-
140
- After the user confirms the Side Panel is working, run a quick demo:
141
-
142
- ```bash
143
- $B goto https://news.ycombinator.com
144
-
145
- Wait 2 seconds, then:
146
-
147
- ```bash
148
- $B snapshot -i
149
-
150
- Tell the user: "Check the Side Panel — you should see the `goto` and `snapshot`
151
- commands appear in the activity feed. Every command Claude runs shows up here
152
- in real time."
153
-
154
- ## Step 5: Sidebar chat
155
-
156
- After the activity feed demo, tell the user about the sidebar chat:
157
-
158
- > The Side Panel also has a **chat tab**. Try typing a message like "take a
159
- > snapshot and describe this page." A sidebar agent (a child Claude instance)
160
- > executes your request in the browser — you'll see the commands appear in
161
- > the activity feed as they happen.
162
- >
163
- > The sidebar agent can navigate pages, click buttons, fill forms, and read
164
- > content. Each task gets up to 5 minutes. It runs in an isolated session, so
165
- > it won't interfere with this Claude Code window.
166
-
167
- ## Step 6: What's next
168
-
169
- Tell the user:
170
-
171
- > You're all set! Here's what you can do with the connected Chrome:
172
- >
173
- > **Watch Claude work in real time:**
174
- > - Run any gstack skill (`/qa`, `/design-review`, `/benchmark`) and watch
175
- > every action happen in the visible Chrome window + Side Panel feed
176
- > - No cookie import needed — the Playwright browser shares its own session
177
- >
178
- > **Control the browser directly:**
179
- > - **Sidebar chat** — type natural language in the Side Panel and the sidebar
180
- > agent executes it (e.g., "fill in the login form and submit")
181
- > - **Browse commands** — `$B goto <url>`, `$B click <sel>`, `$B fill <sel> <val>`,
182
- > `$B snapshot -i` — all visible in Chrome + Side Panel
183
- >
184
- > **Window management:**
185
- > - `$B focus` — bring Chrome to the foreground anytime
186
- > - `$B disconnect` — close headed Chrome and return to headless mode
187
- >
188
- > **What skills look like in headed mode:**
189
- > - `/qa` runs its full test suite in the visible browser — you see every page
190
- > load, every click, every assertion
191
- > - `/design-review` takes screenshots in the real browser — same pixels you see
192
- > - `/benchmark` measures performance in the headed browser
193
-
194
- Then proceed with whatever the user asked to do. If they didn't specify a task,
195
- ask what they'd like to test or browse.
@@ -1,14 +0,0 @@
1
- # Acknowledgements
2
-
3
- /cso v2 was informed by research across the security audit landscape. Credits to:
4
-
5
- - **[Sentry Security Review](https://github.com/getsentry/skills)** — The confidence-based reporting system (only HIGH confidence findings get reported) and the "research before reporting" methodology (trace data flow, check upstream validation) validated our 8/10 daily confidence gate. TimOnWeb rated it the only security skill worth installing out of 5 tested.
6
- - **[Trail of Bits Skills](https://github.com/trailofbits/skills)** — The audit-context-building methodology (build a mental model before hunting bugs) directly inspired Phase 0. Their variant analysis concept (found one vuln? Search the whole codebase for the same pattern) inspired Phase 12's variant analysis step.
7
- - **[Shannon by Keygraph](https://github.com/KeygraphHQ/shannon)** — Autonomous AI pentester achieving 96.15% on the XBOW benchmark (100/104 exploits). Validated that AI can do real security testing, not just checklist scanning. Our Phase 12 active verification is the static-analysis version of what Shannon does live.
8
- - **[afiqiqmal/claude-security-audit](https://github.com/afiqiqmal/claude-security-audit)** — The AI/LLM-specific security checks (prompt injection, RAG poisoning, tool calling permissions) inspired Phase 7. Their framework-level auto-detection (detecting "Next.js" not just "Node/TypeScript") inspired Phase 0's framework detection step.
9
- - **[Snyk ToxicSkills Research](https://snyk.io/blog/toxicskills-malicious-ai-agent-skills-clawhub/)** — The finding that 36% of AI agent skills have security flaws and 13.4% are malicious inspired Phase 8 (Skill Supply Chain scanning).
10
- - **[Daniel Miessler's Personal AI Infrastructure](https://github.com/danielmiessler/Personal_AI_Infrastructure)** — The incident response playbooks and protection file concept informed the remediation and LLM security phases.
11
- - **[McGo/claude-code-security-audit](https://github.com/McGo/claude-code-security-audit)** — The idea of generating shareable reports and actionable epics informed our report format evolution.
12
- - **[Claude Code Security Pack](https://dev.to/myougatheaxo/automate-owasp-security-audits-with-claude-code-security-pack-4mah)** — Modular approach (separate /security-audit, /secret-scanner, /deps-check skills) validated that these are distinct concerns. Our unified approach sacrifices modularity for cross-phase reasoning.
13
- - **[Anthropic Claude Code Security](https://www.anthropic.com/news/claude-code-security)** — Multi-stage verification and confidence scoring validated our parallel finding verification approach. Found 500+ zero-days in open source.
14
- - **[@gus_argon](https://x.com/gus_aragon/status/2035841289602904360)** — Identified critical v1 blind spots: no stack detection (runs all-language patterns), uses bash grep instead of Claude Code's Grep tool, `| head -20` truncates results silently, and preamble bloat. These directly shaped v2's stack-first approach and Grep tool mandate.